Skip to content

Commit

Permalink
Merge pull request #123415 from sternenseemann/fixed-pkg-config-wrapp…
Browse files Browse the repository at this point in the history
…er-mangling

pkg-config-wrapper: mangle PKG_CONFIG_PATH{,_FOR_BUILD} correctly
  • Loading branch information
Ericson2314 authored May 18, 2021
2 parents ac760b4 + b11d65c commit 50a475a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkgs/build-support/pkg-config-wrapper/add-flags.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 8 additions & 2 deletions pkgs/build-support/wrapper-common/utils.bash
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ accumulateRoles() {
fi
}

mangleVarList() {
mangleVarListGeneric() {
local sep="$1"
shift
local var="$1"
shift
local -a role_suffixes=("$@")
Expand All @@ -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
Expand Down

0 comments on commit 50a475a

Please sign in to comment.