forked from mirrors/nixpkgs
Merge pull request #31775 from obsidiansystems/stdenv-both-propagated-files
stdenv setup: Always use both propagated files
This commit is contained in:
commit
405412dfd9
|
@ -164,8 +164,6 @@ _multioutDevs() {
|
||||||
}
|
}
|
||||||
|
|
||||||
# Make the "dev" propagate other outputs needed for development.
|
# 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() {
|
_multioutPropagateDev() {
|
||||||
if [ "$outputs" = "out" ]; then return; fi;
|
if [ "$outputs" = "out" ]; then return; fi;
|
||||||
|
|
||||||
|
@ -193,16 +191,8 @@ _multioutPropagateDev() {
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local propagatedBuildInputsFile
|
|
||||||
if [ -z "$crossConfig" ]; then
|
|
||||||
propagatedBuildInputsFile=propagated-native-build-inputs
|
|
||||||
else
|
|
||||||
propagatedBuildInputsFile=propagated-build-inputs
|
|
||||||
fi
|
|
||||||
|
|
||||||
mkdir -p "${!propagaterOutput}"/nix-support
|
mkdir -p "${!propagaterOutput}"/nix-support
|
||||||
for output in $propagatedBuildOutputs; do
|
for output in $propagatedBuildOutputs; do
|
||||||
echo -n " ${!output}" >> "${!propagaterOutput}"/nix-support/$propagatedBuildInputsFile
|
echo -n " ${!output}" >> "${!propagaterOutput}"/nix-support/propagated-build-inputs
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -101,7 +101,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 != []) ''
|
||||||
printWords ${toString deps} > $out/nix-support/propagated-native-build-inputs
|
printWords ${toString deps} > $out/nix-support/propagated-build-inputs
|
||||||
'' + lib.optionalString (substitutions != {}) ''
|
'' + lib.optionalString (substitutions != {}) ''
|
||||||
substituteAll ${script} $out/nix-support/setup-hook
|
substituteAll ${script} $out/nix-support/setup-hook
|
||||||
'');
|
'');
|
||||||
|
|
|
@ -58,11 +58,7 @@ let
|
||||||
# Propagate $dev so that this setup hook is propagated
|
# Propagate $dev so that this setup hook is propagated
|
||||||
# But only if there is a separate $dev output
|
# But only if there is a separate $dev output
|
||||||
if [ "$outputDev" != out ]; then
|
if [ "$outputDev" != out ]; then
|
||||||
if [ -n "$crossConfig" ]; then
|
propagatedBuildInputs="$propagatedBuildInputs @dev@"
|
||||||
propagatedBuildInputs="$propagatedBuildInputs @dev@"
|
|
||||||
else
|
|
||||||
propagatedNativeBuildInputs="$propagatedNativeBuildInputs @dev@"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
|
|
|
@ -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
|
||||||
printWords ${setJavaClassPath} > $out/nix-support/propagated-native-build-inputs
|
printWords ${setJavaClassPath} > $out/nix-support/propagated-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
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
printWords ${setJavaClassPath} > $out/nix-support/propagated-native-build-inputs
|
printWords ${setJavaClassPath} > $out/nix-support/propagated-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
|
||||||
|
|
||||||
|
|
|
@ -184,13 +184,13 @@ let
|
||||||
preFixup = ''
|
preFixup = ''
|
||||||
prefix=$jre stripDirs "$stripDebugList" "''${stripDebugFlags:--S}"
|
prefix=$jre stripDirs "$stripDebugList" "''${stripDebugFlags:--S}"
|
||||||
patchELF $jre
|
patchELF $jre
|
||||||
propagatedNativeBuildInputs+=" $jre"
|
propagatedBuildInputs+=" $jre"
|
||||||
|
|
||||||
# Propagate the setJavaClassPath setup hook from the JRE so that
|
# Propagate the setJavaClassPath setup hook from the JRE so that
|
||||||
# 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
|
||||||
printWords ${setJavaClassPath} > $jre/nix-support/propagated-native-build-inputs
|
printWords ${setJavaClassPath} > $jre/nix-support/propagated-build-inputs
|
||||||
|
|
||||||
# Set JAVA_HOME automatically.
|
# Set JAVA_HOME automatically.
|
||||||
mkdir -p $out/nix-support
|
mkdir -p $out/nix-support
|
||||||
|
|
|
@ -206,13 +206,13 @@ let
|
||||||
preFixup = ''
|
preFixup = ''
|
||||||
prefix=$jre stripDirs "$stripDebugList" "''${stripDebugFlags:--S}"
|
prefix=$jre stripDirs "$stripDebugList" "''${stripDebugFlags:--S}"
|
||||||
patchELF $jre
|
patchELF $jre
|
||||||
propagatedNativeBuildInputs+=" $jre"
|
propagatedBuildInputs+=" $jre"
|
||||||
|
|
||||||
# Propagate the setJavaClassPath setup hook from the JRE so that
|
# Propagate the setJavaClassPath setup hook from the JRE so that
|
||||||
# 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
|
||||||
printWords ${setJavaClassPath} > $jre/nix-support/propagated-native-build-inputs
|
printWords ${setJavaClassPath} > $jre/nix-support/propagated-build-inputs
|
||||||
|
|
||||||
# Set JAVA_HOME automatically.
|
# Set JAVA_HOME automatically.
|
||||||
mkdir -p $out/nix-support
|
mkdir -p $out/nix-support
|
||||||
|
|
|
@ -204,14 +204,14 @@ let
|
||||||
preFixup = ''
|
preFixup = ''
|
||||||
prefix=$jre stripDirs "$stripDebugList" "''${stripDebugFlags:--S}"
|
prefix=$jre stripDirs "$stripDebugList" "''${stripDebugFlags:--S}"
|
||||||
patchELF $jre
|
patchELF $jre
|
||||||
propagatedNativeBuildInputs+=" $jre"
|
propagatedBuildInputs+=" $jre"
|
||||||
|
|
||||||
# Propagate the setJavaClassPath setup hook from the JRE so that
|
# Propagate the setJavaClassPath setup hook from the JRE so that
|
||||||
# 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
|
||||||
#TODO or printWords? cf https://github.com/NixOS/nixpkgs/pull/27427#issuecomment-317293040
|
#TODO or printWords? cf https://github.com/NixOS/nixpkgs/pull/27427#issuecomment-317293040
|
||||||
echo -n "${setJavaClassPath}" > $jre/nix-support/propagated-native-build-inputs
|
echo -n "${setJavaClassPath}" > $jre/nix-support/propagated-build-inputs
|
||||||
|
|
||||||
# Set JAVA_HOME automatically.
|
# Set JAVA_HOME automatically.
|
||||||
mkdir -p $out/nix-support
|
mkdir -p $out/nix-support
|
||||||
|
|
|
@ -166,7 +166,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
|
||||||
printWords ${setJavaClassPath} > $out/nix-support/propagated-native-build-inputs
|
printWords ${setJavaClassPath} > $out/nix-support/propagated-build-inputs
|
||||||
|
|
||||||
# Set JAVA_HOME automatically.
|
# Set JAVA_HOME automatically.
|
||||||
cat <<EOF >> $out/nix-support/setup-hook
|
cat <<EOF >> $out/nix-support/setup-hook
|
||||||
|
|
|
@ -124,7 +124,7 @@ let result = stdenv.mkDerivation rec {
|
||||||
ln -s $out $out/jre
|
ln -s $out $out/jre
|
||||||
|
|
||||||
mkdir -p $out/nix-support
|
mkdir -p $out/nix-support
|
||||||
printWords ${setJavaClassPath} > $out/nix-support/propagated-native-build-inputs
|
printWords ${setJavaClassPath} > $out/nix-support/propagated-build-inputs
|
||||||
|
|
||||||
# Set JAVA_HOME automatically.
|
# Set JAVA_HOME automatically.
|
||||||
cat <<EOF >> $out/nix-support/setup-hook
|
cat <<EOF >> $out/nix-support/setup-hook
|
||||||
|
|
|
@ -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
|
||||||
printWords ${setJavaClassPath} > $out/nix-support/propagated-native-build-inputs
|
printWords ${setJavaClassPath} > $out/nix-support/propagated-build-inputs
|
||||||
|
|
||||||
# Set JAVA_HOME automatically.
|
# Set JAVA_HOME automatically.
|
||||||
cat <<EOF >> $out/nix-support/setup-hook
|
cat <<EOF >> $out/nix-support/setup-hook
|
||||||
|
|
|
@ -51,7 +51,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
|
||||||
printWords ${setJavaClassPath} > $out/nix-support/propagated-native-build-inputs
|
printWords ${setJavaClassPath} > $out/nix-support/propagated-build-inputs
|
||||||
|
|
||||||
# Set JAVA_HOME automatically.
|
# Set JAVA_HOME automatically.
|
||||||
cat <<EOF >> $out/nix-support/setup-hook
|
cat <<EOF >> $out/nix-support/setup-hook
|
||||||
|
|
|
@ -83,7 +83,7 @@ wrapPythonProgramsIn() {
|
||||||
|
|
||||||
# Adds the lib and bin directories to the PYTHONPATH and PATH variables,
|
# Adds the lib and bin directories to the PYTHONPATH and PATH variables,
|
||||||
# respectively. Recurses on any paths declared in
|
# respectively. Recurses on any paths declared in
|
||||||
# `propagated-native-build-inputs`, while avoiding duplicating paths by
|
# `propagated-build-inputs`, while avoiding duplicating paths by
|
||||||
# flagging the directories it has visited in `pythonPathsSeen`.
|
# flagging the directories it has visited in `pythonPathsSeen`.
|
||||||
_addToPythonPath() {
|
_addToPythonPath() {
|
||||||
local dir="$1"
|
local dir="$1"
|
||||||
|
@ -96,7 +96,7 @@ _addToPythonPath() {
|
||||||
addToSearchPath program_PATH $dir/bin
|
addToSearchPath program_PATH $dir/bin
|
||||||
|
|
||||||
# Inspect the propagated inputs (if they exist) and recur on them.
|
# Inspect the propagated inputs (if they exist) and recur on them.
|
||||||
local prop="$dir/nix-support/propagated-native-build-inputs"
|
local prop="$dir/nix-support/propagated-build-inputs"
|
||||||
if [ -e $prop ]; then
|
if [ -e $prop ]; then
|
||||||
local new_path
|
local new_path
|
||||||
for new_path in $(cat $prop); do
|
for new_path in $(cat $prop); do
|
||||||
|
|
|
@ -4,20 +4,14 @@ providesGrantleeRuntime() {
|
||||||
[ -d "$1/$grantleePluginPrefix" ]
|
[ -d "$1/$grantleePluginPrefix" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
_grantleeCrossEnvHook() {
|
_grantleeEnvHook() {
|
||||||
if providesQtRuntime "$1"; then
|
if providesGrantleeRuntime "$1"; then
|
||||||
propagatedBuildInputs+=" $1"
|
propagatedBuildInputs+=" $1"
|
||||||
propagatedUserEnvPkgs+=" $1"
|
propagatedUserEnvPkgs+=" $1"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
crossEnvHooks+=(_grantleeCrossEnvHook)
|
if [ "$crossEnv" ]; then
|
||||||
|
crossEnvHooks+=(_grantleeEnvHook)
|
||||||
_grantleeEnvHook() {
|
else
|
||||||
if providesGrantleeRuntime "$1"; then
|
envHooks+=(_grantleeEnvHook)
|
||||||
propagatedNativeBuildInputs+=" $1"
|
fi
|
||||||
if [ -z "$crossConfig" ]; then
|
|
||||||
propagatedUserEnvPkgs+=" $1"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
envHooks+=(_grantleeEnvHook)
|
|
||||||
|
|
|
@ -56,11 +56,7 @@ let
|
||||||
# Propagate $dev so that this setup hook is propagated
|
# Propagate $dev so that this setup hook is propagated
|
||||||
# But only if there is a separate $dev output
|
# But only if there is a separate $dev output
|
||||||
if [ "$outputDev" != out ]; then
|
if [ "$outputDev" != out ]; then
|
||||||
if [ -n "$crossConfig" ]; then
|
propagatedBuildInputs="$propagatedBuildInputs @dev@"
|
||||||
propagatedBuildInputs="$propagatedBuildInputs @dev@"
|
|
||||||
else
|
|
||||||
propagatedNativeBuildInputs="$propagatedNativeBuildInputs @dev@"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
|
|
|
@ -51,7 +51,7 @@ stdenv.mkDerivation rec {
|
||||||
moveToOutput share/man/man1 "$bin"
|
moveToOutput share/man/man1 "$bin"
|
||||||
'' + optionalString pythonSupport ''
|
'' + optionalString pythonSupport ''
|
||||||
mkdir -p $py/nix-support
|
mkdir -p $py/nix-support
|
||||||
echo ${libxml2.py} >> $py/nix-support/propagated-native-build-inputs
|
echo ${libxml2.py} >> $py/nix-support/propagated-build-inputs
|
||||||
moveToOutput lib/python2.7 "$py"
|
moveToOutput lib/python2.7 "$py"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@ addToQMAKEPATH() {
|
||||||
# package depending on the building package. (This is necessary in case
|
# package depending on the building package. (This is necessary in case
|
||||||
# the building package does not provide runtime dependencies itself and so
|
# the building package does not provide runtime dependencies itself and so
|
||||||
# would not be propagated to the user environment.)
|
# would not be propagated to the user environment.)
|
||||||
qtCrossEnvHook() {
|
qtEnvHook() {
|
||||||
addToQMAKEPATH "$1"
|
addToQMAKEPATH "$1"
|
||||||
if providesQtRuntime "$1"; then
|
if providesQtRuntime "$1"; then
|
||||||
if [ "z${!outputBin}" != "z${!outputDev}" ]; then
|
if [ "z${!outputBin}" != "z${!outputDev}" ]; then
|
||||||
|
@ -42,20 +42,11 @@ qtCrossEnvHook() {
|
||||||
propagatedUserEnvPkgs+=" $1"
|
propagatedUserEnvPkgs+=" $1"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
crossEnvHooks+=(qtCrossEnvHook)
|
if [ "$crossConfig" ]; then
|
||||||
|
crossEnvHooks+=(qtEnvHook)
|
||||||
qtEnvHook() {
|
else
|
||||||
addToQMAKEPATH "$1"
|
envHooks+=(qtEnvHook)
|
||||||
if providesQtRuntime "$1"; then
|
fi
|
||||||
if [ "z${!outputBin}" != "z${!outputDev}" ]; then
|
|
||||||
propagatedNativeBuildInputs+=" $1"
|
|
||||||
fi
|
|
||||||
if [ -z "$crossConfig" ]; then
|
|
||||||
propagatedUserEnvPkgs+=" $1"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
envHooks+=(qtEnvHook)
|
|
||||||
|
|
||||||
postPatchMkspecs() {
|
postPatchMkspecs() {
|
||||||
local bin="${!outputBin}"
|
local bin="${!outputBin}"
|
||||||
|
|
|
@ -34,8 +34,8 @@ postFixup() {
|
||||||
# dependencies in the user environment (since Perl modules don't
|
# dependencies in the user environment (since Perl modules don't
|
||||||
# have something like an RPATH, so the only way to find the
|
# have something like an RPATH, so the only way to find the
|
||||||
# dependencies is to have them in the PERL5LIB variable).
|
# dependencies is to have them in the PERL5LIB variable).
|
||||||
if test -e $out/nix-support/propagated-native-build-inputs; then
|
if test -e $out/nix-support/propagated-build-inputs; then
|
||||||
ln -s $out/nix-support/propagated-native-build-inputs $out/nix-support/propagated-user-env-packages
|
ln -s $out/nix-support/propagated-build-inputs $out/nix-support/propagated-user-env-packages
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -41,8 +41,8 @@ stdenv.mkDerivation ({
|
||||||
'';
|
'';
|
||||||
|
|
||||||
postFixup = ''
|
postFixup = ''
|
||||||
if test -e $out/nix-support/propagated-native-build-inputs; then
|
if test -e $out/nix-support/propagated-build-inputs; then
|
||||||
ln -s $out/nix-support/propagated-native-build-inputs $out/nix-support/propagated-user-env-packages
|
ln -s $out/nix-support/propagated-build-inputs $out/nix-support/propagated-user-env-packages
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
|
|
@ -102,8 +102,8 @@ stdenv.mkDerivation rec {
|
||||||
find "$out/lib/plugins" -type f -print0 | xargs -0 -L1 \
|
find "$out/lib/plugins" -type f -print0 | xargs -0 -L1 \
|
||||||
sed -i -e "s|/usr/bin/||g" -e "s|/usr/sbin/||g" -e "s|\<bc\>|${bc}/bin/bc|g"
|
sed -i -e "s|/usr/bin/||g" -e "s|/usr/sbin/||g" -e "s|\<bc\>|${bc}/bin/bc|g"
|
||||||
|
|
||||||
if test -e $out/nix-support/propagated-native-build-inputs; then
|
if test -e $out/nix-support/propagated-build-inputs; then
|
||||||
ln -s $out/nix-support/propagated-native-build-inputs $out/nix-support/propagated-user-env-packages
|
ln -s $out/nix-support/propagated-build-inputs $out/nix-support/propagated-user-env-packages
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for file in "$out"/bin/munindoc "$out"/sbin/munin-* "$out"/lib/munin-* "$out"/www/cgi/*; do
|
for file in "$out"/bin/munindoc "$out"/sbin/munin-* "$out"/lib/munin-* "$out"/www/cgi/*; do
|
||||||
|
|
|
@ -16,22 +16,18 @@ postInstall() {
|
||||||
|
|
||||||
echo "propagating requisites $requires"
|
echo "propagating requisites $requires"
|
||||||
|
|
||||||
|
if test -n "$crossConfig"; then
|
||||||
|
local pkgs=("${crossPkgs[@]}")
|
||||||
|
else
|
||||||
|
local pkgs=("${nativePkgs[@]}")
|
||||||
|
fi
|
||||||
for r in $requires; do
|
for r in $requires; do
|
||||||
if test -n "$crossConfig"; then
|
for p in "${pkgs[@]}"; do
|
||||||
for p in "${crossPkgs[@]}"; do
|
if test -e $p/lib/pkgconfig/$r.pc; then
|
||||||
if test -e $p/lib/pkgconfig/$r.pc; then
|
echo " found requisite $r in $p"
|
||||||
echo " found requisite $r in $p"
|
propagatedBuildInputs+=" $p"
|
||||||
propagatedBuildInputs="$propagatedBuildInputs $p"
|
fi
|
||||||
fi
|
done
|
||||||
done
|
|
||||||
else
|
|
||||||
for p in "${nativePkgs[@]}"; do
|
|
||||||
if test -e $p/lib/pkgconfig/$r.pc; then
|
|
||||||
echo " found requisite $r in $p"
|
|
||||||
propagatedNativeBuildInputs="$propagatedNativeBuildInputs $p"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -239,12 +239,12 @@ isScript() {
|
||||||
|
|
||||||
# printf unfortunately will print a trailing newline regardless
|
# printf unfortunately will print a trailing newline regardless
|
||||||
printLines() {
|
printLines() {
|
||||||
[[ "$#" -gt 0 ]] || return 0
|
(( "$#" > 0 )) || return 0
|
||||||
printf '%s\n' "$@"
|
printf '%s\n' "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
printWords() {
|
printWords() {
|
||||||
[[ "$#" -gt 0 ]] || return 0
|
(( "$#" > 0 )) || return 0
|
||||||
printf '%s ' "$@"
|
printf '%s ' "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -302,9 +302,9 @@ runHook addInputsHook
|
||||||
|
|
||||||
# Recursively find all build inputs.
|
# Recursively find all build inputs.
|
||||||
findInputs() {
|
findInputs() {
|
||||||
local pkg="$1"
|
local pkg="$1"; shift
|
||||||
local var="$2"
|
local var="$1"; shift
|
||||||
local propagatedBuildInputsFile="$3"
|
local propagatedBuildInputsFiles=("$@")
|
||||||
|
|
||||||
# TODO(@Ericson2314): Restore using associative array once Darwin
|
# TODO(@Ericson2314): Restore using associative array once Darwin
|
||||||
# nix-shell doesn't use impure bash. This should replace the O(n)
|
# nix-shell doesn't use impure bash. This should replace the O(n)
|
||||||
|
@ -324,12 +324,16 @@ findInputs() {
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f "$pkg/nix-support/$propagatedBuildInputsFile" ]; then
|
local file
|
||||||
|
for file in "${propagatedBuildInputsFiles[@]}"; do
|
||||||
|
file="$pkg/nix-support/$file"
|
||||||
|
[[ -f "$file" ]] || continue
|
||||||
|
|
||||||
local pkgNext
|
local pkgNext
|
||||||
for pkgNext in $(< "$pkg/nix-support/$propagatedBuildInputsFile"); do
|
for pkgNext in $(< "$file"); do
|
||||||
findInputs "$pkgNext" "$var" "$propagatedBuildInputsFile"
|
findInputs "$pkgNext" "$var" "${propagatedBuildInputsFiles[@]}"
|
||||||
done
|
done
|
||||||
fi
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
# Add package to the future PATH and run setup hooks
|
# Add package to the future PATH and run setup hooks
|
||||||
|
@ -362,26 +366,21 @@ if [ -z "${crossConfig:-}" ]; then
|
||||||
for i in ${nativeBuildInputs:-} ${buildInputs:-} \
|
for i in ${nativeBuildInputs:-} ${buildInputs:-} \
|
||||||
${defaultNativeBuildInputs:-} ${defaultBuildInputs:-} \
|
${defaultNativeBuildInputs:-} ${defaultBuildInputs:-} \
|
||||||
${propagatedNativeBuildInputs:-} ${propagatedBuildInputs:-}; do
|
${propagatedNativeBuildInputs:-} ${propagatedBuildInputs:-}; do
|
||||||
findInputs "$i" nativePkgs propagated-native-build-inputs
|
findInputs "$i" nativePkgs propagated-native-build-inputs propagated-build-inputs
|
||||||
done
|
|
||||||
|
|
||||||
for i in "${nativePkgs[@]}"; do
|
|
||||||
activatePackage "$i"
|
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
for i in ${buildInputs:-} ${defaultBuildInputs:-} ${propagatedBuildInputs:-}; do
|
|
||||||
findInputs "$i" crossPkgs propagated-build-inputs
|
|
||||||
done
|
|
||||||
|
|
||||||
for i in ${nativeBuildInputs:-} ${defaultNativeBuildInputs:-} ${propagatedNativeBuildInputs:-}; do
|
for i in ${nativeBuildInputs:-} ${defaultNativeBuildInputs:-} ${propagatedNativeBuildInputs:-}; do
|
||||||
findInputs "$i" nativePkgs propagated-native-build-inputs
|
findInputs "$i" nativePkgs propagated-native-build-inputs
|
||||||
done
|
done
|
||||||
|
for i in ${buildInputs:-} ${defaultBuildInputs:-} ${propagatedBuildInputs:-}; do
|
||||||
for i in "${nativePkgs[@]}" "${crossPkgs[@]}"; do
|
findInputs "$i" crossPkgs propagated-build-inputs
|
||||||
activatePackage "$i"
|
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
for i in ${nativePkgs+"${nativePkgs[@]}"} ${crossPkgs+"${crossPkgs[@]}"}; do
|
||||||
|
activatePackage "$i"
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
# Set the relevant environment variables to point to the build inputs
|
# Set the relevant environment variables to point to the build inputs
|
||||||
# found above.
|
# found above.
|
||||||
|
@ -898,31 +897,19 @@ fixupPhase() {
|
||||||
|
|
||||||
# Propagate build inputs and setup hook into the development output.
|
# Propagate build inputs and setup hook into the development output.
|
||||||
|
|
||||||
if [ -z "${crossConfig:-}" ]; then
|
if [ -n "${propagatedBuildInputs:-}" ]; then
|
||||||
# Not cross-compiling - propagatedBuildInputs are handled identically to propagatedNativeBuildInputs
|
mkdir -p "${!outputDev}/nix-support"
|
||||||
local propagated="$propagatedNativeBuildInputs"
|
# shellcheck disable=SC2086
|
||||||
if [ -n "${propagatedBuildInputs:-}" ]; then
|
printWords $propagatedBuildInputs > "${!outputDev}/nix-support/propagated-build-inputs"
|
||||||
propagated+="${propagated:+ }$propagatedBuildInputs"
|
|
||||||
fi
|
|
||||||
if [ -n "${propagated:-}" ]; then
|
|
||||||
mkdir -p "${!outputDev}/nix-support"
|
|
||||||
# shellcheck disable=SC2086
|
|
||||||
printWords $propagated > "${!outputDev}/nix-support/propagated-native-build-inputs"
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
if [ -n "${propagatedBuildInputs:-}" ]; then
|
|
||||||
mkdir -p "${!outputDev}/nix-support"
|
|
||||||
# shellcheck disable=SC2086
|
|
||||||
printWords $propagatedBuildInputs > "${!outputDev}/nix-support/propagated-build-inputs"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -n "${propagatedNativeBuildInputs:-}" ]; then
|
|
||||||
mkdir -p "${!outputDev}/nix-support"
|
|
||||||
# shellcheck disable=SC2086
|
|
||||||
printWords $propagatedNativeBuildInputs > "${!outputDev}/nix-support/propagated-native-build-inputs"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -n "${propagatedNativeBuildInputs:-}" ]; then
|
||||||
|
mkdir -p "${!outputDev}/nix-support"
|
||||||
|
# shellcheck disable=SC2086
|
||||||
|
printWords $propagatedNativeBuildInputs > "${!outputDev}/nix-support/propagated-native-build-inputs"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
if [ -n "${setupHook:-}" ]; then
|
if [ -n "${setupHook:-}" ]; then
|
||||||
mkdir -p "${!outputDev}/nix-support"
|
mkdir -p "${!outputDev}/nix-support"
|
||||||
substituteAll "$setupHook" "${!outputDev}/nix-support/setup-hook"
|
substituteAll "$setupHook" "${!outputDev}/nix-support/setup-hook"
|
||||||
|
|
|
@ -227,9 +227,9 @@ stdenv.mkDerivation {
|
||||||
wrapProgram $out/sbin/ceph-create-keys ${wrapArgs}
|
wrapProgram $out/sbin/ceph-create-keys ${wrapArgs}
|
||||||
wrapProgram $out/sbin/ceph-disk ${wrapArgs}
|
wrapProgram $out/sbin/ceph-disk ${wrapArgs}
|
||||||
|
|
||||||
# Bring in lib as a native build input
|
# Bring in lib as a run-time dependency
|
||||||
mkdir -p $out/nix-support
|
mkdir -p $out/nix-support
|
||||||
echo "$lib" > $out/nix-support/propagated-native-build-inputs
|
echo "$lib" > $out/nix-support/propagated-build-inputs
|
||||||
|
|
||||||
# Fix the python library loading
|
# Fix the python library loading
|
||||||
find $lib/lib -name \*.pyc -or -name \*.pyd -exec rm {} \;
|
find $lib/lib -name \*.pyc -or -name \*.pyd -exec rm {} \;
|
||||||
|
|
|
@ -9768,7 +9768,7 @@ with pkgs;
|
||||||
# the hook to find catalogs is hidden by buildEnv
|
# the hook to find catalogs is hidden by buildEnv
|
||||||
postBuild = ''
|
postBuild = ''
|
||||||
mkdir "$out/nix-support"
|
mkdir "$out/nix-support"
|
||||||
cp '${libxml2.dev}/nix-support/propagated-native-build-inputs' "$out/nix-support/"
|
cp '${libxml2.dev}/nix-support/propagated-build-inputs' "$out/nix-support/"
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue