Signed-off-by: falkTX <falktx@falktx.com>pull/28/head
@@ -15,19 +15,6 @@ if [ -z "${target}" ]; then | |||
exit 1 | |||
fi | |||
# --------------------------------------------------------------------------------------------------------------------- | |||
# TODO check for depedencies: | |||
# - curl | |||
# - cmake | |||
# - make | |||
# - jq | |||
# - patch | |||
# - pkg-config (linux only) | |||
# - python (waf, meson) | |||
# - sed | |||
# - tar | |||
# --------------------------------------------------------------------------------------------------------------------- | |||
# source setup code | |||
@@ -36,6 +23,49 @@ source setup/env.sh | |||
source setup/functions.sh | |||
source setup/versions.sh | |||
# --------------------------------------------------------------------------------------------------------------------- | |||
# check for depedencies | |||
if ! command -v curl >/dev/null; then | |||
echo "missing 'curl' program, cannot continue!" | |||
exit 2 | |||
fi | |||
if ! command -v make >/dev/null; then | |||
echo "missing 'make' program, cannot continue!" | |||
exit 2 | |||
fi | |||
if ! command -v patch >/dev/null; then | |||
echo "missing 'patch' program, cannot continue!" | |||
exit 2 | |||
fi | |||
if ! command -v python3 >/dev/null; then | |||
echo "missing 'python3' program, cannot continue!" | |||
exit 2 | |||
fi | |||
if ! command -v sed >/dev/null; then | |||
echo "missing 'sed' program, cannot continue!" | |||
exit 2 | |||
fi | |||
if ! command -v tar >/dev/null; then | |||
echo "missing 'tar' program, cannot continue!" | |||
exit 2 | |||
fi | |||
if [ "${LINUX}" -eq 1 ] && ! command -v pkg-config >/dev/null; then | |||
echo "missing 'pkg-config' program, cannot continue!" | |||
exit 2 | |||
fi | |||
if [ -z "${cmake}" ]; then | |||
echo "missing 'cmake' program, cannot continue!" | |||
exit 2 | |||
fi | |||
# --------------------------------------------------------------------------------------------------------------------- | |||
# create common directories | |||
@@ -170,7 +200,7 @@ FLAC_EXTRAFLAGS+=" --disable-xmms-plugin" | |||
if [ -n "${PAWPAW_NOSIMD}" ] && [ "${PAWPAW_NOSIMD}" -ne 0 ]; then | |||
FLAC_EXTRAFLAGS+=" ac_cv_header_x86intrin_h=no ac_cv_header_arm_neon_h=no asm_opt=no" | |||
elif [ "${WASM}" -eq 1 ]; then | |||
elif [ "${MACOS_UNIVERSAL}" -eq 1 ] || [ "${WASM}" -eq 1 ]; then | |||
# FIXME | |||
FLAC_EXTRAFLAGS+=" ac_cv_header_x86intrin_h=no ac_cv_header_arm_neon_h=no asm_opt=no" | |||
else | |||
@@ -35,6 +35,24 @@ source setup/env.sh | |||
source setup/functions.sh | |||
source setup/versions.sh | |||
# --------------------------------------------------------------------------------------------------------------------- | |||
# check for depedencies | |||
if [ -z "${autoconf}" ]; then | |||
echo "missing 'autoconf' program, cannot continue!" | |||
exit 2 | |||
fi | |||
if [ -z "${meson}" ]; then | |||
echo "missing 'meson' program, cannot continue!" | |||
exit 2 | |||
fi | |||
if [ -z "${ninja}" ]; then | |||
echo "missing 'ninja' program, cannot continue!" | |||
exit 2 | |||
fi | |||
# --------------------------------------------------------------------------------------------------------------------- | |||
# libpng | |||
@@ -19,12 +19,21 @@ shift | |||
# TODO check that bootstrap.sh has been run | |||
# --------------------------------------------------------------------------------------------------------------------- | |||
# source setup code | |||
source setup/check_target.sh | |||
source setup/env.sh | |||
source setup/functions.sh | |||
source setup/versions.sh | |||
# --------------------------------------------------------------------------------------------------------------------- | |||
# check for depedencies | |||
if [ -z "${jq}" ]; then | |||
echo "missing 'jq' program, cannot continue!" | |||
exit 2 | |||
fi | |||
# --------------------------------------------------------------------------------------------------------------------- | |||
LV2DIR="${PAWPAW_PREFIX}/lib/lv2" | |||
@@ -100,18 +109,18 @@ for plugin in ${@}; do | |||
exit 2 | |||
fi | |||
name=$(jq -crM .name ${pfile}) | |||
version=$(jq -crM .version ${pfile}) | |||
buildtype=$(jq -crM .buildtype ${pfile}) | |||
dlbaseurl=$(jq -crM .dlbaseurl ${pfile}) | |||
lv2bundles=($(jq -crM .lv2bundles[] ${pfile})) | |||
name=$(${jq} -crM .name ${pfile}) | |||
version=$(${jq} -crM .version ${pfile}) | |||
buildtype=$(${jq} -crM .buildtype ${pfile}) | |||
dlbaseurl=$(${jq} -crM .dlbaseurl ${pfile}) | |||
lv2bundles=($(${jq} -crM .lv2bundles[] ${pfile})) | |||
# optional args | |||
buildargs=$(echo -e $(jq -ecrM .buildargs ${pfile} || echo '\n\n') | tail -n 1) | |||
dlext=$(echo -e $(jq -ecrM .dlext ${pfile} || echo '\n\n') | tail -n 1) | |||
dlmethod=$(echo -e $(jq -ecrM .dlmethod ${pfile} || echo '\n\n') | tail -n 1) | |||
dlname=$(echo -e $(jq -ecrM .dlname ${pfile} || echo '\n\n') | tail -n 1) | |||
combinedbundles=$(echo -e $(jq -ecrM .combinedbundles ${pfile} || echo '\n\n') | tail -n 1) | |||
buildargs=$(echo -e $(${jq} -ecrM .buildargs ${pfile} || echo '\n\n') | tail -n 1) | |||
dlext=$(echo -e $(${jq} -ecrM .dlext ${pfile} || echo '\n\n') | tail -n 1) | |||
dlmethod=$(echo -e $(${jq} -ecrM .dlmethod ${pfile} || echo '\n\n') | tail -n 1) | |||
dlname=$(echo -e $(${jq} -ecrM .dlname ${pfile} || echo '\n\n') | tail -n 1) | |||
combinedbundles=$(echo -e $(${jq} -ecrM .combinedbundles ${pfile} || echo '\n\n') | tail -n 1) | |||
download "${name}" "${version}" "${dlbaseurl}" "${dlext}" "${dlmethod}" "${dlname}" | |||
@@ -1,6 +1,5 @@ | |||
#!/bin/bash | |||
PAWPAW_ROOT="${PWD}" | |||
SOURCING_FILES=1 | |||
target="${1}" | |||
@@ -19,10 +19,19 @@ shift | |||
VERSION=$(cat VERSION) | |||
# --------------------------------------------------------------------------------------------------------------------- | |||
# source setup code | |||
source setup/check_target.sh | |||
source setup/env.sh | |||
# --------------------------------------------------------------------------------------------------------------------- | |||
# check for depedencies | |||
if [ -z "${jq}" ]; then | |||
echo "missing 'jq' program, cannot continue!" | |||
exit 2 | |||
fi | |||
# --------------------------------------------------------------------------------------------------------------------- | |||
function download_and_install_innosetup { | |||
@@ -78,10 +87,10 @@ for plugin in ${@}; do | |||
exit 2 | |||
fi | |||
name=$(jq -crM .name ${pfile}) | |||
name=$(${jq} -crM .name ${pfile}) | |||
sname=$(echo ${name} | tr -ds '-' '_') | |||
description=$(jq -crM .description ${pfile}) | |||
lv2bundles=($(jq -crM .lv2bundles[] ${pfile})) | |||
description=$(${jq} -crM .description ${pfile}) | |||
lv2bundles=($(${jq} -crM .lv2bundles[] ${pfile})) | |||
if [ "${WIN32}" -eq 1 ]; then | |||
echo "Name: ${sname}; Description: \"${name}\"; Types: full;" >> /tmp/pawpaw/components.iss | |||
@@ -212,6 +212,43 @@ if [ -n "${PAWPAW_SKIP_STRIPPING}" ] && [ "${PAWPAW_SKIP_STRIPPING}" -eq 1 ]; th | |||
TARGET_STRIP="true" | |||
fi | |||
# --------------------------------------------------------------------------------------------------------------------- | |||
# find needed programs | |||
if [ -z "${SOURCING_FILES}" ]; then | |||
set +e | |||
fi | |||
autoconf=$(command -v autoconf) | |||
cmake=$(command -v cmake) | |||
jq=$(command -v jq) | |||
meson=$(command -v meson) | |||
ninja=$(command -v meson) | |||
if [ -z "${SOURCING_FILES}" ]; then | |||
set -e | |||
fi | |||
if [ -z "${autoconf}" ] && [ -e "/opt/homebrew/bin/autoconf" ]; then | |||
autoconf="/opt/homebrew/bin/autoconf" | |||
fi | |||
if [ -z "${cmake}" ] && [ -e "/opt/homebrew/bin/cmake" ]; then | |||
cmake="/opt/homebrew/bin/cmake" | |||
fi | |||
if [ -z "${jq}" ] && [ -e "/opt/homebrew/bin/jq" ]; then | |||
jq="/opt/homebrew/bin/jq" | |||
fi | |||
if [ -z "${meson}" ] && [ -e "/opt/homebrew/bin/meson" ]; then | |||
meson="/opt/homebrew/bin/meson" | |||
fi | |||
if [ -z "${ninja}" ] && [ -e "/opt/homebrew/bin/ninja" ]; then | |||
ninja="/opt/homebrew/bin/ninja" | |||
fi | |||
# --------------------------------------------------------------------------------------------------------------------- | |||
# other | |||
@@ -28,7 +28,7 @@ function download() { | |||
rm -rf "${tmprepodir}" | |||
git clone --recursive "${dlbaseurl}" "${tmprepodir}" | |||
git -C "${tmprepodir}" checkout "${version}" | |||
git -C "${tmprepodir}" submodule update | |||
git -C "${tmprepodir}" submodule update --recursive --init | |||
tar --exclude=".git" -czf "${dlfile}" -C "${PAWPAW_TMPDIR}" "${dlname}-${version}" | |||
rm -rf "${tmprepodir}" | |||
else | |||
@@ -96,7 +96,7 @@ function git_clone() { | |||
rm -rf "${tmprepodir}" | |||
git clone --recursive "${repourl}" "${tmprepodir}" | |||
git -C "${tmprepodir}" checkout "${hash}" | |||
git -C "${tmprepodir}" submodule update | |||
git -C "${tmprepodir}" submodule update --recursive --init | |||
tar --exclude=".git" -czf "${dlfile}" -C "${PAWPAW_TMPDIR}" "${dlname}-${hash}" | |||
rm -rf "${tmprepodir}" | |||
fi | |||
@@ -257,7 +257,7 @@ function build_autoconfgen() { | |||
if [ -f utils/autogen.sh ]; then | |||
./utils/autogen.sh | |||
else | |||
autoconf | |||
${autoconf} | |||
fi | |||
touch .stamp_preconfigured | |||
popd | |||
@@ -355,7 +355,7 @@ function build_cmake() { | |||
if [ ! -f "${pkgdir}/.stamp_configured" ]; then | |||
pushd "${pkgdir}/build" | |||
${CMAKE_EXE_WRAPPER} cmake -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_INSTALL_PREFIX="${PAWPAW_PREFIX}" ${extraconfrules} .. | |||
${CMAKE_EXE_WRAPPER} ${cmake} -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_INSTALL_PREFIX="${PAWPAW_PREFIX}" ${extraconfrules} .. | |||
touch ../.stamp_configured | |||
popd | |||
fi | |||
@@ -420,21 +420,21 @@ function build_meson() { | |||
if [ ! -f "${pkgdir}/.stamp_configured" ]; then | |||
pushd "${pkgdir}" | |||
meson build --buildtype release --prefix "${PAWPAW_PREFIX}" --libdir lib ${extraconfrules} | |||
env NINJA="${ninja}" ${meson} build --buildtype release --prefix "${PAWPAW_PREFIX}" --libdir lib ${extraconfrules} | |||
touch .stamp_configured | |||
popd | |||
fi | |||
if [ ! -f "${pkgdir}/.stamp_built" ]; then | |||
pushd "${pkgdir}" | |||
ninja -v -C build | |||
${ninja} -v -C build | |||
touch .stamp_built | |||
popd | |||
fi | |||
if [ ! -f "${pkgdir}/.stamp_installed" ]; then | |||
pushd "${pkgdir}" | |||
ninja -C build install | |||
${ninja} -C build install | |||
touch .stamp_installed | |||
popd | |||
fi | |||