stdenv-setup and misc pkgs: Revert to space-deliminated propagated-* files

We cannot switch to line-delimited yet, because certain Nix commands do
not read in the entire file, but just the first line.
This commit is contained in:
John Ericson 2017-07-25 18:48:47 -04:00
parent 34c0ba498c
commit f6f40e3fe5
14 changed files with 26 additions and 23 deletions

View File

@ -190,7 +190,7 @@ stdenv.mkDerivation {
# The dynamic linker is passed in `ldflagsBefore' to allow
# explicit overrides of the dynamic linker by callers to gcc/ld
# (the *last* value counts, so ours should come first).
printLines "''${ldflagsBefore[@]}" > $out/nix-support/libc-ldflags-before
printWords "''${ldflagsBefore[@]}" > $out/nix-support/libc-ldflags-before
'')
+ optionalString (libc != null) ''
@ -258,9 +258,9 @@ stdenv.mkDerivation {
# Propagate the wrapped cc so that if you install the wrapper,
# you get tools like gcov, the manpages, etc. as well (including
# for binutils and Glibc).
printLines ${cc} ${cc.man or ""} ${binutils_bin} ${if libc == null then "" else libc_bin} > $out/nix-support/propagated-user-env-packages
printWords ${cc} ${cc.man or ""} ${binutils_bin} ${if libc == null then "" else libc_bin} > $out/nix-support/propagated-user-env-packages
printLines ${toString extraPackages} > $out/nix-support/propagated-native-build-inputs
printWords ${toString extraPackages} > $out/nix-support/propagated-native-build-inputs
''
+ optionalString (targetPlatform.isSunOS && nativePrefix != "") ''

View File

@ -211,5 +211,5 @@ cp -p $utils $out/nix-support/utils.sh
# tools like gcov, the manpages, etc. as well (including for binutils
# and Glibc).
if test -z "$nativeTools"; then
printLines $gcc $binutils $libc $libc_bin > $out/nix-support/propagated-user-env-packages
printWords $gcc $binutils $libc $libc_bin > $out/nix-support/propagated-user-env-packages
fi

View File

@ -84,7 +84,7 @@ rec {
mkdir -p $out/nix-support
cp ${script} $out/nix-support/setup-hook
'' + lib.optionalString (deps != []) ''
printLines ${toString deps} > $out/nix-support/propagated-native-build-inputs
printWords ${toString deps} > $out/nix-support/propagated-native-build-inputs
'' + lib.optionalString (substitutions != {}) ''
substituteAll ${script} $out/nix-support/setup-hook
'');

View File

@ -86,7 +86,7 @@ rec {
};})
''
mkdir -pv $out/nix-support
printLines ${toString list} | tee $out/nix-support/propagated-user-env-packages
printWords ${toString list} | tee $out/nix-support/propagated-user-env-packages
'';
# Given manifest module data, return the module

View File

@ -33,7 +33,7 @@ let
# any package that depends on the JRE has $CLASSPATH set up
# properly.
mkdir -p $out/nix-support
printLines ${setJavaClassPath} > $out/nix-support/propagated-native-build-inputs
printWords ${setJavaClassPath} > $out/nix-support/propagated-native-build-inputs
install_name_tool -change /usr/X11/lib/libfreetype.6.dylib ${freetype}/lib/libfreetype.6.dylib $out/jre/lib/libfontmanager.dylib

View File

@ -23,7 +23,7 @@ let
# any package that depends on the JRE has $CLASSPATH set up
# properly.
mkdir -p $out/nix-support
printLines ${setJavaClassPath} > $out/nix-support/propagated-native-build-inputs
printWords ${setJavaClassPath} > $out/nix-support/propagated-native-build-inputs
install_name_tool -change /usr/X11/lib/libfreetype.6.dylib ${freetype}/lib/libfreetype.6.dylib $out/jre/lib/libfontmanager.dylib

View File

@ -190,7 +190,7 @@ let
# any package that depends on the JRE has $CLASSPATH set up
# properly.
mkdir -p $jre/nix-support
printLines ${setJavaClassPath} > $jre/nix-support/propagated-native-build-inputs
printWords ${setJavaClassPath} > $jre/nix-support/propagated-native-build-inputs
# Set JAVA_HOME automatically.
mkdir -p $out/nix-support

View File

@ -202,7 +202,7 @@ let
# any package that depends on the JRE has $CLASSPATH set up
# properly.
mkdir -p $jre/nix-support
printLines ${setJavaClassPath} > $jre/nix-support/propagated-native-build-inputs
printWords ${setJavaClassPath} > $jre/nix-support/propagated-native-build-inputs
# Set JAVA_HOME automatically.
mkdir -p $out/nix-support

View File

@ -165,7 +165,7 @@ let result = stdenv.mkDerivation rec {
ln -s $jrePath/lib/${architecture}/libnpjp2.so $jrePath/lib/${architecture}/plugins
mkdir -p $out/nix-support
printLines ${setJavaClassPath} > $out/nix-support/propagated-native-build-inputs
printWords ${setJavaClassPath} > $out/nix-support/propagated-native-build-inputs
# Set JAVA_HOME automatically.
cat <<EOF >> $out/nix-support/setup-hook

View File

@ -54,7 +54,7 @@ in stdenv.mkDerivation rec {
find $out -name "*.so" -exec patchelf --set-rpath "$rpath" {} \;
mkdir -p $out/nix-support
printLines ${setJavaClassPath} > $out/nix-support/propagated-native-build-inputs
printWords ${setJavaClassPath} > $out/nix-support/propagated-native-build-inputs
# Set JAVA_HOME automatically.
cat <<EOF >> $out/nix-support/setup-hook

View File

@ -311,7 +311,7 @@ stdenv.mkDerivation ({
${optionalString isGhcjs ''
for exeDir in "$out/bin/"*.jsexe; do
exe="''${exeDir%.jsexe}"
printLines '#!${nodejs}/bin/node' > "$exe"
printWords '#!${nodejs}/bin/node' > "$exe"
cat "$exeDir/all.js" >> "$exe"
chmod +x "$exe"
done

View File

@ -23,7 +23,7 @@ in
*/
collection = {list, name} : runCommand "collection-${name}" {} ''
mkdir -p $out/nix-support
printLines ${builtins.toString list} > $out/nix-support/propagated-user-env-packages
printWords ${builtins.toString list} > $out/nix-support/propagated-user-env-packages
'';
/* creates a derivation symlinking references C/C++ libs into one include and lib directory called $out/cdt-envs/${name}

View File

@ -15,5 +15,5 @@ cat "$setup" >> $out/setup
# in stdenv.
mkdir $out/nix-support
if [ "$propagatedUserEnvPkgs" ]; then
printf '%s\n' $propagatedUserEnvPkgs > $out/nix-support/propagated-user-env-packages
printf '%s ' $propagatedUserEnvPkgs > $out/nix-support/propagated-user-env-packages
fi

View File

@ -210,6 +210,11 @@ printLines() {
printf '%s\n' "$@"
}
printWords() {
[[ "$#" -gt 0 ]] || return 0
printf '%s ' "$@"
}
######################################################################
# Initialisation.
@ -291,12 +296,10 @@ findInputs() {
fi
if [ -f "$pkg/nix-support/$propagatedBuildInputsFile" ]; then
local fd pkgNext
exec {fd}<"$pkg/nix-support/$propagatedBuildInputsFile"
while IFS= read -r -u $fd pkgNext; do
local pkgNext
for pkgNext in $(< "$pkg/nix-support/$propagatedBuildInputsFile"); do
findInputs "$pkgNext" "$var" "$propagatedBuildInputsFile"
done
exec {fd}<&-
fi
}
@ -814,19 +817,19 @@ fixupPhase() {
if [ -n "$propagated" ]; then
mkdir -p "${!outputDev}/nix-support"
# shellcheck disable=SC2086
printLines $propagated > "${!outputDev}/nix-support/propagated-native-build-inputs"
printWords $propagated > "${!outputDev}/nix-support/propagated-native-build-inputs"
fi
else
if [ -n "$propagatedBuildInputs" ]; then
mkdir -p "${!outputDev}/nix-support"
# shellcheck disable=SC2086
printLines $propagatedBuildInputs > "${!outputDev}/nix-support/propagated-build-inputs"
printWords $propagatedBuildInputs > "${!outputDev}/nix-support/propagated-build-inputs"
fi
if [ -n "$propagatedNativeBuildInputs" ]; then
mkdir -p "${!outputDev}/nix-support"
# shellcheck disable=SC2086
printLines $propagatedNativeBuildInputs > "${!outputDev}/nix-support/propagated-native-build-inputs"
printWords $propagatedNativeBuildInputs > "${!outputDev}/nix-support/propagated-native-build-inputs"
fi
fi
@ -840,7 +843,7 @@ fixupPhase() {
if [ -n "$propagatedUserEnvPkgs" ]; then
mkdir -p "${!outputBin}/nix-support"
# shellcheck disable=SC2086
printLines $propagatedUserEnvPkgs > "${!outputBin}/nix-support/propagated-user-env-packages"
printWords $propagatedUserEnvPkgs > "${!outputBin}/nix-support/propagated-user-env-packages"
fi
runHook postFixup