diff options
author | Jan Tojnar <jtojnar@gmail.com> | 2019-12-23 17:16:16 +0100 |
---|---|---|
committer | Jan Tojnar <jtojnar@gmail.com> | 2019-12-23 18:02:44 +0100 |
commit | b0633406cb70e0e4ae3470a6b49e32b38d99ac16 (patch) | |
tree | ac02631c8aa44b2c32ddadec6e457b022426479a /pkgs/development/interpreters | |
parent | 2a81eceeba6d9b0499c0a9dc569921765321cdd0 (diff) | |
download | nixpkgs-b0633406cb70e0e4ae3470a6b49e32b38d99ac16.tar nixpkgs-b0633406cb70e0e4ae3470a6b49e32b38d99ac16.tar.gz nixpkgs-b0633406cb70e0e4ae3470a6b49e32b38d99ac16.tar.bz2 nixpkgs-b0633406cb70e0e4ae3470a6b49e32b38d99ac16.tar.lz nixpkgs-b0633406cb70e0e4ae3470a6b49e32b38d99ac16.tar.xz nixpkgs-b0633406cb70e0e4ae3470a6b49e32b38d99ac16.tar.zst nixpkgs-b0633406cb70e0e4ae3470a6b49e32b38d99ac16.zip |
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.
Diffstat (limited to 'pkgs/development/interpreters')
-rw-r--r-- | pkgs/development/interpreters/python/wrap.sh | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/pkgs/development/interpreters/python/wrap.sh b/pkgs/development/interpreters/python/wrap.sh index b2d65422db4..4def461c938 100644 --- a/pkgs/development/interpreters/python/wrap.sh +++ b/pkgs/development/interpreters/python/wrap.sh @@ -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 |