Skip to content

Commit

Permalink
postgresql: Make systemd support configurable. See #61580. (#61581)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
nh2 authored and danbst committed Jul 21, 2019
1 parent caa0f82 commit 943baed
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pkgs/servers/sql/postgresql/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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 ];
Expand All @@ -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" ];

Expand Down

0 comments on commit 943baed

Please sign in to comment.