summary refs log tree commit diff
path: root/pkgs/development/ruby-modules
diff options
context:
space:
mode:
authorIvan Trubach <mr.trubach@icloud.com>2023-06-15 05:50:06 +0300
committerIvan Trubach <mr.trubach@icloud.com>2023-06-15 06:30:00 +0300
commit1a54459c105754304f5036757b497011e9b8f7ec (patch)
tree838de67ebe5209f49735463efaa030439947849b /pkgs/development/ruby-modules
parentd4317fa9432de8961c65d2e95b3a598832daf8f3 (diff)
downloadnixpkgs-1a54459c105754304f5036757b497011e9b8f7ec.tar
nixpkgs-1a54459c105754304f5036757b497011e9b8f7ec.tar.gz
nixpkgs-1a54459c105754304f5036757b497011e9b8f7ec.tar.bz2
nixpkgs-1a54459c105754304f5036757b497011e9b8f7ec.tar.lz
nixpkgs-1a54459c105754304f5036757b497011e9b8f7ec.tar.xz
nixpkgs-1a54459c105754304f5036757b497011e9b8f7ec.tar.zst
nixpkgs-1a54459c105754304f5036757b497011e9b8f7ec.zip
rubyPackages.pg: use pkg-config instead of pg_config
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/*`.
Diffstat (limited to 'pkgs/development/ruby-modules')
-rw-r--r--pkgs/development/ruby-modules/gem-config/default.nix11
1 files changed, 8 insertions, 3 deletions
diff --git a/pkgs/development/ruby-modules/gem-config/default.nix b/pkgs/development/ruby-modules/gem-config/default.nix
index 22794da2516..a9eb1f96ab8 100644
--- a/pkgs/development/ruby-modules/gem-config/default.nix
+++ b/pkgs/development/ruby-modules/gem-config/default.nix
@@ -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: {