1{
2 lib,
3 stdenv,
4 fetchurl,
5 pkg-config,
6 withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd,
7 systemd,
8}:
9
10stdenv.mkDerivation rec {
11 pname = "liblogging";
12 version = "1.0.6";
13
14 src = fetchurl {
15 url = "http://download.rsyslog.com/liblogging/liblogging-${version}.tar.gz";
16 sha256 = "14xz00mq07qmcgprlj5b2r21ljgpa4sbwmpr6jm2wrf8wms6331k";
17 };
18
19 nativeBuildInputs = [ pkg-config ];
20 buildInputs = lib.optionals withSystemd [ systemd ];
21
22 configureFlags = [
23 "--enable-rfc3195"
24 "--enable-stdlog"
25 (if withSystemd then "--enable-journal" else "--disable-journal")
26 "--enable-man-pages"
27 ];
28
29 env.NIX_CFLAGS_COMPILE = "-Wno-error=implicit-int -Wno-error=implicit-function-declaration";
30
31 meta = with lib; {
32 homepage = "http://www.liblogging.org/";
33 description = "Lightweight signal-safe logging library";
34 mainProgram = "stdlogctl";
35 license = licenses.bsd2;
36 platforms = platforms.all;
37 };
38}