From 64300ab0ee77e3f84c2ee7ba9dbee7455276c543 Mon Sep 17 00:00:00 2001 From: falkTX Date: Tue, 19 Dec 2023 20:31:52 +0100 Subject: [PATCH] Cleanup bootstrap scripts for allow defined as 0 variables Signed-off-by: falkTX --- bootstrap-carla.sh | 2 +- bootstrap-common.sh | 14 +++++++------- bootstrap-mod.sh | 2 +- bootstrap-plugins.sh | 44 +++++++++++++++++++++---------------------- setup/check_target.sh | 4 ++++ 5 files changed, 35 insertions(+), 31 deletions(-) diff --git a/bootstrap-carla.sh b/bootstrap-carla.sh index 908cd62..0c7affe 100755 --- a/bootstrap-carla.sh +++ b/bootstrap-carla.sh @@ -47,7 +47,7 @@ fi # --------------------------------------------------------------------------------------------------------------------- # everything after this point requires Qt or PyQt -if [ -n "${PAWPAW_SKIP_QT}" ]; then +if [ -n "${PAWPAW_SKIP_QT}" ] && [ "${PAWPAW_SKIP_QT}" -eq 1 ]; then exit 0 fi diff --git a/bootstrap-common.sh b/bootstrap-common.sh index 0fa5853..2385560 100755 --- a/bootstrap-common.sh +++ b/bootstrap-common.sh @@ -291,7 +291,7 @@ fi download libogg "${LIBOGG_VERSION}" "${LIBOGG_URL}" build_autoconf libogg "${LIBOGG_VERSION}" -if [ "${CROSS_COMPILING}" -eq 0 ] && [ -z "${PAWPAW_SKIP_TESTS}" ]; then +if [ -n "${PAWPAW_SKIP_TESTS}" ] && [ "${PAWPAW_SKIP_TESTS}" -eq 1 ]; then run_make libogg "${LIBOGG_VERSION}" "check -j 1" fi @@ -303,7 +303,7 @@ LIBVORBIS_EXTRAFLAGS="--disable-examples" download libvorbis "${LIBVORBIS_VERSION}" "${LIBVORBIS_URL}" build_autoconf libvorbis "${LIBVORBIS_VERSION}" "${LIBVORBIS_EXTRAFLAGS}" -if [ "${CROSS_COMPILING}" -eq 0 ] && [ -z "${PAWPAW_SKIP_TESTS}" ]; then +if [ -n "${PAWPAW_SKIP_TESTS}" ] && [ "${PAWPAW_SKIP_TESTS}" -eq 1 ]; then run_make libvorbis "${LIBVORBIS_VERSION}" "check -j 1" fi @@ -334,7 +334,7 @@ fi download flac "${FLAC_VERSION}" "${FLAC_URL}" "tar.xz" build_autoconf flac "${FLAC_VERSION}" "${FLAC_EXTRAFLAGS}" -if [ "${CROSS_COMPILING}" -eq 0 ] && [ -z "${PAWPAW_SKIP_TESTS}" ]; then +if [ -n "${PAWPAW_SKIP_TESTS}" ] && [ "${PAWPAW_SKIP_TESTS}" -eq 1 ]; then run_make flac "${FLAC_VERSION}" "check -j 1" fi @@ -358,7 +358,7 @@ fi download opus "${OPUS_VERSION}" "${OPUS_URL}" build_autoconf opus "${OPUS_VERSION}" "${OPUS_EXTRAFLAGS}" -if [ "${CROSS_COMPILING}" -eq 0 ] && [ -z "${PAWPAW_SKIP_TESTS}" ]; then +if [ -n "${PAWPAW_SKIP_TESTS}" ] && [ "${PAWPAW_SKIP_TESTS}" -eq 1 ]; then run_make opus "${OPUS_VERSION}" check fi @@ -396,14 +396,14 @@ download libsndfile "${LIBSNDFILE_VERSION}" "${LIBSNDFILE_URL}" "tar.xz" build_autoconf libsndfile "${LIBSNDFILE_VERSION}" "${LIBSNDFILE_EXTRAFLAGS}" -if [ "${CROSS_COMPILING}" -eq 0 ] && [ -z "${PAWPAW_SKIP_TESTS}" ]; then +if [ -n "${PAWPAW_SKIP_TESTS}" ] && [ "${PAWPAW_SKIP_TESTS}" -eq 1 ]; then run_make libsndfile "${LIBSNDFILE_VERSION}" check fi # --------------------------------------------------------------------------------------------------------------------- # libsamplerate -if [ -z "${PAWPAW_SKIP_SAMPLERATE}" ]; then +if [ -z "${PAWPAW_SKIP_SAMPLERATE}" ] && [ "${PAWPAW_SKIP_SAMPLERATE}" -eq 1 ]; then LIBSAMPLERATE_EXTRAFLAGS="--disable-fftw" @@ -415,7 +415,7 @@ fi download libsamplerate "${LIBSAMPLERATE_VERSION}" "${LIBSAMPLERATE_URL}" build_autoconf libsamplerate "${LIBSAMPLERATE_VERSION}" "${LIBSAMPLERATE_EXTRAFLAGS}" -if [ "${CROSS_COMPILING}" -eq 0 ] && [ "${MACOS}" -eq 0 ] && [ -z "${PAWPAW_SKIP_TESTS}" ]; then +if [ "${MACOS}" -eq 0 ] && [ -n "${PAWPAW_SKIP_TESTS}" ] && [ "${PAWPAW_SKIP_TESTS}" -eq 1 ]; then run_make libsamplerate "${LIBSAMPLERATE_VERSION}" check fi diff --git a/bootstrap-mod.sh b/bootstrap-mod.sh index 69bd650..df150b3 100755 --- a/bootstrap-mod.sh +++ b/bootstrap-mod.sh @@ -157,7 +157,7 @@ build_waf lvtk1 "${LVTK1_VERSION}" "${LVTK1_EXTRAFLAGS}" # --------------------------------------------------------------------------------------------------------------------- -if [ -n "${PAWPAW_SKIP_PYTHON_MODULES}" ]; then +if [ -n "${PAWPAW_SKIP_PYTHON_MODULES}" ] && [ "${PAWPAW_SKIP_PYTHON_MODULES}" -eq 1 ]; then exit 0 fi diff --git a/bootstrap-plugins.sh b/bootstrap-plugins.sh index 55448c6..e6d9dd2 100755 --- a/bootstrap-plugins.sh +++ b/bootstrap-plugins.sh @@ -18,7 +18,7 @@ fi # --------------------------------------------------------------------------------------------------------------------- # skip fluidsynth if glib is not wanted (fluidsynth requires glib) -if [ -n "${PAWPAW_SKIP_GLIB}" ]; then +if [ -n "${PAWPAW_SKIP_GLIB}" ] && [ "${PAWPAW_SKIP_GLIB}" -eq 1 ]; then PAWPAW_SKIP_FLUIDSYNTH=1 fi @@ -43,7 +43,7 @@ if [ -z "${autoconf}" ]; then exit 2 fi -if [ -z "${PAWPAW_SKIP_LV2}" ]; then +if [ -z "${PAWPAW_SKIP_LV2}" ] && [ "${PAWPAW_SKIP_LV2}" -eq 1 ]; then if [ -z "${meson}" ]; then echo "missing 'meson' program, cannot continue!" exit 2 @@ -78,7 +78,7 @@ fi download libpng "${LIBPNG_VERSION}" "${LIBPNG_URL}" "tar.xz" build_autoconf libpng "${LIBPNG_VERSION}" "${LIBPNG_EXTRAFLAGS}" -if [ "${CROSS_COMPILING}" -eq 0 ] && [ -z "${PAWPAW_SKIP_TESTS}" ]; then +if [ -n "${PAWPAW_SKIP_TESTS}" ] && [ "${PAWPAW_SKIP_TESTS}" -eq 1 ]; then run_make libpng "${LIBPNG_VERSION}" "check -j 1" fi @@ -122,7 +122,7 @@ download pixman "${PIXMAN_VERSION}" "${PIXMAN_URL}" build_autoconf pixman "${PIXMAN_VERSION}" "${PIXMAN_EXTRAFLAGS}" # FIXME tests fail on i686 CI builds -if [ "${CROSS_COMPILING}" -eq 0 ] && [ -z "${PAWPAW_SKIP_TESTS}" ] && [ "x${LINUX_TARGET}" != "xlinux-i686" ]; then +if [ -n "${PAWPAW_SKIP_TESTS}" ] && [ "${PAWPAW_SKIP_TESTS}" -eq 1 ] && [ "x${LINUX_TARGET}" != "xlinux-i686" ]; then run_make pixman "${PIXMAN_VERSION}" check fi @@ -178,7 +178,7 @@ download fontconfig "${FONTCONFIG_VERSION}" "${FONTCONFIG_URL}" build_autoconf fontconfig "${FONTCONFIG_VERSION}" "${FONTCONFIG_EXTRAFLAGS}" # tests fail on stable release, see https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/177 -# if [ "${CROSS_COMPILING}" -eq 0 ] && [ -z "${PAWPAW_SKIP_TESTS}" ]; then +# if [ -n "${PAWPAW_SKIP_TESTS}" ] && [ "${PAWPAW_SKIP_TESTS}" -eq 1 ]; then # run_make fontconfig "${FONTCONFIG_VERSION}" check # fi @@ -276,14 +276,14 @@ download cairo "${CAIRO_VERSION}" "${CAIRO_URL}" "tar.xz" build_autoconf cairo "${CAIRO_VERSION}" "${CAIRO_EXTRAFLAGS}" # FIXME tests are failing :( -# if [ "${CROSS_COMPILING}" -eq 0 ] && [ -z "${PAWPAW_SKIP_TESTS}" ]; then +# if [ -n "${PAWPAW_SKIP_TESTS}" ] && [ "${PAWPAW_SKIP_TESTS}" -eq 1 ]; then # run_make cairo "${CAIRO_VERSION}" "check -j 1" # fi # --------------------------------------------------------------------------------------------------------------------- # fftw -if [ -z "${PAWPAW_SKIP_FFTW}" ]; then +if [ -z "${PAWPAW_SKIP_FFTW}" ] && [ "${PAWPAW_SKIP_FFTW}" -eq 1 ]; then # fftw is not compatible with LTO if [ -z "${PAWPAW_SKIP_LTO}" ] || [ "${PAWPAW_SKIP_LTO}" -eq 0 ]; then @@ -312,7 +312,7 @@ fi download fftw "${FFTW_VERSION}" "${FFTW_URL}" build_autoconf fftw "${FFTW_VERSION}" "${FFTW_EXTRAFLAGS}" -if [ "${CROSS_COMPILING}" -eq 0 ] && [ -z "${PAWPAW_SKIP_TESTS}" ]; then +if [ -n "${PAWPAW_SKIP_TESTS}" ] && [ "${PAWPAW_SKIP_TESTS}" -eq 1 ]; then run_make fftw "${FFTW_VERSION}" check fi @@ -321,7 +321,7 @@ fi # PAWPAW_SKIP_FFTW # --------------------------------------------------------------------------------------------------------------------- # fftwf -if [ -z "${PAWPAW_SKIP_FFTW}" ]; then +if [ -z "${PAWPAW_SKIP_FFTW}" ] && [ "${PAWPAW_SKIP_FFTW}" -eq 1 ]; then # fftw is not compatible with LTO if [ -z "${PAWPAW_SKIP_LTO}" ] || [ "${PAWPAW_SKIP_LTO}" -eq 0 ]; then @@ -340,7 +340,7 @@ fi copy_download fftw fftwf "${FFTW_VERSION}" build_autoconf fftwf "${FFTW_VERSION}" "${FFTWF_EXTRAFLAGS}" -if [ "${CROSS_COMPILING}" -eq 0 ] && [ -z "${PAWPAW_SKIP_TESTS}" ]; then +if [ -n "${PAWPAW_SKIP_TESTS}" ] && [ "${PAWPAW_SKIP_TESTS}" -eq 1 ]; then run_make fftwf "${FFTW_VERSION}" check fi @@ -367,7 +367,7 @@ fi # --------------------------------------------------------------------------------------------------------------------- # glib -if [ -z "${PAWPAW_SKIP_GLIB}" ]; then +if [ -z "${PAWPAW_SKIP_GLIB}" ] && [ "${PAWPAW_SKIP_GLIB}" -eq 1 ]; then if [ "${MACOS}" -eq 1 ] || [ "${WASM}" -eq 1 ] || [ "${WIN32}" -eq 1 ]; then GLIB_EXTRAFLAGS="--disable-rebuilds" @@ -408,7 +408,7 @@ fi # PAWPAW_SKIP_GLIB LIBLO_EXTRAFLAGS="--enable-threads --disable-examples --disable-tools" -if [ "${CROSS_COMPILING}" -eq 1 ]; then +if [ -z "${PAWPAW_SKIP_TESTS}" ] || [ "${PAWPAW_SKIP_TESTS}" -ne 1 ]; then LIBLO_EXTRAFLAGS+=" --disable-tests" fi @@ -424,14 +424,14 @@ download liblo "${LIBLO_VERSION}" "${LIBLO_URL}" build_autoconf liblo "${LIBLO_VERSION}" "${LIBLO_EXTRAFLAGS}" # FIXME tests fail on macOS -if [ "${CROSS_COMPILING}" -eq 0 ] && [ -z "${PAWPAW_SKIP_TESTS}" ] && [ "${MACOS}" -eq 0 ]; then +if [ -n "${PAWPAW_SKIP_TESTS}" ] && [ "${PAWPAW_SKIP_TESTS}" -eq 1 ] && [ "${MACOS}" -eq 0 ]; then run_make liblo "${LIBLO_VERSION}" check fi # --------------------------------------------------------------------------------------------------------------------- # serd -if [ -z "${PAWPAW_SKIP_LV2}" ]; then +if [ -z "${PAWPAW_SKIP_LV2}" ] && [ "${PAWPAW_SKIP_LV2}" -eq 1 ]; then if [ "${CROSS_COMPILING}" -eq 1 ] && [ "${LINUX}" -eq 0 ] && [ -z "${EXE_WRAPPER}" ]; then SERD_EXTRAFLAGS="-Dtools=disabled" @@ -447,7 +447,7 @@ fi # PAWPAW_SKIP_LV2 # --------------------------------------------------------------------------------------------------------------------- # sord -if [ -z "${PAWPAW_SKIP_LV2}" ]; then +if [ -z "${PAWPAW_SKIP_LV2}" ] && [ "${PAWPAW_SKIP_LV2}" -eq 1 ]; then if [ "${CROSS_COMPILING}" -eq 1 ] && [ "${LINUX}" -eq 0 ] && [ -z "${EXE_WRAPPER}" ]; then SORD_EXTRAFLAGS="-Dtools=disabled" @@ -461,7 +461,7 @@ fi # PAWPAW_SKIP_LV2 # --------------------------------------------------------------------------------------------------------------------- # lv2 -if [ -z "${PAWPAW_SKIP_LV2}" ]; then +if [ -z "${PAWPAW_SKIP_LV2}" ] && [ "${PAWPAW_SKIP_LV2}" -eq 1 ]; then git_clone lv2 "${LV2_VERSION}" "${LV2_URL}" build_meson lv2 "${LV2_VERSION}" "-Dlv2dir=${PAWPAW_PREFIX}/lib/lv2 -Dplugins=disabled" @@ -471,7 +471,7 @@ fi # PAWPAW_SKIP_LV2 # --------------------------------------------------------------------------------------------------------------------- # sratom -if [ -z "${PAWPAW_SKIP_LV2}" ]; then +if [ -z "${PAWPAW_SKIP_LV2}" ] && [ "${PAWPAW_SKIP_LV2}" -eq 1 ]; then download sratom "${SRATOM_VERSION}" "${SRATOM_URL}" "tar.xz" build_meson sratom "${SRATOM_VERSION}" "-Ddefault_library=static -Ddocs=disabled" @@ -481,7 +481,7 @@ fi # PAWPAW_SKIP_LV2 # --------------------------------------------------------------------------------------------------------------------- # lilv -if [ -z "${PAWPAW_SKIP_LV2}" ]; then +if [ -z "${PAWPAW_SKIP_LV2}" ] && [ "${PAWPAW_SKIP_LV2}" -eq 1 ]; then if [ "${CROSS_COMPILING}" -eq 1 ] && [ "${LINUX}" -eq 0 ]; then LILV_EXTRAFLAGS="-Dtests=disabled -Dtools=disabled" @@ -495,7 +495,7 @@ fi # PAWPAW_SKIP_LV2 # --------------------------------------------------------------------------------------------------------------------- # lv2lint -if [ -z "${PAWPAW_SKIP_LV2}" ]; then +if [ -z "${PAWPAW_SKIP_LV2}" ] && [ "${PAWPAW_SKIP_LV2}" -eq 1 ]; then if [ "${LV2LINT_SUPPORTED}" -eq 1 ]; then download lv2lint "${LV2LINT_VERSION}" "${LV2LINT_URL}" @@ -508,7 +508,7 @@ fi # PAWPAW_SKIP_LV2 # --------------------------------------------------------------------------------------------------------------------- # kxstudio lv2 extensions -if [ -z "${PAWPAW_SKIP_LV2}" ]; then +if [ -z "${PAWPAW_SKIP_LV2}" ] && [ "${PAWPAW_SKIP_LV2}" -eq 1 ]; then git_clone kxstudio-lv2-extensions "${KXSTUDIO_LV2_EXTENSIONS_VERSION}" "${KXSTUDIO_LV2_EXTENSIONS_URL}" build_make kxstudio-lv2-extensions "${KXSTUDIO_LV2_EXTENSIONS_VERSION}" @@ -518,7 +518,7 @@ fi # PAWPAW_SKIP_LV2 # --------------------------------------------------------------------------------------------------------------------- # MOD lv2 extensions -if [ -z "${PAWPAW_SKIP_LV2}" ]; then +if [ -z "${PAWPAW_SKIP_LV2}" ] && [ "${PAWPAW_SKIP_LV2}" -eq 1 ]; then git_clone mod-sdk "${MOD_SDK_VERSION}" "${MOD_SDK_URL}" build_make mod-sdk "${MOD_SDK_VERSION}" @@ -528,7 +528,7 @@ fi # PAWPAW_SKIP_LV2 # --------------------------------------------------------------------------------------------------------------------- # fluidsynth -if [ -z "${PAWPAW_SKIP_FLUIDSYNTH}" ]; then +if [ -z "${PAWPAW_SKIP_FLUIDSYNTH}" ] && [ "${PAWPAW_SKIP_FLUIDSYNTH}" -eq 1 ]; then FLUIDSYNTH_EXTRAFLAGS="-Denable-floats=ON" FLUIDSYNTH_EXTRAFLAGS+=" -Denable-alsa=OFF" diff --git a/setup/check_target.sh b/setup/check_target.sh index 5507098..b946b7c 100644 --- a/setup/check_target.sh +++ b/setup/check_target.sh @@ -171,3 +171,7 @@ function check_target() { } check_target + +if [ "${CROSS_COMPILING}" -eq 1 ]; then + PAWPAW_SKIP_TESTS=${PAWPAW_SKIP_TESTS:=1} +fi