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

Find zlib from Xcode or brew on Mojave (#1353)

fixes #1219, #1333
This commit is contained in:
Mikhail Bulash
2019-06-11 17:12:00 +03:00
committed by Josh Friend
parent 2350e57b00
commit 4157973301
4 changed files with 39 additions and 13 deletions

View File

@@ -759,7 +759,10 @@ build_package_standard_build() {
local PACKAGE_CFLAGS="${package_var_name}_CFLAGS"
if [ "$package_var_name" = "PYTHON" ]; then
use_homebrew_readline || use_freebsd_pkg ||true
use_homebrew_readline || use_freebsd_pkg || true
if is_mac -ge 1014; then
use_xcode_sdk_zlib || use_homebrew_zlib || true
fi
fi
( if [ "${CFLAGS+defined}" ] || [ "${!PACKAGE_CFLAGS+defined}" ]; then
@@ -1628,6 +1631,22 @@ build_package_verify_openssl() {
' "$(basename "$(type -p yum apt-get | head -1)")" >&4 2>&1
}
use_homebrew_zlib() {
local brew_zlib="$(brew --prefix zlib 2>/dev/null || true)"
if [ -d "$brew_zlib" ]; then
echo "python-build: use zlib from homebrew"
export CFLAGS="-I${brew_zlib} ${CFLAGS}"
fi
}
use_xcode_sdk_zlib() {
local xc_sdk_path="$(xcrun --show-sdk-path 2>/dev/null || true)"
if [ -d "$xc_sdk_path" ]; then
echo "python-build: use zlib from xcode sdk"
export CFLAGS="-I${xc_sdk_path}/usr/include ${CFLAGS}"
fi
}
# Ensure that directories listed in LDFLAGS exist
build_package_ldflags_dirs() {
local arg dir