nixpkgs/pkgs/tools/misc/gummy/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

82 lines
1.7 KiB
Nix
Raw Normal View History

2022-03-14 21:25:07 +00:00
{ lib
, stdenv
2024-04-21 14:13:38 +00:00
, fetchFromGitea
2023-10-18 15:26:25 +00:00
, substituteAll
, testers
2022-03-14 21:25:07 +00:00
, gummy
, cmake
, libX11
, libXext
, sdbus-cpp
, udev
2023-10-18 15:26:25 +00:00
, xcbutilimage
2022-03-14 21:25:07 +00:00
, coreutils
2023-10-18 15:26:25 +00:00
, cli11
, ddcutil
, fmt
, nlohmann_json
, spdlog
2022-03-14 21:25:07 +00:00
}:
stdenv.mkDerivation rec {
pname = "gummy";
2024-04-21 14:13:38 +00:00
version = "0.6.0";
2022-03-14 21:25:07 +00:00
2024-04-21 14:13:38 +00:00
src = fetchFromGitea {
domain = "codeberg.org";
owner = "fusco";
2022-03-14 21:25:07 +00:00
repo = "gummy";
rev = version;
2024-04-21 14:13:38 +00:00
hash = "sha256-kATieFf+dEpcYgSEPoETacP7R+u2dOrg7rOhIkNQ1uE=";
2022-03-14 21:25:07 +00:00
};
nativeBuildInputs = [
cmake
];
buildInputs = [
2023-10-18 15:26:25 +00:00
cli11
ddcutil
fmt
2022-03-14 21:25:07 +00:00
libX11
libXext
2023-10-18 15:26:25 +00:00
nlohmann_json
2022-03-14 21:25:07 +00:00
sdbus-cpp
2023-10-18 15:26:25 +00:00
spdlog
2022-03-14 21:25:07 +00:00
udev
2023-10-18 15:26:25 +00:00
xcbutilimage
2022-03-14 21:25:07 +00:00
];
cmakeFlags = [
"-DUDEV_DIR=${placeholder "out"}/lib/udev"
2023-10-18 15:26:25 +00:00
"-DUDEV_RULES_DIR=${placeholder "out"}/lib/udev/rules.d"
];
2022-03-14 21:25:07 +00:00
# Fixes the "gummy start" command, without this it cannot find the binary.
# Setting this through cmake does not seem to work.
postPatch = ''
2024-04-21 14:13:38 +00:00
substituteInPlace gummyd/gummyd/api.cpp \
2022-03-14 21:25:07 +00:00
--replace "CMAKE_INSTALL_DAEMON_PATH" "\"${placeholder "out"}/libexec/gummyd\""
'';
preFixup = ''
2023-10-18 15:26:25 +00:00
substituteInPlace $out/lib/udev/rules.d/99-gummy.rules \
2022-03-14 21:25:07 +00:00
--replace "/bin/chmod" "${coreutils}/bin/chmod"
ln -s $out/libexec/gummyd $out/bin/gummyd
'';
passthru.tests.version = testers.testVersion { package = gummy; };
2022-03-14 21:25:07 +00:00
meta = with lib; {
2024-04-21 14:13:38 +00:00
homepage = "https://codeberg.org/fusco/gummy";
2022-03-14 21:25:07 +00:00
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;
2024-06-24 21:05:06 +00:00
maintainers = with maintainers; [ ];
2022-03-14 21:25:07 +00:00
};
}