stdenv-setup: Remove any declare -g
This is invalid before bash-4.2, affecting bash used impurely in nix-shell on MacOS.
This commit is contained in:
parent
ea7d13cf1a
commit
820e4021d3
@ -285,10 +285,7 @@ findInputs() {
|
|||||||
*" $pkg "*) return 0 ;;
|
*" $pkg "*) return 0 ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# For some reason, bash gives us some (hopefully limited) eval
|
eval "$var"'+=("$pkg")'
|
||||||
# "for free"! Everything is single-quoted except for `"$var"`
|
|
||||||
# so `var` is expanded first.
|
|
||||||
declare -g "$var"'=("${'"$var"'[@]}" "$pkg")'
|
|
||||||
|
|
||||||
if ! [ -e "$pkg" ]; then
|
if ! [ -e "$pkg" ]; then
|
||||||
echo "build input $pkg does not exist" >&2
|
echo "build input $pkg does not exist" >&2
|
||||||
@ -318,19 +315,19 @@ findInputs() {
|
|||||||
if [ -z "$crossConfig" ]; then
|
if [ -z "$crossConfig" ]; then
|
||||||
# Not cross-compiling - both buildInputs (and variants like propagatedBuildInputs)
|
# Not cross-compiling - both buildInputs (and variants like propagatedBuildInputs)
|
||||||
# are handled identically to nativeBuildInputs
|
# are handled identically to nativeBuildInputs
|
||||||
declare -ga nativePkgs
|
declare -a nativePkgs
|
||||||
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
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
declare -ga crossPkgs
|
declare -a crossPkgs
|
||||||
for i in $buildInputs $defaultBuildInputs $propagatedBuildInputs; do
|
for i in $buildInputs $defaultBuildInputs $propagatedBuildInputs; do
|
||||||
findInputs "$i" crossPkgs propagated-build-inputs
|
findInputs "$i" crossPkgs propagated-build-inputs
|
||||||
done
|
done
|
||||||
|
|
||||||
declare -ga nativePkgs
|
declare -a nativePkgs
|
||||||
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
|
||||||
|
Loading…
Reference in New Issue
Block a user