haskellPackages.mkDerivation: fix pkg-config cross

When cross compiling the pkg-config binary is prefixed and cabal
needs to be made aware of this.

Note: the `--with-pkg-config` flag can't be added unconditionally
because if the package doesn't need pkg-config (thus pkg-config
is not in the PATH) cabal consider this a hard failure.
This commit is contained in:
rnhmjoj 2022-04-01 09:14:19 +02:00
parent e5622af8b6
commit f649fb8b4a
No known key found for this signature in database
GPG Key ID: BFBAF4C975F76450

View File

@ -181,7 +181,8 @@ let
] ++ optionals (!isHaLVM) [
"--hsc2hs-option=--cross-compile"
(optionalString enableHsc2hsViaAsm "--hsc2hs-option=--via-asm")
];
] ++ optional (allPkgconfigDepends != [])
"--with-pkg-config=${pkg-config.targetPrefix}pkg-config";
parallelBuildingFlags = "-j$NIX_BUILD_CORES" + optionalString stdenv.isLinux " +RTS -A64M -RTS";