From 0410194b4d5db32b2f5197a8f7435b45fedc3a88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20=C5=BDlender?= Date: Sat, 27 May 2023 19:41:02 +0200 Subject: [PATCH] libpq: init at 16.1 --- pkgs/servers/sql/postgresql/libpq.nix | 61 +++++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 63 insertions(+) create mode 100644 pkgs/servers/sql/postgresql/libpq.nix diff --git a/pkgs/servers/sql/postgresql/libpq.nix b/pkgs/servers/sql/postgresql/libpq.nix new file mode 100644 index 0000000000000..8ad569eb0dc4f --- /dev/null +++ b/pkgs/servers/sql/postgresql/libpq.nix @@ -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; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index dcf4e5aa4bf7a..207fcb29fa2c7 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -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