summary refs log tree commit diff
path: root/pkgs/build-support
diff options
context:
space:
mode:
authorTuomas Tynkkynen <tuomas@tuxera.com>2016-01-24 05:21:45 +0200
committerTuomas Tynkkynen <tuomas@tuxera.com>2016-08-29 14:49:51 +0300
commit5d55ae5d5048610f73e727aa98d1f9f88045b752 (patch)
treebac9c18a0b0af3f6be92c7aa6da6d82377762a61 /pkgs/build-support
parent5326e85f3d7b5b222ccd158f25f0f15a60b458ec (diff)
downloadnixpkgs-5d55ae5d5048610f73e727aa98d1f9f88045b752.tar
nixpkgs-5d55ae5d5048610f73e727aa98d1f9f88045b752.tar.gz
nixpkgs-5d55ae5d5048610f73e727aa98d1f9f88045b752.tar.bz2
nixpkgs-5d55ae5d5048610f73e727aa98d1f9f88045b752.tar.lz
nixpkgs-5d55ae5d5048610f73e727aa98d1f9f88045b752.tar.xz
nixpkgs-5d55ae5d5048610f73e727aa98d1f9f88045b752.tar.zst
nixpkgs-5d55ae5d5048610f73e727aa98d1f9f88045b752.zip
stdenv/multiple-outputs.sh: Change output propagation logic
Because 'dev' will most often not be the default output after my changes.
Diffstat (limited to 'pkgs/build-support')
-rw-r--r--pkgs/build-support/setup-hooks/multiple-outputs.sh13
1 files changed, 8 insertions, 5 deletions
diff --git a/pkgs/build-support/setup-hooks/multiple-outputs.sh b/pkgs/build-support/setup-hooks/multiple-outputs.sh
index 06d80e12f09..2a0ebd52355 100644
--- a/pkgs/build-support/setup-hooks/multiple-outputs.sh
+++ b/pkgs/build-support/setup-hooks/multiple-outputs.sh
@@ -160,8 +160,7 @@ _multioutDevs() {
     done
 }
 
-# Make the first output (typically "dev") propagate other outputs needed for development.
-# Take the first, because that's what one gets when putting the package into buildInputs.
+# Make the "dev" propagate other outputs needed for development.
 # Note: with current cross-building setup, all packages are "native" if not cross-building;
 # however, if cross-building, the outputs are non-native. We have to choose the right file.
 _multioutPropagateDev() {
@@ -171,13 +170,17 @@ _multioutPropagateDev() {
     for outputFirst in $outputs; do
         break
     done
+    local propagaterOutput="$outputDev"
+    if [ -z "$propagaterOutput" ]; then
+        propagaterOutput="$outputFirst"
+    fi
 
     # Default value: propagate binaries, includes and libraries
     if [ -z "${propagatedBuildOutputs+1}" ]; then
         local po_dirty="$outputBin $outputInclude $outputLib"
         set +o pipefail
         propagatedBuildOutputs=`echo "$po_dirty" \
-            | tr -s ' ' '\n' | grep -v -F "$outputFirst" \
+            | tr -s ' ' '\n' | grep -v -F "$propagaterOutput" \
             | sort -u | tr '\n' ' ' `
         set -o pipefail
     fi
@@ -187,7 +190,6 @@ _multioutPropagateDev() {
         return
     fi
 
-    mkdir -p "${!outputFirst}"/nix-support
     local propagatedBuildInputsFile
     if [ -z "$crossConfig" ]; then
         propagatedBuildInputsFile=propagated-native-build-inputs
@@ -195,8 +197,9 @@ _multioutPropagateDev() {
         propagatedBuildInputsFile=propagated-build-inputs
     fi
 
+    mkdir -p "${!propagaterOutput}"/nix-support
     for output in $propagatedBuildOutputs; do
-        echo -n " ${!output}" >> "${!outputFirst}"/nix-support/$propagatedBuildInputsFile
+        echo -n " ${!output}" >> "${!propagaterOutput}"/nix-support/$propagatedBuildInputsFile
     done
 }