about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorAdam Joseph <adam@westernsemico.com>2022-08-22 18:07:47 -0700
committerAdam Joseph <54836058+amjoseph-nixpkgs@users.noreply.github.com>2023-11-02 09:23:38 +0000
commit6d2aa33a17681a30777cb53411bd8243ac765555 (patch)
tree8342e4033f0a842c0d7f51e4194b1a57d678499c /pkgs
parent1f4f9b9d20d66cc0c67fc9cf47d2b6a970c7bbbb (diff)
liblogging: add withSystemd option
This allows to build liblogging on platforms where systemd does not
compile.
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/libraries/liblogging/default.nix7
1 files changed, 4 insertions, 3 deletions
diff --git a/pkgs/development/libraries/liblogging/default.nix b/pkgs/development/libraries/liblogging/default.nix
index df27688e10524..2623e65f68b05 100644
--- a/pkgs/development/libraries/liblogging/default.nix
+++ b/pkgs/development/libraries/liblogging/default.nix
@@ -1,5 +1,6 @@
 { lib, stdenv, fetchurl, pkg-config
-, systemd ? null
+, withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd
+, systemd
 }:
 
 stdenv.mkDerivation rec {
@@ -12,12 +13,12 @@ stdenv.mkDerivation rec {
   };
 
   nativeBuildInputs = [ pkg-config ];
-  buildInputs = [ systemd ];
+  buildInputs = lib.optionals withSystemd [ systemd ];
 
   configureFlags = [
     "--enable-rfc3195"
     "--enable-stdlog"
-    (if systemd != null then "--enable-journal" else "--disable-journal")
+    (if withSystemd then "--enable-journal" else "--disable-journal")
     "--enable-man-pages"
   ];