From 8dbf0b34233f0c8da3d584c591f57d6ce1a3e5c3 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 13 Aug 2025 21:31:46 +0200 Subject: [PATCH] cpython: remove libxcrypt on 3.13 and newer The 3.13 release dropped support for the crypt module, so this dependency could have been dropped much earlier. Drops the `withLibxcrypt` argument, because manging the default has become quite a bit more complicated. --- .../interpreters/python/cpython/default.nix | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pkgs/development/interpreters/python/cpython/default.nix b/pkgs/development/interpreters/python/cpython/default.nix index 3e1d6cc63ff1..940e18f8fbf6 100644 --- a/pkgs/development/interpreters/python/cpython/default.nix +++ b/pkgs/development/interpreters/python/cpython/default.nix @@ -21,7 +21,6 @@ expat, libffi, libuuid, - withLibxcrypt ? !withMinimalDeps, libxcrypt, withMpdecimal ? !withMinimalDeps, mpdecimal, @@ -145,11 +144,16 @@ let optionals optionalString replaceStrings - versionOlder ; - # mixes libc and libxcrypt headers and libs and causes segfaults on importing crypt - libxcrypt = if stdenv.hostPlatform.isFreeBSD && withMinimalDeps then null else inputs.libxcrypt; + withLibxcrypt = + (!withMinimalDeps) + && + # mixes libc and libxcrypt headers and libs and causes segfaults on importing crypt + (!stdenv.hostPlatform.isFreeBSD) + && + # crypt module was removed in 3.13 + passthru.pythonOlder "3.13"; buildPackages = pkgsBuildHost; inherit (passthru) pythonOnBuildForHost;