diff --git a/builders/macos-python-builder.psm1 b/builders/macos-python-builder.psm1 index 90c4d98..01664f0 100644 --- a/builders/macos-python-builder.psm1 +++ b/builders/macos-python-builder.psm1 @@ -32,11 +32,16 @@ class macOSPythonBuilder : NixPythonBuilder { #> # Only for Python 3.7.17, install additional dependencies - if ($this.Version -eq "3.7.17") { - Write-Host "Installing additional dependencies for Python 3.7.17..." - # Install necessary dependencies for Python 3.7.17 - Execute-Command -Command "brew install bzip2 zlib readline ncurses sqlite3 openssl@1.1" - } + if ($this.Version -eq "3.7.17") { + Write-Host "Installing additional dependencies for Python 3.7.17..." + # Install necessary dependencies for Python 3.7.17 + Execute-Command -Command "brew install bzip2 zlib readline ncurses sqlite3 openssl@1.1" + + # Ensure the environment variables for zlib are set correctly + $zlibPrefix = (brew --prefix zlib) + $env:LDFLAGS += " -L$($zlibPrefix)/lib" + $env:CFLAGS += " -I$($zlibPrefix)/include" + } } [void] Configure() {