about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorSandro <sandro.jaeckel@gmail.com>2022-03-28 17:02:25 +0200
committerGitHub <noreply@github.com>2022-03-28 17:02:25 +0200
commita85e2dcf73631c500f61ee06cf27009c05d23f4d (patch)
treef06339f2cea0dbce26edc5c32a5f6cb180c462cf /pkgs
parent7dc94c53067b0e21a4c2fdb4d91387efae8436c4 (diff)
parentadf885ca00c87beded0c4697b5818710d5cd485f (diff)
downloadnixlib-a85e2dcf73631c500f61ee06cf27009c05d23f4d.tar
nixlib-a85e2dcf73631c500f61ee06cf27009c05d23f4d.tar.gz
nixlib-a85e2dcf73631c500f61ee06cf27009c05d23f4d.tar.bz2
nixlib-a85e2dcf73631c500f61ee06cf27009c05d23f4d.tar.lz
nixlib-a85e2dcf73631c500f61ee06cf27009c05d23f4d.tar.xz
nixlib-a85e2dcf73631c500f61ee06cf27009c05d23f4d.tar.zst
nixlib-a85e2dcf73631c500f61ee06cf27009c05d23f4d.zip
Merge pull request #164182 from IvarWithoutBones/init/gummy
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/libraries/sdbus-cpp/default.nix50
-rw-r--r--pkgs/tools/misc/gummy/default.nix66
-rw-r--r--pkgs/top-level/all-packages.nix4
3 files changed, 120 insertions, 0 deletions
diff --git a/pkgs/development/libraries/sdbus-cpp/default.nix b/pkgs/development/libraries/sdbus-cpp/default.nix
new file mode 100644
index 000000000000..d665a6d94a5a
--- /dev/null
+++ b/pkgs/development/libraries/sdbus-cpp/default.nix
@@ -0,0 +1,50 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, cmake
+, pkg-config
+, systemd
+, expat
+}:
+
+stdenv.mkDerivation rec {
+  pname = "sdbus-cpp";
+  version = "1.1.0";
+
+  src = fetchFromGitHub {
+    owner = "kistler-group";
+    repo = "sdbus-cpp";
+    rev = "v${version}";
+    sha256 = "sha256-AjaZ6YmMlnN0jAcUBkft01XHkrze0nSr3dUMechsLrQ=";
+  };
+
+  nativeBuildInputs = [
+    cmake
+    pkg-config
+  ];
+
+  buildInputs = [
+    systemd
+    expat
+  ];
+
+  cmakeFlags = [
+    "-DBUILD_CODE_GEN=ON"
+  ];
+
+  meta = with lib; {
+    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.
+    '';
+    mainProgram = "sdbus-c++-xml2cpp";
+    license = licenses.lgpl2Only;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.ivar ];
+  };
+}
diff --git a/pkgs/tools/misc/gummy/default.nix b/pkgs/tools/misc/gummy/default.nix
new file mode 100644
index 000000000000..f7950650f7fc
--- /dev/null
+++ b/pkgs/tools/misc/gummy/default.nix
@@ -0,0 +1,66 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, testVersion
+, gummy
+, cmake
+, libX11
+, libXext
+, sdbus-cpp
+, udev
+, coreutils
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gummy";
+  version = "0.1";
+
+  src = fetchFromGitHub {
+    owner = "fushko";
+    repo = "gummy";
+    rev = version;
+    sha256 = "sha256-CbZFuvFMmbFVX8k3duhhsg0fd9kVmhsj0VeFYil9YiE=";
+  };
+
+  nativeBuildInputs = [
+    cmake
+  ];
+
+  buildInputs = [
+    libX11
+    libXext
+    sdbus-cpp
+    udev
+  ];
+
+  cmakeFlags = [
+    "-DUDEV_DIR=${placeholder "out"}/lib/udev"
+  ];
+
+  # Fixes the "gummy start" command, without this it cannot find the binary.
+  # Setting this through cmake does not seem to work.
+  postPatch = ''
+    substituteInPlace src/gummy/gummy.cpp \
+      --replace "CMAKE_INSTALL_DAEMON_PATH" "\"${placeholder "out"}/libexec/gummyd\""
+  '';
+
+  preFixup = ''
+    substituteInPlace $out/lib/udev/99-gummy.rules \
+      --replace "/bin/chmod" "${coreutils}/bin/chmod"
+
+    ln -s $out/libexec/gummyd $out/bin/gummyd
+  '';
+
+  passthru.tests.version = testVersion { package = gummy; };
+
+  meta = with lib; {
+    homepage = "https://github.com/Fushko/gummy";
+    description = "Brightness and temperature manager for X11";
+    longDescription = ''
+      CLI screen manager for X11 that allows automatic and manual brightness/temperature adjustments,
+      via backlight (currently only for embedded displays) and gamma. Multiple monitors are supported.
+    '';
+    license = licenses.gpl3Only;
+    maintainers = [ maintainers.ivar ];
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index c80d94ca2508..ad9eae28faa5 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -1119,6 +1119,8 @@ with pkgs;
 
   redfang = callPackage ../tools/networking/redfang { };
 
+  sdbus-cpp = callPackage ../development/libraries/sdbus-cpp { };
+
   sdlookup = callPackage ../tools/security/sdlookup { };
 
   sx-go = callPackage ../tools/security/sx-go { };
@@ -33492,6 +33494,8 @@ with pkgs;
 
   gummi = callPackage ../applications/misc/gummi { };
 
+  gummy = callPackage ../tools/misc/gummy { };
+
   gxemul = callPackage ../applications/emulators/gxemul { };
 
   hatari = callPackage ../applications/emulators/hatari { };