summaryrefslogtreecommitdiff
path: root/pkgs/development/libraries/sdbus-cpp/default.nix
blob: 5c1bb3a1e9ebbc456fca2d8d0048843dd05da6af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
{
  lib,
  stdenv,
  fetchFromGitHub,
  cmake,
  expat,
  pkg-config,
  systemdLibs,
}:
let
  generic =
    {
      version,
      rev ? "v${version}",
      hash,
    }:
    stdenv.mkDerivation (finalAttrs: {
      pname = "sdbus-cpp";
      inherit version;

      src = fetchFromGitHub {
        owner = "kistler-group";
        repo = "sdbus-cpp";
        inherit rev hash;
      };

      nativeBuildInputs = [
        cmake
        pkg-config
      ];

      buildInputs = [
        expat
        systemdLibs
      ];

      cmakeFlags = [
        (lib.cmakeBool (
          if lib.versionOlder finalAttrs.version "2.0.0" then "BUILD_CODE_GEN" else "SDBUSCPP_BUILD_CODEGEN"
        ) true)
      ];

      meta = {
        homepage = "https://github.com/Kistler-Group/sdbus-cpp";
        changelog = "https://github.com/Kistler-Group/sdbus-cpp/blob/v${version}/ChangeLog";
        description = "High-level C++ D-Bus library designed to provide easy-to-use yet powerful API";
        longDescription = ''
          sdbus-c++ is a high-level C++ D-Bus library for Linux designed to provide
          expressive, easy-to-use API in modern C++.
          It adds another layer of abstraction on top of sd-bus, a nice, fresh C
          D-Bus implementation by systemd.
          It's been written primarily as a replacement of dbus-c++, which currently
          suffers from a number of (unresolved) bugs, concurrency issues and
          inherent design complexities and limitations.
        '';
        license = lib.licenses.lgpl2Only;
        maintainers = with lib.maintainers; [ etwas ];
        platforms = lib.platforms.linux;
        mainProgram = "sdbus-c++-xml2cpp";
      };
    });
in
{
  sdbus-cpp = generic {
    version = "1.5.0";
    hash = "sha256-oO8QNffwNI245AEPdutOGqxj4qyusZYK3bZWLh2Lcag=";
  };

  sdbus-cpp_2 = generic {
    version = "2.2.1";
    hash = "sha256-uC31StWk3qATPyshX7MkwrxEcBASeIv4e5/jtgzZzMQ=";
  };
}