From f6dfbb692c638b83989eb9e5cd286ea847e84e36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Tue, 19 Apr 2016 13:13:27 +0200 Subject: [PATCH] stdenv multiple-outputs: fix cross-build propagation Fixes #14817. The outputs weren't propagated correctly when cross-building. --- pkgs/build-support/setup-hooks/multiple-outputs.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/pkgs/build-support/setup-hooks/multiple-outputs.sh b/pkgs/build-support/setup-hooks/multiple-outputs.sh index c49ea4b09a7..06d80e12f09 100644 --- a/pkgs/build-support/setup-hooks/multiple-outputs.sh +++ b/pkgs/build-support/setup-hooks/multiple-outputs.sh @@ -162,8 +162,8 @@ _multioutDevs() { # 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. -# Note: during the build, probably only the "native" development packages are useful. -# With current cross-building setup, all packages are "native" if not cross-building. +# 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() { if [ "$outputs" = "out" ]; then return; fi; @@ -188,8 +188,15 @@ _multioutPropagateDev() { fi mkdir -p "${!outputFirst}"/nix-support + local propagatedBuildInputsFile + if [ -z "$crossConfig" ]; then + propagatedBuildInputsFile=propagated-native-build-inputs + else + propagatedBuildInputsFile=propagated-build-inputs + fi + for output in $propagatedBuildOutputs; do - echo -n " ${!output}" >> "${!outputFirst}"/nix-support/propagated-native-build-inputs + echo -n " ${!output}" >> "${!outputFirst}"/nix-support/$propagatedBuildInputsFile done }