Skip to content

Commit

Permalink
Merge pull request #9550 from haskell/mergify/bp/3.10/pr-9134
Browse files Browse the repository at this point in the history
Try each pkg-config query separatedly (backport #9134)
  • Loading branch information
mergify[bot] authored Dec 22, 2023
2 parents 5fefcf5 + 8af26e3 commit d09cd57
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
14 changes: 11 additions & 3 deletions Cabal/src/Distribution/Simple/Program/Builtin.hs
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,14 @@ cppProgram :: Program
cppProgram = simpleProgram "cpp"

pkgConfigProgram :: Program
pkgConfigProgram = (simpleProgram "pkg-config") {
programFindVersion = findProgramVersion "--version" id
}
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'}
}
8 changes: 8 additions & 0 deletions changelog.d/pkgconfig-envvars
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
synopsis: PkgConfig environment variables
prs: #9134

description: {

- `cabal` invokes `pkg-config` with `PKG_CONFIG_ALLOW_SYSTEM_CFLAGS` and `PKG_CONFIG_ALLOW_SYSTEM_LIBS` set

}

0 comments on commit d09cd57

Please sign in to comment.