haskellPackages.postgresql-libpq: Use pkg-config instead of pg_config to find libpq

During configure, postgresql-libpq's Setup.hs will try to execute pg_config to
find libpq. This will not work when cross-compiling, because pg_config was compiled
for the target system, but needs to run on the host.

The "use-pkg-config" flag allows to do this via pkg-config instead, which works
better in those cases.
This commit is contained in:
Wolfgang Walther 2024-02-04 21:52:35 +01:00 committed by sternenseemann
parent 1e13dfffc6
commit 16209df165

View File

@ -1379,4 +1379,12 @@ self: super: builtins.intersectAttrs super {
mpi-hs-cereal
mpi-hs-binary
;
postgresql-libpq = overrideCabal (drv: {
# Using use-pkg-config flag, because pg_config won't work when cross-compiling.
configureFlags = drv.configureFlags or [] ++ [ "-fuse-pkg-config" ];
# Move postgresql from SystemDepends to PkgconfigDepends
libraryPkgconfigDepends = drv.librarySystemDepends;
librarySystemDepends = [];
}) super.postgresql-libpq;
}