Skip to content

Commit

Permalink
rubyPackages.pg: use pkg-config instead of pg_config
Browse files Browse the repository at this point in the history
This change forces pg native extension to use pkg-config to locate libpq
instead of running pg_config. It also removes an unnecessary reference
to postgresql package since build flags are embedded in the output at
`$out/${ruby.gemPath}/build_info/*`.
  • Loading branch information
tie committed Jun 15, 2023
1 parent d4317fa commit 1a54459
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions pkgs/development/ruby-modules/gem-config/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -573,9 +573,14 @@ in
};

pg = attrs: {
buildFlags = [
"--with-pg-config=${postgresql}/bin/pg_config"
];
# Force pkg-config lookup for libpq.
# See https://github.com/ged/ruby-pg/blob/6629dec6656f7ca27619e4675b45225d9e422112/ext/extconf.rb#L34-L55
#
# Note that setting --with-pg-config=${postgresql}/bin/pg_config would add
# an unnecessary reference to the entire postgresql package.
buildFlags = [ "--with-pg-config=ignore" ];
nativeBuildInputs = [ pkg-config ];
buildInputs = [ postgresql ];
};

psych = attrs: {
Expand Down

0 comments on commit 1a54459

Please sign in to comment.