2022-03-14 21:25:07 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2024-04-21 14:13:38 +00:00
|
|
|
, fetchFromGitea
|
2022-04-20 14:40:48 +00:00
|
|
|
, testers
|
2022-03-14 21:25:07 +00:00
|
|
|
, 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
|
2024-10-22 11:39:05 +00:00
|
|
|
, nix-update-script
|
2022-03-14 21:25:07 +00:00
|
|
|
}:
|
|
|
|
|
2024-09-17 01:32:56 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2022-03-14 21:25:07 +00:00
|
|
|
pname = "gummy";
|
2024-10-22 11:40:36 +00:00
|
|
|
version = "0.6.1";
|
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";
|
2024-09-17 01:32:56 +00:00
|
|
|
rev = finalAttrs.version;
|
2024-10-22 11:40:36 +00:00
|
|
|
hash = "sha256-ic+kTBoirMX6g79NdNoeFbNNo1LYg/z+nlt/GAB6UyQ=";
|
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 = [
|
2024-10-22 11:39:05 +00:00
|
|
|
(lib.mapAttrsToList lib.cmakeFeature {
|
|
|
|
"UDEV_DIR" = "${placeholder "out"}/lib/udev";
|
|
|
|
"UDEV_RULES_DIR" = "${placeholder "out"}/lib/udev/rules.d";
|
|
|
|
})
|
2023-10-18 15:26:25 +00:00
|
|
|
];
|
|
|
|
|
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
|
|
|
|
'';
|
|
|
|
|
2024-09-17 01:32:56 +00:00
|
|
|
passthru.tests.version = testers.testVersion { package = finalAttrs.finalPackage; };
|
2024-10-22 11:39:05 +00:00
|
|
|
passthru.updateScript = nix-update-script { };
|
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-07-28 14:44:11 +00:00
|
|
|
maintainers = [ ];
|
2022-03-14 21:25:07 +00:00
|
|
|
};
|
2024-09-17 01:32:56 +00:00
|
|
|
})
|