on iko/ghcjs-patch-master help sign in
nixpkgs 20.09 pkg-config has a prefix (#874)
ab2f5a9Hamish Mackenzie
builder/comp-builder.nix+6−1
@@ -91,12 +91,17 @@ let
91 "$(cat ${configFiles}/configure-flags)"
91 "$(cat ${configFiles}/configure-flags)"
92 ] ++ commonConfigureFlags);
92 ] ++ commonConfigureFlags);
93
93
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+
94 commonConfigureFlags = ([
97 commonConfigureFlags = ([
95 # GHC
98 # GHC
96 "--with-ghc=${ghc.targetPrefix}ghc"
99 "--with-ghc=${ghc.targetPrefix}ghc"
97 "--with-ghc-pkg=${ghc.targetPrefix}ghc-pkg"
100 "--with-ghc-pkg=${ghc.targetPrefix}ghc-pkg"
98 "--with-hsc2hs=${ghc.targetPrefix}hsc2hs"
101 "--with-hsc2hs=${ghc.targetPrefix}hsc2hs"
102+ ] ++ lib.optional (pkgConfigHasPrefix && pkgconfig != [])
103+ "--with-pkg-config=${ghc.targetPrefix}pkg-config"
99− ] ++ lib.optionals (stdenv.hasCC or (stdenv.cc != null))
104+ ++ lib.optionals (stdenv.hasCC or (stdenv.cc != null))
100 ( # CC
105 ( # CC
101 [ "--with-gcc=${stdenv.cc.targetPrefix}cc"
106 [ "--with-gcc=${stdenv.cc.targetPrefix}cc"
102 ] ++
107 ] ++