diff --git a/pkgs/development/interpreters/python/cpython/default.nix b/pkgs/development/interpreters/python/cpython/default.nix index b983fa8f5461..4a0533536c84 100644 --- a/pkgs/development/interpreters/python/cpython/default.nix +++ b/pkgs/development/interpreters/python/cpython/default.nix @@ -60,6 +60,7 @@ , static ? stdenv.hostPlatform.isStatic , enableFramework ? false , noldconfigPatch ? ./. + "/${sourceVersion.major}.${sourceVersion.minor}/no-ldconfig.patch" +, enableGIL ? true # pgo (not reproducible) + -fno-semantic-interposition # https://docs.python.org/3/using/configure.html#cmdoption-enable-optimizations @@ -111,6 +112,7 @@ let inherit (lib) concatMapStringsSep concatStringsSep + enableFeature getDev getLib optionals @@ -402,6 +404,8 @@ in with passthru; stdenv.mkDerivation (finalAttrs: { "--enable-shared" ] ++ optionals enableFramework [ "--enable-framework=${placeholder "out"}/Library/Frameworks" + ] ++ optionals (pythonAtLeast "3.13") [ + (enableFeature enableGIL "gil") ] ++ optionals enableOptimizations [ "--enable-optimizations" ] ++ optionals (sqlite != null) [