summary refs log tree commit diff
path: root/pkgs/servers/sql/postgresql
diff options
context:
space:
mode:
authorNiklas Hambüchen <mail@nh2.me>2019-07-21 21:13:06 +0200
committerDanylo Hlynskyi <abcz2.uprola@gmail.com>2019-07-21 22:13:06 +0300
commit943baed7885c0fd7e841a0c1594ea044bb21e77f (patch)
treecf556aec480ecf72004570163cfa516b12ac98cb /pkgs/servers/sql/postgresql
parentcaa0f82bf8a0bf7712c9c004be45380ce6e78dd3 (diff)
downloadnixpkgs-943baed7885c0fd7e841a0c1594ea044bb21e77f.tar
nixpkgs-943baed7885c0fd7e841a0c1594ea044bb21e77f.tar.gz
nixpkgs-943baed7885c0fd7e841a0c1594ea044bb21e77f.tar.bz2
nixpkgs-943baed7885c0fd7e841a0c1594ea044bb21e77f.tar.lz
nixpkgs-943baed7885c0fd7e841a0c1594ea044bb21e77f.tar.xz
nixpkgs-943baed7885c0fd7e841a0c1594ea044bb21e77f.tar.zst
nixpkgs-943baed7885c0fd7e841a0c1594ea044bb21e77f.zip
postgresql: Make systemd support configurable. See #61580. (#61581)
On by default, as was before.

The systemd dependency means that all libraries or applications using only libpq
will also pull systemd into their closures.

Further, no application or library using libpq can be built against musl, as
systemd relies on glibc-only features and thus does not build with musl.

With it being configurable, packages that need only the library can at
least turn it off to reduce their closure size.
Diffstat (limited to 'pkgs/servers/sql/postgresql')
-rw-r--r--pkgs/servers/sql/postgresql/default.nix7
1 files changed, 5 insertions, 2 deletions
diff --git a/pkgs/servers/sql/postgresql/default.nix b/pkgs/servers/sql/postgresql/default.nix
index 774ed62a11a..6e2c928837c 100644
--- a/pkgs/servers/sql/postgresql/default.nix
+++ b/pkgs/servers/sql/postgresql/default.nix
@@ -6,6 +6,9 @@ let
       , glibc, zlib, readline, openssl, icu, systemd, libossp_uuid
       , pkgconfig, libxml2, tzdata
 
+      # This is important to obtain a version of `libpq` that does not depend on systemd.
+      , enableSystemd ? (lib.versionAtLeast "9.6" version && !stdenv.isDarwin)
+
       # for postgreql.pkgs
       , this, self, newScope, buildEnv
 
@@ -31,7 +34,7 @@ let
     buildInputs =
       [ zlib readline openssl libxml2 makeWrapper ]
       ++ lib.optionals icuEnabled [ icu ]
-      ++ lib.optionals (atLeast "9.6" && !stdenv.isDarwin) [ systemd ]
+      ++ lib.optionals enableSystemd [ systemd ]
       ++ lib.optionals (!stdenv.isDarwin) [ libossp_uuid ];
 
     nativeBuildInputs = lib.optionals icuEnabled [ pkgconfig ];
@@ -51,7 +54,7 @@ let
       "--sysconfdir=/etc"
       "--libdir=$(lib)/lib"
       "--with-system-tzdata=${tzdata}/share/zoneinfo"
-      (lib.optionalString (atLeast "9.6" && !stdenv.isDarwin) "--with-systemd")
+      (lib.optionalString enableSystemd "--with-systemd")
       (if stdenv.isDarwin then "--with-uuid=e2fs" else "--with-ossp-uuid")
     ] ++ lib.optionals icuEnabled [ "--with-icu" ];