postgresql_15: build with support for zstd compression

This commit is contained in:
timothy 2022-11-23 12:45:51 +07:00
parent 878cb61054
commit 621bb272a1

View file

@ -3,7 +3,7 @@ let
generic = generic =
# dependencies # dependencies
{ stdenv, lib, fetchurl, makeWrapper { stdenv, lib, fetchurl, makeWrapper
, glibc, zlib, readline, openssl, icu, lz4, systemd, libossp_uuid , glibc, zlib, readline, openssl, icu, lz4, zstd, systemd, libossp_uuid
, pkg-config, libxml2, tzdata, libkrb5 , pkg-config, libxml2, tzdata, libkrb5
# This is important to obtain a version of `libpq` that does not depend on systemd. # This is important to obtain a version of `libpq` that does not depend on systemd.
@ -22,6 +22,7 @@ let
let let
atLeast = lib.versionAtLeast version; atLeast = lib.versionAtLeast version;
lz4Enabled = atLeast "14"; lz4Enabled = atLeast "14";
zstdEnabled = atLeast "15";
in stdenv.mkDerivation rec { in stdenv.mkDerivation rec {
pname = "postgresql"; pname = "postgresql";
@ -45,6 +46,7 @@ let
icu icu
] ]
++ lib.optionals lz4Enabled [ lz4 ] ++ lib.optionals lz4Enabled [ lz4 ]
++ lib.optionals zstdEnabled [ zstd ]
++ lib.optionals enableSystemd [ systemd ] ++ lib.optionals enableSystemd [ systemd ]
++ lib.optionals gssSupport [ libkrb5 ] ++ lib.optionals gssSupport [ libkrb5 ]
++ lib.optionals (!stdenv.isDarwin) [ libossp_uuid ]; ++ lib.optionals (!stdenv.isDarwin) [ libossp_uuid ];
@ -76,6 +78,7 @@ let
(lib.optionalString enableSystemd "--with-systemd") (lib.optionalString enableSystemd "--with-systemd")
(if stdenv.isDarwin then "--with-uuid=e2fs" else "--with-ossp-uuid") (if stdenv.isDarwin then "--with-uuid=e2fs" else "--with-ossp-uuid")
] ++ lib.optionals lz4Enabled [ "--with-lz4" ] ] ++ lib.optionals lz4Enabled [ "--with-lz4" ]
++ lib.optionals zstdEnabled [ "--with-zstd" ]
++ lib.optionals gssSupport [ "--with-gssapi" ] ++ lib.optionals gssSupport [ "--with-gssapi" ]
++ lib.optionals stdenv.hostPlatform.isRiscV [ "--disable-spinlocks" ]; ++ lib.optionals stdenv.hostPlatform.isRiscV [ "--disable-spinlocks" ];