diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index 9f3a126d39ee..6042fa9d0320 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -582,12 +582,12 @@ _addToEnv() { # # TODO(@Ericson2314): Don't special-case native compilation for pkg in \ - ${pkgsBuildBuild+"${pkgsBuildBuild[@]}"} \ - ${pkgsBuildHost+"${pkgsBuildHost[@]}"} \ - ${pkgsBuildTarget+"${pkgsBuildTarget[@]}"} \ - ${pkgsHostHost+"${pkgsHostHost[@]}"} \ - ${pkgsHostTarget+"${pkgsHostTarget[@]}"} \ - ${pkgsTargetTarget+"${pkgsTargetTarget[@]}"} + "${pkgsBuildBuild[@]}" \ + "${pkgsBuildHost[@]}" \ + "${pkgsBuildTarget[@]}" \ + "${pkgsHostHost[@]}" \ + "${pkgsHostTarget[@]}" \ + "${pkgsTargetTarget[@]}" do if [[ "$visitedPkgs" = *"$pkg"* ]]; then continue @@ -1034,7 +1034,7 @@ configurePhase() { # Old bash empty array hack # shellcheck disable=SC2086 local flagsArray=( - $configureFlags ${configureFlagsArray+"${configureFlagsArray[@]}"} + $configureFlags "${configureFlagsArray[@]}" ) echoCmd 'configure flags' "${flagsArray[@]}" # shellcheck disable=SC2086 @@ -1064,8 +1064,8 @@ buildPhase() { local flagsArray=( ${enableParallelBuilding:+-j${NIX_BUILD_CORES} -l${NIX_BUILD_CORES}} SHELL=$SHELL - $makeFlags ${makeFlagsArray+"${makeFlagsArray[@]}"} - $buildFlags ${buildFlagsArray+"${buildFlagsArray[@]}"} + $makeFlags "${makeFlagsArray[@]}" + $buildFlags "${buildFlagsArray[@]}" ) echoCmd 'build flags' "${flagsArray[@]}" @@ -1103,8 +1103,8 @@ checkPhase() { local flagsArray=( ${enableParallelChecking:+-j${NIX_BUILD_CORES} -l${NIX_BUILD_CORES}} SHELL=$SHELL - $makeFlags ${makeFlagsArray+"${makeFlagsArray[@]}"} - ${checkFlags:-VERBOSE=y} ${checkFlagsArray+"${checkFlagsArray[@]}"} + $makeFlags "${makeFlagsArray[@]}" + ${checkFlags:-VERBOSE=y} "${checkFlagsArray[@]}" ${checkTarget} ) @@ -1129,8 +1129,8 @@ installPhase() { # shellcheck disable=SC2086 local flagsArray=( SHELL=$SHELL - $makeFlags ${makeFlagsArray+"${makeFlagsArray[@]}"} - $installFlags ${installFlagsArray+"${installFlagsArray[@]}"} + $makeFlags "${makeFlagsArray[@]}" + $installFlags "${installFlagsArray[@]}" ${installTargets:-install} ) @@ -1237,8 +1237,8 @@ installCheckPhase() { local flagsArray=( ${enableParallelChecking:+-j${NIX_BUILD_CORES} -l${NIX_BUILD_CORES}} SHELL=$SHELL - $makeFlags ${makeFlagsArray+"${makeFlagsArray[@]}"} - $installCheckFlags ${installCheckFlagsArray+"${installCheckFlagsArray[@]}"} + $makeFlags "${makeFlagsArray[@]}" + $installCheckFlags "${installCheckFlagsArray[@]}" ${installCheckTarget:-installcheck} ) @@ -1257,7 +1257,7 @@ distPhase() { # Old bash empty array hack # shellcheck disable=SC2086 local flagsArray=( - $distFlags ${distFlagsArray+"${distFlagsArray[@]}"} ${distTarget:-dist} + $distFlags "${distFlagsArray[@]}" ${distTarget:-dist} ) echo 'dist flags: %q' "${flagsArray[@]}"