vuls: init at 0.27.0 (#348530)
[NixPkgs.git] / pkgs / build-support / pkg-config-wrapper / setup-hook.sh
blob34f1a999a82ee636e5865f323e965c8a4357a0bf
1 # pkg-config Wrapper hygiene
3 # See comments in cc-wrapper's setup hook. This works exactly the same way.
5 # Skip setup hook if we're neither a build-time dep, nor, temporarily, doing a
6 # native compile.
8 # TODO(@Ericson2314): No native exception
9 [[ -z ${strictDeps-} ]] || (( "$hostOffset" < 0 )) || return 0
11 pkgConfigWrapper_addPkgConfigPath () {
12 # See ../setup-hooks/role.bash
13 local role_post
14 getHostRoleEnvHook
16 addToSearchPath "PKG_CONFIG_PATH${role_post}" "$1/lib/pkgconfig"
17 addToSearchPath "PKG_CONFIG_PATH${role_post}" "$1/share/pkgconfig"
20 # See ../setup-hooks/role.bash
21 getTargetRole
22 getTargetRoleWrapper
24 addEnvHooks "$targetOffset" pkgConfigWrapper_addPkgConfigPath
26 export PKG_CONFIG${role_post}=@targetPrefix@@baseBinName@
28 # No local scope in sourced file
29 unset -v role_post