From e061b03531b176a4280004781083d761156ed15f Mon Sep 17 00:00:00 2001 From: Javier Sagredo Date: Mon, 18 Sep 2023 17:08:08 +0200 Subject: [PATCH] Set `PKG_CONFIG_ALLOW_SYSTEM_(CFLAGS|LIBS)` by default --- Cabal/src/Distribution/Simple/Program/Builtin.hs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Cabal/src/Distribution/Simple/Program/Builtin.hs b/Cabal/src/Distribution/Simple/Program/Builtin.hs index 1f3db0740f3..7ccc6393d86 100644 --- a/Cabal/src/Distribution/Simple/Program/Builtin.hs +++ b/Cabal/src/Distribution/Simple/Program/Builtin.hs @@ -400,4 +400,11 @@ pkgConfigProgram :: Program pkgConfigProgram = (simpleProgram "pkg-config") { programFindVersion = findProgramVersion "--version" id + , programPostConf = \_ pkgConfProg -> + let programOverrideEnv' = + programOverrideEnv pkgConfProg + ++ [ ("PKG_CONFIG_ALLOW_SYSTEM_CFLAGS", Just "1") + , ("PKG_CONFIG_ALLOW_SYSTEM_LIBS", Just "1") + ] + in pure $ pkgConfProg { programOverrideEnv = programOverrideEnv' } }