summary refs log tree commit diff
path: root/pkgs/stdenv
diff options
context:
space:
mode:
authorWilliam A. Kennington III <william@wkennington.com>2015-09-19 14:39:57 -0700
committerWilliam A. Kennington III <william@wkennington.com>2015-09-19 14:39:57 -0700
commit8b670fba26b6b4536377c6178b29a6ff17169506 (patch)
tree41f8a58e614df712eec4891c51f9ccba2a14d79b /pkgs/stdenv
parent3acffb730aeb1bcab009dcc6ba57707462a3abaa (diff)
parent6e092236273bbcd95654392430a281365bc2278a (diff)
downloadnixlib-8b670fba26b6b4536377c6178b29a6ff17169506.tar
nixlib-8b670fba26b6b4536377c6178b29a6ff17169506.tar.gz
nixlib-8b670fba26b6b4536377c6178b29a6ff17169506.tar.bz2
nixlib-8b670fba26b6b4536377c6178b29a6ff17169506.tar.lz
nixlib-8b670fba26b6b4536377c6178b29a6ff17169506.tar.xz
nixlib-8b670fba26b6b4536377c6178b29a6ff17169506.tar.zst
nixlib-8b670fba26b6b4536377c6178b29a6ff17169506.zip
Merge branch 'staging.upstream' into staging.post-15.06
Diffstat (limited to 'pkgs/stdenv')
-rw-r--r--pkgs/stdenv/generic/default.nix34
1 files changed, 20 insertions, 14 deletions
diff --git a/pkgs/stdenv/generic/default.nix b/pkgs/stdenv/generic/default.nix
index 249e4845bc28..778b3365b478 100644
--- a/pkgs/stdenv/generic/default.nix
+++ b/pkgs/stdenv/generic/default.nix
@@ -96,6 +96,10 @@ let
     , meta ? {}
     , passthru ? {}
     , pos ? null # position used in error messages and for meta.position
+    , separateDebugInfo ? false
+    , outputs ? [ "out" ]
+    , __impureHostDeps ? []
+    , __propagatedImpureHostDeps ? []
     , ... } @ attrs:
     let
       pos' =
@@ -132,6 +136,13 @@ let
           throwEvalHelp "Broken" "is not supported on ‘${result.system}’"
         else true;
 
+      outputs' =
+        outputs ++
+        (if separateDebugInfo then [ "debug" ] else []);
+
+      buildInputs' = buildInputs ++
+        (if separateDebugInfo then [ ../../build-support/setup-hooks/separate-debug-info.sh ] else []);
+
     in
       assert licenseAllowed attrs;
 
@@ -140,18 +151,11 @@ let
           ["meta" "passthru" "crossAttrs" "pos"
            "__impureHostDeps" "__propagatedImpureHostDeps"])
         // (let
-          buildInputs = attrs.buildInputs or [];
-          nativeBuildInputs = attrs.nativeBuildInputs or [];
-          propagatedBuildInputs = attrs.propagatedBuildInputs or [];
-          propagatedNativeBuildInputs = attrs.propagatedNativeBuildInputs or [];
-          crossConfig = attrs.crossConfig or null;
-
-          __impureHostDeps = attrs.__impureHostDeps or [];
-          __propagatedImpureHostDeps = attrs.__propagatedImpureHostDeps or [];
-
           # TODO: remove lib.unique once nix has a list canonicalization primitive
-          computedImpureHostDeps           = lib.unique (lib.concatMap (input: input.__propagatedImpureHostDeps or []) (extraBuildInputs ++ buildInputs ++ nativeBuildInputs));
-          computedPropagatedImpureHostDeps = lib.unique (lib.concatMap (input: input.__propagatedImpureHostDeps or []) (propagatedBuildInputs ++ propagatedNativeBuildInputs));
+          computedImpureHostDeps =
+            lib.unique (lib.concatMap (input: input.__propagatedImpureHostDeps or []) (extraBuildInputs ++ buildInputs ++ nativeBuildInputs));
+          computedPropagatedImpureHostDeps =
+            lib.unique (lib.concatMap (input: input.__propagatedImpureHostDeps or []) (propagatedBuildInputs ++ propagatedNativeBuildInputs));
         in
         {
           builder = attrs.realBuilder or shell;
@@ -162,10 +166,10 @@ let
           __ignoreNulls = true;
 
           # Inputs built by the cross compiler.
-          buildInputs = if crossConfig != null then buildInputs else [];
+          buildInputs = if crossConfig != null then buildInputs' else [];
           propagatedBuildInputs = if crossConfig != null then propagatedBuildInputs else [];
           # Inputs built by the usual native compiler.
-          nativeBuildInputs = nativeBuildInputs ++ (if crossConfig == null then buildInputs else []);
+          nativeBuildInputs = nativeBuildInputs ++ (if crossConfig == null then buildInputs' else []);
           propagatedNativeBuildInputs = propagatedNativeBuildInputs ++
             (if crossConfig == null then propagatedBuildInputs else []);
         } // ifDarwin {
@@ -176,7 +180,9 @@ let
             "/bin/sh"
           ];
           __propagatedImpureHostDeps = computedPropagatedImpureHostDeps ++ __propagatedImpureHostDeps;
-        }))) (
+        } // (if outputs' != [ "out" ] then {
+          outputs = outputs';
+        } else { })))) (
       {
         # The meta attribute is passed in the resulting attribute set,
         # but it's not part of the actual derivation, i.e., it's not