stdenv/multiple-outputs.sh: Change output propagation logic

Because 'dev' will most often not be the default output after my changes.
This commit is contained in:
Tuomas Tynkkynen 2016-01-24 05:21:45 +02:00
parent 5326e85f3d
commit 5d55ae5d50

View File

@ -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
}