build-all.py - provide with-openssl for python on Mac

This commit is contained in:
Andrej730
2025-09-25 08:08:21 +02:00
parent 879dc52865
commit 6db3728f0e
2 changed files with 7 additions and 0 deletions
+1
View File
@@ -67,6 +67,7 @@ jobs:
DARWIN_C_SOURCE=-D_DARWIN_C_SOURCE
fi
if [ "${{ matrix.arch }}" == "x64" ]; then
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
MAC_INTEL=-mac-cross-compile-intel
fi
set -o pipefail
+6
View File
@@ -169,6 +169,7 @@ curl = "curl"
wget = "wget"
strip = "strip"
xz = "xz" # Used implicitly for `tar -xf *.tar.xz`.
brew_intel = "/usr/local/bin/brew"
explicit_targets = [s for s in sys.argv[1:] if not s.startswith("-")]
"""Targets provided by CLI."""
@@ -355,6 +356,9 @@ for cmd in [git, bunzip2, tar, cc, cplusplus, autoconf, automake, make, "patch",
if missing_commands:
raise ValueError(f"Required tools not installed or not added to PATH: {', '.join(missing_commands)}")
if MAC_CROSS_COMPILE_INTEL:
assert os.path.exists(brew_intel), f"For intel cross compilation the brew path is expected to be '{brew_intel}'."
# identifiers for the download tool (could be less memory consuming as ints, but are more verbose as strings)
download_tool_default = download_tool_py = "py"
download_tool_git = "git"
@@ -959,6 +963,8 @@ if "python" in targets and not USE_CURRENT_PYTHON_VERSION and "wasm" not in flag
PYTHON_CONFIGURE_ARGS: "list[str]" = []
if platform.system() == "Darwin":
PYTHON_CONFIGURE_ARGS = ["--enable-shared"]
open_ssl_prefix = run([brew_intel, "--prefix", "openssl@3"]).strip()
PYTHON_CONFIGURE_ARGS.append(f'--with-openssl="{open_ssl_prefix}"')
for PYTHON_VERSION in PYTHON_VERSIONS:
try: