From 52648a3274da7e9adb9aee19f965b584729ad648 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Tue, 23 Jul 2019 17:47:11 +0200 Subject: [PATCH 1/3] libpbuild: missing targets added (#56) --- Pmodules/libpbuild.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Pmodules/libpbuild.bash b/Pmodules/libpbuild.bash index 83562ad..86dd8d1 100644 --- a/Pmodules/libpbuild.bash +++ b/Pmodules/libpbuild.bash @@ -983,9 +983,9 @@ pbuild::make_all() { return 0 fi local targets=() - targets+=( "pre_${target}_${system}" "pre_${target}" ) + targets+=( "pre_${target}_${system}" "pre_${target}_${OS}" "pre_${target}" ) targets+=( "${target}" ) - targets+=( "post_${target}_${system}" "post_${target}" ) + targets+=( "post_${target}_${system}" "post_${target}_${OS}" "post_${target}" ) for t in "${targets[@]}"; do # We cd into the dir before calling the function - From 85fc352f10504f23a794e00fa74a365d6d21229d Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Tue, 23 Jul 2019 17:48:11 +0200 Subject: [PATCH 2/3] libstd.bash: setting of unused variable OS removed --- Pmodules/libstd.bash | 1 - 1 file changed, 1 deletion(-) diff --git a/Pmodules/libstd.bash b/Pmodules/libstd.bash index b3e5e1b..8447915 100644 --- a/Pmodules/libstd.bash +++ b/Pmodules/libstd.bash @@ -289,7 +289,6 @@ std.get_os_release_macos() { } std::get_os_release() { - local -r OS=$(uname -s) local -A func_map; func_map['Linux']=std.get_os_release_linux func_map['Darwin']=std.get_os_release_macos From 38a09a8ba36df6eebdc7b91c7951e605603a501a Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Tue, 23 Jul 2019 17:49:54 +0200 Subject: [PATCH 3/3] fixes for issues #57 and #58 - fixes building dependencies on macOS (#57) - fixes errors in parsing arguments (#58) --- Pmodules/modbuild.in | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/Pmodules/modbuild.in b/Pmodules/modbuild.in index e13b498..9b60313 100755 --- a/Pmodules/modbuild.in +++ b/Pmodules/modbuild.in @@ -16,7 +16,13 @@ declare -r mydir=$(cd ${mydir} && pwd -P) # initialize PATH, # add library installation directories to the PATH, # so 'source' is able find them -PATH="/usr/bin:/bin:/usr/sbin:/sbin" + +if [[ $(uname -s) == 'Darwin' ]]; then + PATH='/usr/local/bin:' +else + PATH='' +fi +PATH+='/usr/bin:/bin:/usr/sbin:/sbin' PATH+=":${mydir}" PATH+=":${mydir}/../lib:${mydir}/../config" @@ -179,31 +185,31 @@ parse_args() { opt_build_config="${1#*=}" ;; --enable-cleanup ) - opt_enable_cleanup_build 'yes' - opt_enable_cleanup_src 'yes' + opt_enable_cleanup_build='yes' + opt_enable_cleanup_src='yes' ;; --disable-cleanup ) - opt_enable_cleanup_build 'no' - opt_enable_cleanup_src 'no' + opt_enable_cleanup_build='no' + opt_enable_cleanup_src='no' ;; --enable-cleanup-build ) - opt_enable_cleanup_build 'yes' + opt_enable_cleanup_build='yes' ;; --disable-cleanup-build ) - opt_enable_cleanup_build 'no' + opt_enable_cleanup_build='no' ;; --enable-cleanup-src ) - opt_enable_cleanup_src 'yes' + opt_enable_cleanup_src='yes' ;; --disable-cleanup-src ) - opt_enable_cleanup_src 'no' + opt_enable_cleanup_src='no' ;; --distdir ) - opt_distfiles_dir "$2" + opt_distfiles_dir="$2" shift ;; --distdir=* ) - opt_distfiles_dir "${1/--distdir=}" + opt_distfiles_dir="${1/--distdir=}" ;; --tmpdir ) opt_temp_dir="$2" @@ -408,8 +414,14 @@ source libpbuild_dyn.bash || \ if [[ "${opt_bootstrap}" == 'yes' ]]; then test -d "${BUILDBLOCK_DIR}/../../${PMODULES_CONFIG_DIR}" && PATH+=":$_" else - test -d "${PMODULES_ROOT}/${PMODULES_CONFIG_DIR}" && PATH+=":$_" + # Please note: if we trap DEBUG a statement like + # test -d ... && PATH+=$_ + # does not work (at least on macOS with bash 4 and 5) + if [[ -d "${PMODULES_ROOT}/${PMODULES_CONFIG_DIR}" ]]; then + PATH+=":${PMODULES_ROOT}/${PMODULES_CONFIG_DIR}" + fi fi +echo PATH=$PATH source "${opt_build_config}" || \ std::die 3 "Oops: Cannot source configuration file -- '$_'"