1
0
mirror of https://github.com/pyenv/pyenv.git synced 2025-11-08 11:33:49 -05:00

Merge pull request #3311 from native-api/fiz_zlib_homebrew

Prefer ZLib from Homebrew/MacPorts if present; Fix using Zlib from Homebrew
This commit is contained in:
native-api
2025-08-28 10:54:50 +03:00
committed by GitHub
2 changed files with 5 additions and 4 deletions

View File

@@ -24,7 +24,7 @@ jobs:
# python-version: ${{ matrix.python-version }}
# ... but in the repo, we want to test pyenv builds on macOS
- run: |
brew install openssl readline sqlite3 xz zlib
brew install openssl readline sqlite3 xz tcl-tk@8 libb2 zstd
# https://github.com/pyenv/pyenv#installation
- run: pwd
- env:

View File

@@ -863,7 +863,7 @@ build_package_standard_build() {
use_homebrew_readline || true
use_homebrew_ncurses || true
if is_mac -ge 1014; then
use_xcode_sdk_zlib || use_homebrew_zlib || true
use_homebrew_zlib || use_xcode_sdk_zlib || true
else
use_homebrew_zlib || true
fi
@@ -873,7 +873,7 @@ build_package_standard_build() {
use_macports_readline || true
use_macports_ncurses || true
if is_mac -ge 1014; then
use_xcode_sdk_zlib || use_macports_zlib || true
use_macports_zlib || use_xcode_sdk_zlib || true
else
use_macports_zlib || true
fi
@@ -1820,7 +1820,8 @@ 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}"
export CPPFLAGS="-I${brew_zlib}/include${CPPFLAGS:+ ${CPPFLAGS}}"
export LDFLAGS="-L${brew_zlib}/lib${LDFLAGS:+ ${LDFLAGS}}"
lock_in homebrew
fi
}