diff --git a/pkgs/development/interpreters/python/cpython/default.nix b/pkgs/development/interpreters/python/cpython/default.nix index ac5d197ab3dd..9a155dd62b48 100644 --- a/pkgs/development/interpreters/python/cpython/default.nix +++ b/pkgs/development/interpreters/python/cpython/default.nix @@ -406,9 +406,6 @@ in with passthru; stdenv.mkDerivation (finalAttrs: { configureFlags = [ "--without-ensurepip" "--with-system-expat" - ] ++ optionals (!(stdenv.isDarwin && pythonAtLeast "3.12")) [ - # ./Modules/_decimal/_decimal.c:4673:6: error: "No valid combination of CONFIG_64, CONFIG_32 and _PyHASH_BITS" - # https://hydra.nixos.org/build/248410479/nixlog/2/tail "--with-system-libmpdec" ] ++ optionals (openssl != null) [ "--with-openssl=${openssl.dev}" @@ -480,6 +477,10 @@ in with passthru; stdenv.mkDerivation (finalAttrs: { 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 (pythonAtLeast "3.11") '' + # Also override the auto-detection in `configure`. + substituteInPlace configure \ + --replace-fail 'libmpdec_machine=universal' 'libmpdec_machine=${if stdenv.isAarch64 then "uint128" else "x64"}' '' + 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"