python3: fix build on Darwin

https://github.com/NixOS/nixpkgs/pull/311767 improved build purity, but Python’s configure script checks the Darwin version to enable platform features. Replacing the check with a check for Darwin without the version allows the build to succeed again.
This commit is contained in:
Randy Eckenrode 2024-05-30 19:40:13 -04:00
parent ef12b15a5b
commit 07ab74e4aa
No known key found for this signature in database
GPG Key ID: 64C1CD4EC2A600D9

View File

@ -461,6 +461,8 @@ in with passthru; stdenv.mkDerivation (finalAttrs: {
'' + optionalString stdenv.isDarwin ''
# Override the auto-detection in setup.py, which assumes a universal build
export PYTHON_DECIMAL_WITH_MACHINE=${if stdenv.isAarch64 then "uint128" else "x64"}
# Ensure that modern platform features are enabled on Darwin in spite of having no version suffix.
sed -E -i -e 's|Darwin/\[12\]\[0-9\]\.\*|Darwin/*|' configure
'' + optionalString (stdenv.isDarwin && x11Support && pythonAtLeast "3.11") ''
export TCLTK_LIBS="-L${tcl}/lib -L${tk}/lib -l${tcl.libPrefix} -l${tk.libPrefix}"
export TCLTK_CFLAGS="-I${tcl}/include -I${tk}/include"