Skip to content

Commit

Permalink
libpq: init at 16.1
Browse files Browse the repository at this point in the history
  • Loading branch information
szlend committed Dec 23, 2023
1 parent 7a5ef2e commit 0410194
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 0 deletions.
61 changes: 61 additions & 0 deletions pkgs/servers/sql/postgresql/libpq.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{ stdenv
, lib
, openssl
, zlib
, libkrb5
, icu
, postgresql
, pkg-config
, tzdata
, gssSupport ? !stdenv.hostPlatform.isWindows
}:

stdenv.mkDerivation {
pname = "libpq";
inherit (postgresql) src version;

configureFlags = [
"--with-openssl"
"--with-icu"
"--without-readline"
"--with-system-tzdata=${tzdata}/share/zoneinfo"
"--enable-debug"
]
++ lib.optionals gssSupport [ "--with-gssapi" ];

nativeBuildInputs = [ pkg-config tzdata ];
buildInputs = [ openssl zlib icu ]
++ lib.optional gssSupport libkrb5;

enableParallelBuilding = !stdenv.isDarwin;

separateDebugInfo = true;

buildFlags = [ "submake-libpq" "submake-libpgport" ];

installPhase = ''
runHook preInstall
make -C src/bin/pg_config install
make -C src/common install
make -C src/include install
make -C src/interfaces/libpq install
make -C src/port install
moveToOutput "bin" "$dev"
moveToOutput "lib/*.a" "$static"
rm -rfv $out/share
runHook postInstall
'';

outputs = [ "out" "dev" "static" ];

meta = with lib; {
homepage = "https://www.postgresql.org";
description = "Client API library for PostgreSQL";
license = licenses.postgresql;
maintainers = with maintainers; [ szlend ];
platforms = platforms.unix;
};
}
2 changes: 2 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27123,6 +27123,8 @@ with pkgs;

timescaledb-tune = callPackage ../development/tools/database/timescaledb-tune { };

libpq = callPackage ../servers/sql/postgresql/libpq.nix { postgresql = postgresql_16; };

inherit (import ../servers/sql/postgresql pkgs)
postgresql_12
postgresql_13
Expand Down

0 comments on commit 0410194

Please sign in to comment.