1{ stdenv
2, lib
3, fetchFromGitHub
4, cmake
5, orcania
6, systemd
7, check
8, subunit
9, withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd
10}:
11
12stdenv.mkDerivation rec {
13 pname = "yder";
14 version = "1.4.19";
15
16 src = fetchFromGitHub {
17 owner = "babelouest";
18 repo = pname;
19 rev = "v${version}";
20 sha256 = "sha256-KP79i1yYJ6jrsdtS85fHOmJV+oAL/MNgc9On4RfOTwo=";
21 };
22
23 patches = [
24 # We set CMAKE_INSTALL_LIBDIR to the absolute path in $out, so
25 # prefix and exec_prefix cannot be $out, too
26 ./fix-pkgconfig.patch
27 ];
28
29 nativeBuildInputs = [ cmake ];
30
31 buildInputs = [ orcania ]
32 ++ lib.optional withSystemd systemd;
33
34 nativeCheckInputs = [ check subunit ];
35
36 cmakeFlags = [
37 "-DBUILD_YDER_TESTING=on"
38 ] ++ lib.optional (!withSystemd) "-DWITH_JOURNALD=off";
39
40 doCheck = true;
41
42 meta = with lib; {
43 description = "Logging library for C applications";
44 homepage = "https://github.com/babelouest/yder";
45 license = licenses.lgpl21;
46 maintainers = with maintainers; [ johnazoidberg ];
47 platforms = platforms.all;
48 };
49}