pkg-config: prepend added flags

The go toolchain calls pkg-config using "--" to separate flags and
packages. For example:

pkg-config --cflags -- zlib

This breaks if addFlags are appended. This commit therefore prepends the
addFlags to the command.
This commit is contained in:
Alok Parlikar 2022-12-22 11:29:24 +00:00
parent b7886b068b
commit 272bb3dfa6

View File

@ -12,7 +12,7 @@ if [ -z "${NIX_PKG_CONFIG_WRAPPER_FLAGS_SET_@suffixSalt@:-}" ]; then
source @out@/nix-support/add-flags.sh
fi
set -- "$@" @addFlags@
set -- @addFlags@ "$@"
if (( ${#role_suffixes[@]} > 0 )); then
# replace env var with nix-modified one