Skip to content

Commit

Permalink
haskellPackages.postgresql-libpq: Use pkg-config instead of pg_config…
Browse files Browse the repository at this point in the history
… 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.
  • Loading branch information
wolfgangwalther authored and sternenseemann committed Feb 8, 2024
1 parent 1e13dff commit 16209df
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkgs/development/haskell-modules/configuration-nix.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit 16209df

Please sign in to comment.