2022-05-17 09:12:24 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, fetchpatch, autoreconfHook, coreutils }:
|
2014-11-10 02:32:11 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2020-11-26 10:20:17 +00:00
|
|
|
version = "1.2.2";
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "light";
|
2018-08-07 22:56:39 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "haikarainen";
|
|
|
|
repo = "light";
|
2018-09-30 11:11:56 +00:00
|
|
|
rev = "v${version}";
|
2020-11-26 10:20:17 +00:00
|
|
|
sha256 = "1a70zcf88ifsnwll486aicjnh48zisdf8f7vi34ihw61kdadsq9s";
|
2014-11-10 02:32:11 +00:00
|
|
|
};
|
2018-08-07 22:56:39 +00:00
|
|
|
|
2022-05-17 09:12:24 +00:00
|
|
|
patches = [
|
|
|
|
# Pull upstream fix for -fno-common toolchains:
|
|
|
|
# https://github.com/haikarainen/light/pull/135
|
|
|
|
(fetchpatch {
|
|
|
|
name = "fno-common.patch";
|
|
|
|
url = "https://github.com/haikarainen/light/commit/eae912ca7ff3356805e47739114861d2b6ae7ec0.patch";
|
|
|
|
sha256 = "15jp8hm5scl0myiy1jmvd6m52lhx5jscvi3rgb5siwakmnkgzx9j";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2018-09-30 11:11:56 +00:00
|
|
|
configureFlags = [ "--with-udev" ];
|
2014-11-10 02:32:11 +00:00
|
|
|
|
2018-09-30 11:11:56 +00:00
|
|
|
nativeBuildInputs = [ autoreconfHook ];
|
2014-11-10 02:32:11 +00:00
|
|
|
|
2018-09-30 11:11:56 +00:00
|
|
|
# ensure udev rules can find the commands used
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace 90-backlight.rules \
|
|
|
|
--replace '/bin/chgrp' '${coreutils}/bin/chgrp' \
|
|
|
|
--replace '/bin/chmod' '${coreutils}/bin/chmod'
|
|
|
|
'';
|
2016-11-06 02:47:22 +00:00
|
|
|
|
2014-11-10 02:32:11 +00:00
|
|
|
meta = {
|
|
|
|
description = "GNU/Linux application to control backlights";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://haikarainen.github.io/light/";
|
2021-01-15 14:45:37 +00:00
|
|
|
license = lib.licenses.gpl3;
|
|
|
|
maintainers = with lib.maintainers; [ puffnfresh dtzWill ];
|
|
|
|
platforms = lib.platforms.linux;
|
2014-11-10 02:32:11 +00:00
|
|
|
};
|
|
|
|
}
|