Merge pull request #124149 from sternenseemann/pkg-config-mangling-21.05
[21.05] pkg-config-wrapper: mangle PKG_CONFIG_PATH{,_FOR_BUILD} correctly
This commit is contained in:
commit
62f3f8954c
|
@ -6,7 +6,7 @@ var_templates_list=(
|
|||
accumulateRoles
|
||||
|
||||
for var in "${var_templates_list[@]}"; do
|
||||
mangleVarList "$var" ${role_suffixes[@]+"${role_suffixes[@]}"}
|
||||
mangleVarListGeneric ":" "$var" ${role_suffixes[@]+"${role_suffixes[@]}"}
|
||||
done
|
||||
|
||||
export NIX_PKG_CONFIG_WRAPPER_FLAGS_SET_@suffixSalt@=1
|
||||
|
|
|
@ -13,7 +13,9 @@ accumulateRoles() {
|
|||
fi
|
||||
}
|
||||
|
||||
mangleVarList() {
|
||||
mangleVarListGeneric() {
|
||||
local sep="$1"
|
||||
shift
|
||||
local var="$1"
|
||||
shift
|
||||
local -a role_suffixes=("$@")
|
||||
|
@ -25,11 +27,15 @@ mangleVarList() {
|
|||
for suffix in "${role_suffixes[@]}"; do
|
||||
local inputVar="${var}${suffix}"
|
||||
if [ -v "$inputVar" ]; then
|
||||
export ${outputVar}+="${!outputVar:+ }${!inputVar}"
|
||||
export ${outputVar}+="${!outputVar:+$sep}${!inputVar}"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
mangleVarList() {
|
||||
mangleVarListGeneric " " "$@"
|
||||
}
|
||||
|
||||
mangleVarBool() {
|
||||
local var="$1"
|
||||
shift
|
||||
|
|
Loading…
Reference in New Issue