Skip to content

Commit dc1fd4d

Browse files
authored
python311: fix _ctypes build on darwin (NixOS#390454)
In Python 3.12+, the -DUSING_APPLE_OS_LIBFFI=1 macro is always set: python/cpython@25590eb Fixes NixOS#390348 Signed-off-by: Ihar Hrachyshka <[email protected]>
2 parents 4d7c037 + ef35af3 commit dc1fd4d

File tree

1 file changed

+3
-0
lines changed
  • pkgs/development/interpreters/python/cpython

1 file changed

+3
-0
lines changed

pkgs/development/interpreters/python/cpython/default.nix

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,9 @@ in with passthru; stdenv.mkDerivation (finalAttrs: {
434434
for path in /usr /sw /opt /pkg; do
435435
substituteInPlace ./setup.py --replace-warn $path /no-such-path
436436
done
437+
'' + optionalString (stdenv.hostPlatform.isDarwin && pythonOlder "3.12") ''
438+
# Fix _ctypes module compilation
439+
export NIX_CFLAGS_COMPILE+=" -DUSING_APPLE_OS_LIBFFI=1"
437440
'' + optionalString stdenv.hostPlatform.isDarwin ''
438441
# Override the auto-detection in setup.py, which assumes a universal build
439442
export PYTHON_DECIMAL_WITH_MACHINE=${if stdenv.hostPlatform.isAarch64 then "uint128" else "x64"}

0 commit comments

Comments
 (0)