From 4242694a0e85e375a5827f6a54f46e715a99cd96 Mon Sep 17 00:00:00 2001 From: Ivan Pozdeev Date: Thu, 12 Jan 2023 14:17:35 +0300 Subject: [PATCH 1/2] Fix priority for user-supplied configure and make flags --- plugins/python-build/bin/python-build | 4 ++-- plugins/python-build/test/build.bats | 30 +++++++++++++++++++++++- plugins/python-build/test/pyenv_ext.bats | 2 +- 3 files changed, 32 insertions(+), 4 deletions(-) diff --git a/plugins/python-build/bin/python-build b/plugins/python-build/bin/python-build index af1bbf94..87ba0ff3 100755 --- a/plugins/python-build/bin/python-build +++ b/plugins/python-build/bin/python-build @@ -813,10 +813,10 @@ build_package_standard_build() { export CC=clang fi ${!PACKAGE_CONFIGURE:-./configure} --prefix="${!PACKAGE_PREFIX_PATH:-$PREFIX_PATH}" \ - $CONFIGURE_OPTS ${!PACKAGE_CONFIGURE_OPTS} "${!PACKAGE_CONFIGURE_OPTS_ARRAY}" || return 1 + "${!PACKAGE_CONFIGURE_OPTS_ARRAY}" $CONFIGURE_OPTS ${!PACKAGE_CONFIGURE_OPTS} || return 1 ) >&4 2>&1 - { "$MAKE" $MAKE_OPTS ${!PACKAGE_MAKE_OPTS} "${!PACKAGE_MAKE_OPTS_ARRAY}" + { "$MAKE" "${!PACKAGE_MAKE_OPTS_ARRAY}" $MAKE_OPTS ${!PACKAGE_MAKE_OPTS} } >&4 2>&1 } diff --git a/plugins/python-build/test/build.bats b/plugins/python-build/test/build.bats index 41e13d6b..9be9c3d5 100644 --- a/plugins/python-build/test/build.bats +++ b/plugins/python-build/test/build.bats @@ -372,7 +372,7 @@ DEF assert_build_log < Date: Sat, 14 Jan 2023 01:25:38 +0300 Subject: [PATCH 2/2] Don't set --enable-shared if user supplied --disable-shared --- plugins/python-build/bin/python-build | 2 +- plugins/python-build/test/build.bats | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/plugins/python-build/bin/python-build b/plugins/python-build/bin/python-build index 87ba0ff3..7a1feceb 100755 --- a/plugins/python-build/bin/python-build +++ b/plugins/python-build/bin/python-build @@ -2198,7 +2198,7 @@ if [ -n "$DEBUG" ]; then package_option python configure --with-pydebug fi -if [[ "$CONFIGURE_OPTS $PYTHON_CONFIGURE_OPTS" != *"--enable-framework"* ]]; then +if [[ "$CONFIGURE_OPTS $PYTHON_CONFIGURE_OPTS" != *"--enable-framework"* && "$CONFIGURE_OPTS $PYTHON_CONFIGURE_OPTS" != *"--disable-shared"* ]]; then package_option python configure --enable-shared fi diff --git a/plugins/python-build/test/build.bats b/plugins/python-build/test/build.bats index 9be9c3d5..aec81843 100644 --- a/plugins/python-build/test/build.bats +++ b/plugins/python-build/test/build.bats @@ -613,6 +613,30 @@ make install --custom-make-install OUT } +@test "--enable-shared is not added if --disable-shared is passed" { + cached_tarball "Python-3.6.2" + + for i in {1..8}; do stub uname '-s : echo Linux'; done + + stub_make_install + + export PYTHON_CONFIGURE_OPTS='--disable-shared' + run_inline_definition <