git.iko.soy/typeable/nixpkgs
on master help sign in
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.

commit943baed7885c0fd7e841a0c1594ea044bb21e77f authorNiklas Hambüchen <mail@nh2.me> dateSun 21 Jul 2019, 21:13 (7 years ago) parentcaa0f82
1 file changed+5−2
pkgs/servers/sql/postgresql/default.nix+5−2
pkgs/servers/sql/postgresql/default.nix+5−2
@@ -6,6 +6,9 @@ let
66 , glibc, zlib, readline, openssl, icu, systemd, libossp_uuid
77 , pkgconfig, libxml2, tzdata
88
9+ # This is important to obtain a version of `libpq` that does not depend on systemd.
10+ , enableSystemd ? (lib.versionAtLeast "9.6" version && !stdenv.isDarwin)
11+
912 # for postgreql.pkgs
1013 , this, self, newScope, buildEnv
1114
@@ -31,7 +34,7 @@ let
3134 buildInputs =
3235 [ zlib readline openssl libxml2 makeWrapper ]
3336 ++ lib.optionals icuEnabled [ icu ]
34− ++ lib.optionals (atLeast "9.6" && !stdenv.isDarwin) [ systemd ]
37+ ++ lib.optionals enableSystemd [ systemd ]
3538 ++ lib.optionals (!stdenv.isDarwin) [ libossp_uuid ];
3639
3740 nativeBuildInputs = lib.optionals icuEnabled [ pkgconfig ];
@@ -51,7 +54,7 @@ let
5154 "--sysconfdir=/etc"
5255 "--libdir=$(lib)/lib"
5356 "--with-system-tzdata=${tzdata}/share/zoneinfo"
54− (lib.optionalString (atLeast "9.6" && !stdenv.isDarwin) "--with-systemd")
57+ (lib.optionalString enableSystemd "--with-systemd")
5558 (if stdenv.isDarwin then "--with-uuid=e2fs" else "--with-ossp-uuid")
5659 ] ++ lib.optionals icuEnabled [ "--with-icu" ];
5760