1
0
mirror of https://github.com/pyenv/pyenv.git synced 2025-11-19 09:03:47 -05:00

Compare commits

..

2 Commits

Author SHA1 Message Date
native-api
692ac77559 Fix specifying XCode SDK for distutils; Revert to preferring XCode Zlib (#3316)
* Fix specifying XCode SDK for distutils

* Revert to preferring XCode Zlib

It turns out, everything since 2.7.12 and 3.5.2
can use libs from modern XCode SDK
which is always available unless we're using an alternate compiler
2025-09-01 01:09:57 +03:00
native-api
97eda4403f Fix Readline and OpenSSL detection for MacPorts without the corresponding package (#3317) 2025-08-31 21:48:24 +03:00

View File

@@ -863,7 +863,9 @@ build_package_standard_build() {
use_homebrew_readline || true
use_homebrew_ncurses || true
if is_mac -ge 1014; then
use_homebrew_zlib || use_xcode_sdk_zlib || true
# While XCode SDK is "always available",
# still need a fallback in case we are using an alternate compiler
use_xcode_sdk_zlib || use_homebrew_zlib || true
else
use_homebrew_zlib || true
fi
@@ -873,7 +875,9 @@ build_package_standard_build() {
use_macports_readline || true
use_macports_ncurses || true
if is_mac -ge 1014; then
use_macports_zlib || use_xcode_sdk_zlib || true
# While XCode SDK is "always available",
# still need a fallback in case we are using an alternate compiler
use_xcode_sdk_zlib || use_homebrew_zlib || true
else
use_macports_zlib || true
fi
@@ -1593,6 +1597,7 @@ has_broken_mac_readline() {
if can_use_macports; then
use_macports_readline && return 1
fi
return 0
}
use_homebrew_readline() {
@@ -1682,6 +1687,7 @@ has_broken_mac_openssl() {
use_macports_openssl && return 1
fi
fi
return 0
}
use_homebrew_openssl() {
@@ -1823,6 +1829,7 @@ use_homebrew_zlib() {
export CPPFLAGS="-I${brew_zlib}/include${CPPFLAGS:+ ${CPPFLAGS}}"
export LDFLAGS="-L${brew_zlib}/lib${LDFLAGS:+ ${LDFLAGS}}"
lock_in homebrew
rc=0
fi
}
@@ -1838,12 +1845,13 @@ use_xcode_sdk_zlib() {
echo "python-build: use zlib from xcode sdk"
# Since 3.9.1 (bpo-41116), CPython's setup.py logic can search default SDK's sysroot itself
# so we don't need to do anything
# Since 3.5.2 (Issue #25136), distutils knows to look for Apple XCode 7+ stub libraries (.tbd)
# Since 2.7.12 and 3.5.2 (Issue #25136), distutils knows to look for Apple XCode 7+ stub libraries (.tbd)
# when searching in the SDK
# Since 2.7.4 and 3.2.1 (issue #7724), setup.py and distutils can search in the MacOS SDK when
# it's explicitly specified with -isysroot
export CPPFLAGS="${CPPFLAGS:+$CPPFLAGS }-isysroot ${sdkroot}"
#distutils.unixcompiler and setup.py specifically search CFLAGS for "-isysroot"
export CFLAGS="${CFLAGS:+$CFLAGS }-isysroot ${sdkroot}"
return 0
}