python.pkgs.wrapPython: fix makeWrapperArgs

When `makeWrapperArgs` is a Bash array, we only passed the first
item to `wrapProgram`. We need to use `"${makeWrapperArgs[@]}"`
to extract all the items. But that breaks the common string case so
we need to handle that case separately.
This commit is contained in:
Jan Tojnar 2019-12-23 17:16:16 +01:00
parent 2a81eceeba
commit b0633406cb
No known key found for this signature in database
GPG Key ID: 7FAB2A15F7A607A4

View File

@ -78,7 +78,16 @@ wrapPythonProgramsIn() {
# Add any additional arguments provided by makeWrapperArgs
# argument to buildPythonPackage.
local -a user_args="($makeWrapperArgs)"
local -a user_args
# We need to support both the case when makeWrapperArgs
# is an array and a IFS-separated string.
# TODO: remove the string branch when __structuredAttrs are used.
if [[ "$(declare -p makeWrapperArgs)" =~ ^'declare -a makeWrapperArgs=' ]]; then
user_args=("${makeWrapperArgs[@]}")
else
user_args="($makeWrapperArgs)"
fi
local -a wrapProgramArgs=("${wrap_args[@]}" "${user_args[@]}")
wrapProgram "${wrapProgramArgs[@]}"
fi