summary refs log tree commit diff
path: root/pkgs/stdenv/generic/setup.sh
diff options
context:
space:
mode:
authorVladimír Čunát <vcunat@gmail.com>2014-08-24 18:37:23 +0200
committerVladimír Čunát <vcunat@gmail.com>2014-08-24 18:37:23 +0200
commit4e72b61de9bdb0c1216632e743c04f5da592b3ba (patch)
tree0dbc6a27186b4499fd6b7df493c0edd978086f43 /pkgs/stdenv/generic/setup.sh
parent694fa543af899683329d607ad3229f753b12f3cc (diff)
downloadnixlib-4e72b61de9bdb0c1216632e743c04f5da592b3ba.tar
nixlib-4e72b61de9bdb0c1216632e743c04f5da592b3ba.tar.gz
nixlib-4e72b61de9bdb0c1216632e743c04f5da592b3ba.tar.bz2
nixlib-4e72b61de9bdb0c1216632e743c04f5da592b3ba.tar.lz
nixlib-4e72b61de9bdb0c1216632e743c04f5da592b3ba.tar.xz
nixlib-4e72b61de9bdb0c1216632e743c04f5da592b3ba.tar.zst
nixlib-4e72b61de9bdb0c1216632e743c04f5da592b3ba.zip
stdenv/setup.sh: add $propagateIntoInput
This is needed for multiple-output derivations,
where it is desirable to propagate deps and setup-hooks into $dev instead of $out.

Also drop an unused simple function which will not even make sense.
Diffstat (limited to 'pkgs/stdenv/generic/setup.sh')
-rw-r--r--pkgs/stdenv/generic/setup.sh26
1 files changed, 12 insertions, 14 deletions
diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh
index ea2ea947b505..5da7f773732f 100644
--- a/pkgs/stdenv/generic/setup.sh
+++ b/pkgs/stdenv/generic/setup.sh
@@ -144,11 +144,6 @@ ensureDir() {
 }
 
 
-installBin() {
-    mkdir -p $out/bin
-    cp "$@" $out/bin
-}
-
 
 ######################################################################
 # Initialisation.
@@ -264,7 +259,7 @@ for i in $crossPkgs; do
 done
 
 
-# Add the output as an rpath.
+# Add the output as an rpath. ToDo: multiple-output?
 if [ "$NIX_NO_SELF_RPATH" != 1 ]; then
     export NIX_LDFLAGS="-rpath $out/lib $NIX_LDFLAGS"
     if [ -n "$NIX_LIB64_IN_SELF_RPATH" ]; then
@@ -707,24 +702,27 @@ fixupPhase() {
         prefix=${!output} runHook fixupOutput
     done
 
+    # Multiple-output derivations mostly choose $dev instead of $out
+    local prOut="${propagateIntoOutput:-$out}"
+
     if [ -n "$propagatedBuildInputs" ]; then
-        mkdir -p "$out/nix-support"
-        echo "$propagatedBuildInputs" > "$out/nix-support/propagated-build-inputs"
+        mkdir -p "$prOut/nix-support"
+        echo "$propagatedBuildInputs" > "$prOut/nix-support/propagated-build-inputs"
     fi
 
     if [ -n "$propagatedNativeBuildInputs" ]; then
-        mkdir -p "$out/nix-support"
-        echo "$propagatedNativeBuildInputs" > "$out/nix-support/propagated-native-build-inputs"
+        mkdir -p "$prOut/nix-support"
+        echo "$propagatedNativeBuildInputs" > "$prOut/nix-support/propagated-native-build-inputs"
     fi
 
     if [ -n "$propagatedUserEnvPkgs" ]; then
-        mkdir -p "$out/nix-support"
-        echo "$propagatedUserEnvPkgs" > "$out/nix-support/propagated-user-env-packages"
+        mkdir -p "$prOut/nix-support"
+        echo "$propagatedUserEnvPkgs" > "$prOut/nix-support/propagated-user-env-packages"
     fi
 
     if [ -n "$setupHook" ]; then
-        mkdir -p "$out/nix-support"
-        substituteAll "$setupHook" "$out/nix-support/setup-hook"
+        mkdir -p "$prOut/nix-support"
+        substituteAll "$setupHook" "$prOut/nix-support/setup-hook"
     fi
 
     runHook postFixup