2022-03-14 22:25:07 +01:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
2022-04-20 16:40:48 +02:00
|
|
|
, testers
|
2022-03-14 22:25:07 +01:00
|
|
|
, gummy
|
|
|
|
, cmake
|
|
|
|
, libX11
|
|
|
|
, libXext
|
|
|
|
, sdbus-cpp
|
|
|
|
, udev
|
|
|
|
, coreutils
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "gummy";
|
2022-10-21 19:22:11 +02:00
|
|
|
version = "0.3";
|
2022-03-14 22:25:07 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "fushko";
|
|
|
|
repo = "gummy";
|
|
|
|
rev = version;
|
2022-10-21 19:22:11 +02:00
|
|
|
sha256 = "sha256-dw2yOXTS61OIe+NOq8MPydhkZvTit13eC7cbL5nFseg=";
|
2022-03-14 22:25:07 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
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
|
|
|
|
'';
|
|
|
|
|
2022-04-20 16:40:48 +02:00
|
|
|
passthru.tests.version = testers.testVersion { package = gummy; };
|
2022-03-14 22:25:07 +01:00
|
|
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|