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
|
accumulateRoles
|
||||||
|
|
||||||
for var in "${var_templates_list[@]}"; do
|
for var in "${var_templates_list[@]}"; do
|
||||||
mangleVarList "$var" ${role_suffixes[@]+"${role_suffixes[@]}"}
|
mangleVarListGeneric ":" "$var" ${role_suffixes[@]+"${role_suffixes[@]}"}
|
||||||
done
|
done
|
||||||
|
|
||||||
export NIX_PKG_CONFIG_WRAPPER_FLAGS_SET_@suffixSalt@=1
|
export NIX_PKG_CONFIG_WRAPPER_FLAGS_SET_@suffixSalt@=1
|
||||||
|
@ -13,7 +13,9 @@ accumulateRoles() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
mangleVarList() {
|
mangleVarListGeneric() {
|
||||||
|
local sep="$1"
|
||||||
|
shift
|
||||||
local var="$1"
|
local var="$1"
|
||||||
shift
|
shift
|
||||||
local -a role_suffixes=("$@")
|
local -a role_suffixes=("$@")
|
||||||
@ -25,11 +27,15 @@ mangleVarList() {
|
|||||||
for suffix in "${role_suffixes[@]}"; do
|
for suffix in "${role_suffixes[@]}"; do
|
||||||
local inputVar="${var}${suffix}"
|
local inputVar="${var}${suffix}"
|
||||||
if [ -v "$inputVar" ]; then
|
if [ -v "$inputVar" ]; then
|
||||||
export ${outputVar}+="${!outputVar:+ }${!inputVar}"
|
export ${outputVar}+="${!outputVar:+$sep}${!inputVar}"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mangleVarList() {
|
||||||
|
mangleVarListGeneric " " "$@"
|
||||||
|
}
|
||||||
|
|
||||||
mangleVarBool() {
|
mangleVarBool() {
|
||||||
local var="$1"
|
local var="$1"
|
||||||
shift
|
shift
|
||||||
|
Loading…
Reference in New Issue
Block a user