···3939_overrideFirst outputMan "man" "doc" "$outputBin"
4040_overrideFirst outputInfo "info" "doc" "$outputMan"
41414242-# Make stdenv put propagated*BuildInputs into $outputDev instead of $out
4343-propagateIntoOutput="${!outputDev}"
4444-45424643# Add standard flags to put files into the desired outputs.
4744_multioutConfig() {
···676468656966# Move subpaths that match pattern $1 from under any output/ to the $2 output/
6767+# Beware: only * ? [..] patterns are accepted.
7068_moveToOutput() {
7169 local patt="$1"
7270 local dstOut="$2"
···108106# Move development-only stuff to the desired outputs.
109107_multioutDevs() {
110108 if [ "$outputs" = "out" ] || [ -z "${moveToDev-1}" ]; then return; fi;
111111- echo "Looking for development-only stuff to move between outputs"
109109+ echo "Looking for development-only stuff to move to $outputDev"
112110 _moveToOutput include "${!outputInclude}"
113111 _moveToOutput lib/pkgconfig "${!outputDev}"
114114- _moveToOutput "lib/*.la" "${!outputDev}"
112112+ _moveToOutput share/pkgconfig "${!outputDev}"
115113116116- echo "Patching *.pc includedir to output ${!outputInclude}"
117117- for f in "${!outputDev}"/lib/pkgconfig/*.pc; do
114114+ # don't move libtool files yet
115115+ #_moveToOutput "lib/*.la" "${!outputDev}"
116116+117117+ for f in "${!outputDev}"/{lib,share}/pkgconfig/*.pc; do
118118+ echo "Patching '$f' includedir to output ${!outputInclude}"
118119 sed -i "/^includedir=/s,=\${prefix},=${!outputInclude}," "$f"
119120 done
120121}
121122122122-# Make ${!outputDev} propagate other outputs needed for development
123123+# Make the first output (typically "dev") propagate other outputs needed for development.
124124+# Take the first, because that's what one gets when putting the package into buildInputs.
123125# Note: during the build, probably only the "native" development packages are useful.
124126# With current cross-building setup, all packages are "native" if not cross-building.
125127_multioutPropagateDev() {
126128 if [ "$outputs" = "out" ]; then return; fi;
127129128128- if [ "${!outputInclude}" != "$propagateIntoOutput" ]; then
129129- mkdir -p "$propagateIntoOutput"/nix-support
130130- echo -n " ${!outputInclude}" >> "$propagateIntoOutput"/nix-support/propagated-native-build-inputs
131131- fi
132132- if [ "${!outputLib}" != "$propagateIntoOutput" ]; then
133133- mkdir -p "$propagateIntoOutput"/nix-support
134134- echo -n " ${!outputLib}" >> "$propagateIntoOutput"/nix-support/propagated-native-build-inputs
130130+ local outputFirst
131131+ for outputFirst in $outputs; do
132132+ break
133133+ done
134134+135135+ # Default value: propagate binaries, includes and libraries
136136+ if [[ ! -v "$propagatedOutputs" ]]; then
137137+ local po_dirty="$outputBin $outputInclude $outputLib"
138138+ propagatedOutputs=`echo "$po_dirty" \
139139+ | tr -s ' ' '\n' | grep -v -F "$outputFirst" \
140140+ | sort -u | tr '\n' ' ' `
141141+142142+ elif [ -z "$propagatedOutputs" ]; then
143143+ return # variable was explicitly set to empty
135144 fi
145145+146146+ mkdir -p "${!outputFirst}"/nix-support
147147+ for output in $propagatedOutputs; do
148148+ echo -n " ${!output}" >> "${!outputFirst}"/nix-support/propagated-native-build-inputs
149149+ done
136150}
137151