diff options
Diffstat (limited to 'pkgs/stdenv/generic/default.nix')
-rw-r--r-- | pkgs/stdenv/generic/default.nix | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/pkgs/stdenv/generic/default.nix b/pkgs/stdenv/generic/default.nix index a5d3c5a8ff5c..17bf1f8b428c 100644 --- a/pkgs/stdenv/generic/default.nix +++ b/pkgs/stdenv/generic/default.nix @@ -9,6 +9,7 @@ let lib = import ../../../lib; in lib.makeOverridable ( , setupScript ? ./setup.sh +, extraNativeBuildInputs ? [] , extraBuildInputs ? [] , __stdenvImpureHostDeps ? [] , __extraImpureHostDeps ? [] @@ -41,7 +42,7 @@ let lib = import ../../../lib; in lib.makeOverridable ( }: let - defaultNativeBuildInputs = extraBuildInputs ++ + defaultNativeBuildInputs = extraNativeBuildInputs ++ [ ../../build-support/setup-hooks/move-docs.sh ../../build-support/setup-hooks/compress-man-pages.sh ../../build-support/setup-hooks/strip.sh @@ -58,11 +59,16 @@ let cc ]; + defaultBuildInputs = extraBuildInputs; + # The stdenv that we are producing. stdenv = derivation ( - (if isNull allowedRequisites then {} else { allowedRequisites = allowedRequisites ++ defaultNativeBuildInputs; }) // - { + lib.optionalAttrs (allowedRequisites != null) { + allowedRequisites = allowedRequisites + ++ defaultNativeBuildInputs ++ defaultBuildInputs; + } + // { inherit name; # Nix itself uses the `system` field of a derivation to decide where to @@ -75,7 +81,8 @@ let setup = setupScript; - inherit preHook initialPath shell defaultNativeBuildInputs; + inherit preHook initialPath shell + defaultNativeBuildInputs defaultBuildInputs; } // lib.optionalAttrs buildPlatform.isDarwin { __sandboxProfile = stdenvSandboxProfile; @@ -91,7 +98,8 @@ let inherit buildPlatform hostPlatform targetPlatform; - inherit extraBuildInputs __extraImpureHostDeps extraSandboxProfile; + inherit extraNativeBuildInputs extraBuildInputs + __extraImpureHostDeps extraSandboxProfile; # Utility flags to test the type of platform. inherit (hostPlatform) |