diff --git a/pkgs/build-support/setup-hooks/make-wrapper.sh b/pkgs/build-support/setup-hooks/make-wrapper.sh index 7d0f88abb855..d3db0b64bd53 100644 --- a/pkgs/build-support/setup-hooks/make-wrapper.sh +++ b/pkgs/build-support/setup-hooks/make-wrapper.sh @@ -16,7 +16,7 @@ makeWrapper() { varName=${params[$((n + 1))]} value=${params[$((n + 2))]} n=$((n + 2)) - echo "export $varName=$value" >> $wrapper + echo "export $varName='$value'" >> $wrapper fi if test "$p" = "--unset"; then diff --git a/pkgs/development/python-modules/generic/wrap.sh b/pkgs/development/python-modules/generic/wrap.sh index a67ea51f5a9b..efbb1e737876 100644 --- a/pkgs/development/python-modules/generic/wrap.sh +++ b/pkgs/development/python-modules/generic/wrap.sh @@ -46,16 +46,15 @@ wrapPythonProgramsIn() { # wrapProgram creates the executable shell script described # above. The script will set PYTHONPATH and PATH variables.! # (see pkgs/build-support/setup-hooks/make-wrapper.sh) - local wrap_args="$f \ - --prefix PYTHONPATH ':' $program_PYTHONPATH \ - --prefix PATH ':' $program_PATH:$dir/bin" + local -a wrap_args=("$f" + --prefix PYTHONPATH ':' "$program_PYTHONPATH" + --prefix PATH ':' "$program_PATH:$dir/bin") # Add any additional arguments provided by makeWrapperArgs # argument to buildPythonPackage. - for arg in $makeWrapperArgs; do - wrap_args="$wrap_args $arg" - done - wrapProgram $wrap_args + local -a user_args="($makeWrapperArgs)" + local -a wrapProgramArgs=("${wrap_args[@]}" "${user_args[@]}") + wrapProgram "${wrapProgramArgs[@]}" fi fi done