diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2017-08-15 16:13:30 -0400 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2017-08-15 16:13:30 -0400 |
commit | a71cf06b162b98282a7688f8ac221498cfd6a7e2 (patch) | |
tree | 20557e6799e63fdad884ebbb032592444c7eb254 /pkgs/stdenv | |
parent | 63439f8a112149e89090240a4624036ed8b44198 (diff) |
mkDerivation: Simply Nix
No hashes were changed by this
Diffstat (limited to 'pkgs/stdenv')
-rw-r--r-- | pkgs/stdenv/generic/make-derivation.nix | 34 |
1 files changed, 13 insertions, 21 deletions
diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix index be271daf8c8eb..74d387e353c5c 100644 --- a/pkgs/stdenv/generic/make-derivation.nix +++ b/pkgs/stdenv/generic/make-derivation.nix @@ -43,29 +43,21 @@ rec { , propagatedSandboxProfile ? "" , ... } @ attrs: let - dependencies = [ - (map (drv: drv.nativeDrv or drv) nativeBuildInputs) + dependencies = map lib.chooseDevOutputs [ + (map (drv: drv.nativeDrv or drv) nativeBuildInputs + ++ lib.optional separateDebugInfo ../../build-support/setup-hooks/separate-debug-info.sh + ++ lib.optional stdenv.hostPlatform.isWindows ../../build-support/setup-hooks/win-dll-link.sh) (map (drv: drv.crossDrv or drv) buildInputs) ]; - propagatedDependencies = [ + propagatedDependencies = map lib.chooseDevOutputs [ (map (drv: drv.nativeDrv or drv) propagatedNativeBuildInputs) (map (drv: drv.crossDrv or drv) propagatedBuildInputs) ]; - in let outputs' = outputs ++ (if separateDebugInfo then assert stdenv.hostPlatform.isLinux; [ "debug" ] else []); - dependencies' = let - justMap = map lib.chooseDevOutputs dependencies; - nativeBuildInputs = lib.head justMap - ++ lib.optional separateDebugInfo ../../build-support/setup-hooks/separate-debug-info.sh - ++ lib.optional stdenv.hostPlatform.isWindows ../../build-support/setup-hooks/win-dll-link.sh; - in [ nativeBuildInputs ] ++ lib.tail justMap; - - propagatedDependencies' = map lib.chooseDevOutputs propagatedDependencies; - derivationArg = (removeAttrs attrs ["meta" "passthru" "crossAttrs" "pos" @@ -73,13 +65,13 @@ rec { "sandboxProfile" "propagatedSandboxProfile"]) // (let computedSandboxProfile = - lib.concatMap (input: input.__propagatedSandboxProfile or []) (stdenv.extraBuildInputs ++ lib.concatLists dependencies'); + lib.concatMap (input: input.__propagatedSandboxProfile or []) (stdenv.extraBuildInputs ++ lib.concatLists dependencies); computedPropagatedSandboxProfile = - lib.concatMap (input: input.__propagatedSandboxProfile or []) (lib.concatLists propagatedDependencies'); + lib.concatMap (input: input.__propagatedSandboxProfile or []) (lib.concatLists propagatedDependencies); computedImpureHostDeps = - lib.unique (lib.concatMap (input: input.__propagatedImpureHostDeps or []) (stdenv.extraBuildInputs ++ lib.concatLists dependencies')); + lib.unique (lib.concatMap (input: input.__propagatedImpureHostDeps or []) (stdenv.extraBuildInputs ++ lib.concatLists dependencies)); computedPropagatedImpureHostDeps = - lib.unique (lib.concatMap (input: input.__propagatedImpureHostDeps or []) (lib.concatLists propagatedDependencies')); + lib.unique (lib.concatMap (input: input.__propagatedImpureHostDeps or []) (lib.concatLists propagatedDependencies)); in { name = name + lib.optionalString @@ -92,11 +84,11 @@ rec { userHook = config.stdenv.userHook or null; __ignoreNulls = true; - nativeBuildInputs = lib.elemAt dependencies' 0; - buildInputs = lib.elemAt dependencies' 1; + nativeBuildInputs = lib.elemAt dependencies 0; + buildInputs = lib.elemAt dependencies 1; - propagatedNativeBuildInputs = lib.elemAt propagatedDependencies' 0; - propagatedBuildInputs = lib.elemAt propagatedDependencies' 1; + propagatedNativeBuildInputs = lib.elemAt propagatedDependencies 0; + propagatedBuildInputs = lib.elemAt propagatedDependencies 1; # This parameter is sometimes a string, sometimes null, and sometimes a list, yuck configureFlags = let inherit (lib) optional elem; in |