From 07ab74e4aa9ae2d51986075edffe17ec0c2551c6 Mon Sep 17 00:00:00 2001 From: Randy Eckenrode Date: Thu, 30 May 2024 19:40:13 -0400 Subject: [PATCH] python3: fix build on Darwin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- pkgs/development/interpreters/python/cpython/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/interpreters/python/cpython/default.nix b/pkgs/development/interpreters/python/cpython/default.nix index f32787c04c8d..2df060a52613 100644 --- a/pkgs/development/interpreters/python/cpython/default.nix +++ b/pkgs/development/interpreters/python/cpython/default.nix @@ -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"