From 6b46fa896e5a92795894ff191e96c4fe51d99b87 Mon Sep 17 00:00:00 2001 From: Artturin Date: Sun, 22 May 2022 04:17:00 +0300 Subject: [PATCH] python3Minimal: enable strictDeps remove unused let binding from the main expr verified that cross-compiling still works --- pkgs/development/interpreters/python/cpython/default.nix | 7 +++---- pkgs/development/interpreters/python/default.nix | 2 ++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/pkgs/development/interpreters/python/cpython/default.nix b/pkgs/development/interpreters/python/cpython/default.nix index 4463dc8e9ba0..cc2aede6a366 100644 --- a/pkgs/development/interpreters/python/cpython/default.nix +++ b/pkgs/development/interpreters/python/cpython/default.nix @@ -104,8 +104,6 @@ let version = with sourceVersion; "${major}.${minor}.${patch}${suffix}"; - strictDeps = true; - nativeBuildInputs = optionals (!stdenv.isDarwin) [ autoreconfHook pkg-config @@ -186,7 +184,8 @@ in with passthru; stdenv.mkDerivation { pname = "python3"; inherit version; - inherit buildInputs nativeBuildInputs; + inherit nativeBuildInputs; + buildInputs = [ bash ] ++ buildInputs; # bash is only for patchShebangs src = fetchurl { url = with sourceVersion; "https://www.python.org/ftp/python/${major}.${minor}.${patch}/Python-${version}.tar.xz"; @@ -465,7 +464,7 @@ in with passthru; stdenv.mkDerivation { preFixup = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' # Ensure patch-shebangs uses shebangs of host interpreter. - export PATH=${lib.makeBinPath [ "$out" bash ]}:$PATH + export PATH=${lib.makeBinPath [ "$out" ]}:$PATH ''; # Add CPython specific setup-hook that configures distutils.sysconfig to diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index d9ade27def64..02a77fca5c9f 100644 --- a/pkgs/development/interpreters/python/default.nix +++ b/pkgs/development/interpreters/python/default.nix @@ -231,6 +231,8 @@ in { enableLTO = false; mimetypesSupport = false; } // sources.python39)).overrideAttrs(old: { + # TODO(@Artturin): Add this to the main cpython expr + strictDeps = true; pname = "python3-minimal"; meta = old.meta // { maintainers = [];