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 # The dynamic linker is passed in `ldflagsBefore' to allow
# explicit overrides of the dynamic linker by callers to gcc/ld # explicit overrides of the dynamic linker by callers to gcc/ld
# (the *last* value counts, so ours should come first). # (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) '' + optionalString (libc != null) ''
@ -258,9 +258,9 @@ stdenv.mkDerivation {
# Propagate the wrapped cc so that if you install the wrapper, # Propagate the wrapped cc so that if you install the wrapper,
# you get tools like gcov, the manpages, etc. as well (including # you get tools like gcov, the manpages, etc. as well (including
# for binutils and Glibc). # 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 != "") '' + 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 # tools like gcov, the manpages, etc. as well (including for binutils
# and Glibc). # and Glibc).
if test -z "$nativeTools"; then 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 fi

View File

@ -84,7 +84,7 @@ rec {
mkdir -p $out/nix-support mkdir -p $out/nix-support
cp ${script} $out/nix-support/setup-hook cp ${script} $out/nix-support/setup-hook
'' + lib.optionalString (deps != []) '' '' + 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 != {}) '' '' + lib.optionalString (substitutions != {}) ''
substituteAll ${script} $out/nix-support/setup-hook substituteAll ${script} $out/nix-support/setup-hook
''); '');

View File

@ -86,7 +86,7 @@ rec {
};}) };})
'' ''
mkdir -pv $out/nix-support 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 # 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 # any package that depends on the JRE has $CLASSPATH set up
# properly. # properly.
mkdir -p $out/nix-support 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 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 # any package that depends on the JRE has $CLASSPATH set up
# properly. # properly.
mkdir -p $out/nix-support 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 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 # any package that depends on the JRE has $CLASSPATH set up
# properly. # properly.
mkdir -p $jre/nix-support 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. # Set JAVA_HOME automatically.
mkdir -p $out/nix-support mkdir -p $out/nix-support

View File

@ -202,7 +202,7 @@ let
# any package that depends on the JRE has $CLASSPATH set up # any package that depends on the JRE has $CLASSPATH set up
# properly. # properly.
mkdir -p $jre/nix-support 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. # Set JAVA_HOME automatically.
mkdir -p $out/nix-support 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 ln -s $jrePath/lib/${architecture}/libnpjp2.so $jrePath/lib/${architecture}/plugins
mkdir -p $out/nix-support 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. # Set JAVA_HOME automatically.
cat <<EOF >> $out/nix-support/setup-hook 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" {} \; find $out -name "*.so" -exec patchelf --set-rpath "$rpath" {} \;
mkdir -p $out/nix-support 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. # Set JAVA_HOME automatically.
cat <<EOF >> $out/nix-support/setup-hook cat <<EOF >> $out/nix-support/setup-hook

View File

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

View File

@ -23,7 +23,7 @@ in
*/ */
collection = {list, name} : runCommand "collection-${name}" {} '' collection = {list, name} : runCommand "collection-${name}" {} ''
mkdir -p $out/nix-support 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} /* 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. # in stdenv.
mkdir $out/nix-support mkdir $out/nix-support
if [ "$propagatedUserEnvPkgs" ]; then 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 fi

View File

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