From 9edd40908d9eb3d602eeba9af92f135b373f24e5 Mon Sep 17 00:00:00 2001 From: DavHau Date: Tue, 17 Jun 2025 22:14:56 +0700 Subject: [PATCH] python3Minimal: remove pkg-config dependency Removes the build time dependency on pkg-config if python3 is build with the `withMinimal` flag enabled This change is driven by the motivation to use python3 earlier in stdenv for hooks. --- .../interpreters/python/cpython/default.nix | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pkgs/development/interpreters/python/cpython/default.nix b/pkgs/development/interpreters/python/cpython/default.nix index e3874a4b8d42..abdf0a1ceb22 100644 --- a/pkgs/development/interpreters/python/cpython/default.nix +++ b/pkgs/development/interpreters/python/cpython/default.nix @@ -209,13 +209,15 @@ let nativeBuildInputs = [ nukeReferences ] - ++ optionals (!stdenv.hostPlatform.isDarwin) [ + ++ optionals (!stdenv.hostPlatform.isDarwin && !withMinimalDeps) [ autoconf-archive # needed for AX_CHECK_COMPILE_FLAG autoreconfHook ] - ++ optionals (!stdenv.hostPlatform.isDarwin || passthru.pythonAtLeast "3.14") [ - pkg-config - ] + ++ + optionals ((!stdenv.hostPlatform.isDarwin || passthru.pythonAtLeast "3.14") && !withMinimalDeps) + [ + pkg-config + ] ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ buildPackages.stdenv.cc pythonOnBuildForHost