Skip to content

Commit e9c8942

Browse files
authored
Fix #2365 missing pg_config (#2366)
* Fix #2365 missing pg_config The `pg_config` executable was moved into its own derivation in `nixpkgs`. This fix includes that derivation if present when the `pg` library is requested. * Add comment
1 parent 8215b63 commit e9c8942

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

lib/system-nixpkgs-map.nix

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ let
1717
lndir ${pkgs.buildPackages.gcc.cc} $out
1818
'')
1919
] else [];
20+
# In newer versions of nixpkgs `pg_config` has been moved to its own derivation.
21+
# Haskell libs that depend on the `pq` library (like `postgresql-libpq`)
22+
# are likely to require `pg_config` to be in the `PATH` as well.
23+
postgresqlLibs = [ postgresql ] ++ lib.optional (postgresql ? pg_config) postgresql.pg_config;
2024
in
2125
# -- linux
2226
{ crypto = [ openssl ];
@@ -57,10 +61,10 @@ in
5761
bz2 = [ bzip2 ];
5862
util = [ utillinux ];
5963
magic = [ file ];
60-
pgcommon = [ postgresql ];
61-
pgport = [ postgresql] ;
62-
pq = [ postgresql ];
63-
libpq = [ postgresql ];
64+
pgcommon = postgresqlLibs;
65+
pgport = postgresqlLibs;
66+
pq = postgresqlLibs;
67+
libpq = postgresqlLibs;
6468
iconv = [ libiconv ];
6569
lapack = [ liblapack ];
6670
boost_atomic = [ boost ];

0 commit comments

Comments
 (0)