nixpkgs/pkgs/by-name/gu/gummy/package.nix

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

84 lines
1.8 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
, 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
, 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 = [
(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; };
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;
maintainers = [ ];
2022-03-14 21:25:07 +00:00
};
2024-09-17 01:32:56 +00:00
})