From 7b01b810a65df2ffd0dc8e13d6347fbc816c84df Mon Sep 17 00:00:00 2001 From: Lin Xianyi Date: Tue, 22 Oct 2024 18:20:47 +0800 Subject: [PATCH] sdbus-cpp_2: init at 2.0.0 --- .../libraries/sdbus-cpp/default.nix | 108 ++++++++++-------- pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 64 insertions(+), 46 deletions(-) diff --git a/pkgs/development/libraries/sdbus-cpp/default.nix b/pkgs/development/libraries/sdbus-cpp/default.nix index 16e9b4772659..94f56bd914f4 100644 --- a/pkgs/development/libraries/sdbus-cpp/default.nix +++ b/pkgs/development/libraries/sdbus-cpp/default.nix @@ -1,53 +1,71 @@ -{ lib -, stdenv -, fetchFromGitHub -, cmake -, expat -, pkg-config -, systemd +{ + lib, + stdenv, + fetchFromGitHub, + cmake, + expat, + pkg-config, + systemdLibs, }: +let + generic = + { + version, + rev ? "v${version}", + hash, + }: + stdenv.mkDerivation (finalAttrs: { + pname = "sdbus-cpp"; + inherit version; -stdenv.mkDerivation rec { - pname = "sdbus-cpp"; - version = "1.5.0"; + src = fetchFromGitHub { + owner = "kistler-group"; + repo = "sdbus-cpp"; + inherit rev hash; + }; - src = fetchFromGitHub { - owner = "kistler-group"; - repo = "sdbus-cpp"; - rev = "v${version}"; + nativeBuildInputs = [ + cmake + pkg-config + ]; + + buildInputs = [ + expat + systemdLibs + ]; + + cmakeFlags = [ + (lib.cmakeBool "BUILD_CODE_GEN" 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 = [ ]; + platforms = lib.platforms.linux; + mainProgram = "sdbus-c++-xml2cpp"; + }; + }); +in +{ + sdbus-cpp = generic { + version = "1.5.0"; hash = "sha256-oO8QNffwNI245AEPdutOGqxj4qyusZYK3bZWLh2Lcag="; }; - nativeBuildInputs = [ - cmake - pkg-config - ]; - - buildInputs = [ - expat - systemd - ]; - - cmakeFlags = [ - "-DBUILD_CODE_GEN=ON" - ]; - - 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 = [ ]; - platforms = lib.platforms.linux; - mainProgram = "sdbus-c++-xml2cpp"; + sdbus-cpp_2 = generic { + version = "2.0.0"; + hash = "sha256-W8V5FRhV3jtERMFrZ4gf30OpIQLYoj2yYGpnYOmH2+g="; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 982de17fe824..513ad808652a 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1906,7 +1906,7 @@ with pkgs; scarab = callPackage ../tools/games/scarab { }; - sdbus-cpp = callPackage ../development/libraries/sdbus-cpp { }; + inherit (callPackage ../development/libraries/sdbus-cpp { }) sdbus-cpp sdbus-cpp_2; sdlookup = callPackage ../tools/security/sdlookup { };