on iko/ghcjs-patch-master help sign in
nixpkgs 20.09 pkg-config has a prefix (#874)

From nixpkgs 20.09, the pkg-config exe has a prefix matching the ghc one

commitab2f5a9b6d8cb1b18810194d9f4a6208710c358c authorHamish Mackenzie <Hamish.Mackenzie@iohk.io> dateMon 12 Oct 2020, 23:41 (6 years ago) parent53ed0a9
1 file changed+6−1
builder/comp-builder.nix+6−1
builder/comp-builder.nix+6−1
@@ -91,12 +91,17 @@ let
9191 "$(cat ${configFiles}/configure-flags)"
9292 ] ++ commonConfigureFlags);
9393
94+ # From nixpkgs 20.09, the pkg-config exe has a prefix matching the ghc one
95+ pkgConfigHasPrefix = builtins.compareVersions lib.nixpkgsVersion "20.09pre" >= 0;
96+
9497 commonConfigureFlags = ([
9598 # GHC
9699 "--with-ghc=${ghc.targetPrefix}ghc"
97100 "--with-ghc-pkg=${ghc.targetPrefix}ghc-pkg"
98101 "--with-hsc2hs=${ghc.targetPrefix}hsc2hs"
99− ] ++ lib.optionals (stdenv.hasCC or (stdenv.cc != null))
102+ ] ++ lib.optional (pkgConfigHasPrefix && pkgconfig != [])
103+ "--with-pkg-config=${ghc.targetPrefix}pkg-config"
104+ ++ lib.optionals (stdenv.hasCC or (stdenv.cc != null))
100105 ( # CC
101106 [ "--with-gcc=${stdenv.cc.targetPrefix}cc"
102107 ] ++