mirror of
https://github.com/pyenv/pyenv.git
synced 2024-11-07 20:31:01 -05:00
Use custom MACOSX_DEPLOYMENT_TARGET
if defined (fixes #312)
This commit is contained in:
parent
abae52ae20
commit
22ecefd572
2 changed files with 27 additions and 4 deletions
|
@ -1815,10 +1815,12 @@ fi
|
||||||
|
|
||||||
# Set MACOSX_DEPLOYMENT_TARGET from the product version of OS X (#219, #220)
|
# Set MACOSX_DEPLOYMENT_TARGET from the product version of OS X (#219, #220)
|
||||||
if [[ "Darwin" == "$(uname -s)" ]]; then
|
if [[ "Darwin" == "$(uname -s)" ]]; then
|
||||||
MACOS_VERSION="$(sw_vers -productVersion 2>/dev/null || true)"
|
if [ -z "${MACOSX_DEPLOYMENT_TARGET}" ]; then
|
||||||
MACOS_VERSION_ARRAY=(${MACOS_VERSION//\./ })
|
MACOS_VERSION="$(sw_vers -productVersion 2>/dev/null || true)"
|
||||||
if [ "${#MACOS_VERSION_ARRAY[@]}" -ge 2 ]; then
|
MACOS_VERSION_ARRAY=(${MACOS_VERSION//\./ })
|
||||||
export MACOSX_DEPLOYMENT_TARGET="${MACOS_VERSION_ARRAY[0]}.${MACOS_VERSION_ARRAY[1]}"
|
if [ "${#MACOS_VERSION_ARRAY[@]}" -ge 2 ]; then
|
||||||
|
export MACOSX_DEPLOYMENT_TARGET="${MACOS_VERSION_ARRAY[0]}.${MACOS_VERSION_ARRAY[1]}"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -259,3 +259,24 @@ OUT
|
||||||
PYTHON_CONFIGURE_OPTS_ARRAY=(--enable-universalsdk=/ --with-universal-archs=intel)
|
PYTHON_CONFIGURE_OPTS_ARRAY=(--enable-universalsdk=/ --with-universal-archs=intel)
|
||||||
EOS
|
EOS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@test "default MACOSX_DEPLOYMENT_TARGET" {
|
||||||
|
stub uname '-s : echo Darwin'
|
||||||
|
stub sw_vers '-productVersion : echo 10.10'
|
||||||
|
|
||||||
|
TMPDIR="$TMP" run_inline_definition <<OUT
|
||||||
|
echo "\${MACOSX_DEPLOYMENT_TARGET}"
|
||||||
|
OUT
|
||||||
|
assert_success
|
||||||
|
assert_output "10.10"
|
||||||
|
}
|
||||||
|
|
||||||
|
@test "use custom MACOSX_DEPLOYMENT_TARGET if defined" {
|
||||||
|
stub uname '-s : echo Darwin'
|
||||||
|
|
||||||
|
MACOSX_DEPLOYMENT_TARGET="10.4" TMPDIR="$TMP" run_inline_definition <<OUT
|
||||||
|
echo "\${MACOSX_DEPLOYMENT_TARGET}"
|
||||||
|
OUT
|
||||||
|
assert_success
|
||||||
|
assert_output "10.4"
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue