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.
This commit is contained in:
parent
694fa543af
commit
4e72b61de9
@ -144,11 +144,6 @@ ensureDir() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
installBin() {
|
|
||||||
mkdir -p $out/bin
|
|
||||||
cp "$@" $out/bin
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
######################################################################
|
######################################################################
|
||||||
# Initialisation.
|
# Initialisation.
|
||||||
@ -264,7 +259,7 @@ for i in $crossPkgs; do
|
|||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
# Add the output as an rpath.
|
# Add the output as an rpath. ToDo: multiple-output?
|
||||||
if [ "$NIX_NO_SELF_RPATH" != 1 ]; then
|
if [ "$NIX_NO_SELF_RPATH" != 1 ]; then
|
||||||
export NIX_LDFLAGS="-rpath $out/lib $NIX_LDFLAGS"
|
export NIX_LDFLAGS="-rpath $out/lib $NIX_LDFLAGS"
|
||||||
if [ -n "$NIX_LIB64_IN_SELF_RPATH" ]; then
|
if [ -n "$NIX_LIB64_IN_SELF_RPATH" ]; then
|
||||||
@ -707,24 +702,27 @@ fixupPhase() {
|
|||||||
prefix=${!output} runHook fixupOutput
|
prefix=${!output} runHook fixupOutput
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Multiple-output derivations mostly choose $dev instead of $out
|
||||||
|
local prOut="${propagateIntoOutput:-$out}"
|
||||||
|
|
||||||
if [ -n "$propagatedBuildInputs" ]; then
|
if [ -n "$propagatedBuildInputs" ]; then
|
||||||
mkdir -p "$out/nix-support"
|
mkdir -p "$prOut/nix-support"
|
||||||
echo "$propagatedBuildInputs" > "$out/nix-support/propagated-build-inputs"
|
echo "$propagatedBuildInputs" > "$prOut/nix-support/propagated-build-inputs"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$propagatedNativeBuildInputs" ]; then
|
if [ -n "$propagatedNativeBuildInputs" ]; then
|
||||||
mkdir -p "$out/nix-support"
|
mkdir -p "$prOut/nix-support"
|
||||||
echo "$propagatedNativeBuildInputs" > "$out/nix-support/propagated-native-build-inputs"
|
echo "$propagatedNativeBuildInputs" > "$prOut/nix-support/propagated-native-build-inputs"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$propagatedUserEnvPkgs" ]; then
|
if [ -n "$propagatedUserEnvPkgs" ]; then
|
||||||
mkdir -p "$out/nix-support"
|
mkdir -p "$prOut/nix-support"
|
||||||
echo "$propagatedUserEnvPkgs" > "$out/nix-support/propagated-user-env-packages"
|
echo "$propagatedUserEnvPkgs" > "$prOut/nix-support/propagated-user-env-packages"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$setupHook" ]; then
|
if [ -n "$setupHook" ]; then
|
||||||
mkdir -p "$out/nix-support"
|
mkdir -p "$prOut/nix-support"
|
||||||
substituteAll "$setupHook" "$out/nix-support/setup-hook"
|
substituteAll "$setupHook" "$prOut/nix-support/setup-hook"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
runHook postFixup
|
runHook postFixup
|
||||||
|
Loading…
x
Reference in New Issue
Block a user