summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorWill Dietz <github@wdtz.org>2018-10-05 23:15:44 -0500
committerGitHub <noreply@github.com>2018-10-05 23:15:44 -0500
commit003c20e02cff0430873b3a10d1cac57116b8b27e (patch)
tree28b9a4c706cea9cbfd2fe68d66d4bb53f9573002 /pkgs
parentbd3c84030150ad874cfc1bcdf7b0e6dfd096f7f6 (diff)
parent7180706a66c205fd503bc8b8df378de39a8eb56d (diff)
downloadnixpkgs-003c20e02cff0430873b3a10d1cac57116b8b27e.tar
nixpkgs-003c20e02cff0430873b3a10d1cac57116b8b27e.tar.gz
nixpkgs-003c20e02cff0430873b3a10d1cac57116b8b27e.tar.bz2
nixpkgs-003c20e02cff0430873b3a10d1cac57116b8b27e.tar.lz
nixpkgs-003c20e02cff0430873b3a10d1cac57116b8b27e.tar.xz
nixpkgs-003c20e02cff0430873b3a10d1cac57116b8b27e.tar.zst
nixpkgs-003c20e02cff0430873b3a10d1cac57116b8b27e.zip
Merge pull request #47554 from dtzWill/update/light-1.2
light: 1.1.2 -> 1.2, use new udev support instead of setuid wrapper.
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/os-specific/linux/light/default.nix21
1 files changed, 13 insertions, 8 deletions
diff --git a/pkgs/os-specific/linux/light/default.nix b/pkgs/os-specific/linux/light/default.nix
index d500019c50b..1856c8861cc 100644
--- a/pkgs/os-specific/linux/light/default.nix
+++ b/pkgs/os-specific/linux/light/default.nix
@@ -1,26 +1,31 @@
-{ stdenv, fetchFromGitHub, help2man }:
+{ stdenv, fetchFromGitHub, autoreconfHook, coreutils }:
 
 stdenv.mkDerivation rec {
-  version = "1.1.2";
+  version = "1.2";
   name = "light-${version}";
   src = fetchFromGitHub {
     owner = "haikarainen";
     repo = "light";
-    rev = version;
-    sha256 = "0c934gxav9cgdf94li6dp0rfqmpday9d33vdn9xb2mfp4war9n4w";
+    rev = "v${version}";
+    sha256 = "1h286va0r1xgxlnxfaaarrj3qhxmjjsivfn3khwm0wq1mhkfihra";
   };
 
-  buildInputs = [ help2man ];
+  configureFlags = [ "--with-udev" ];
 
-  installPhase = "mkdir -p $out/bin; cp light $out/bin/";
+  nativeBuildInputs = [ autoreconfHook ];
 
-  preFixup = "make man; mkdir -p $out/man/man1; mv light.1.gz $out/man/man1";
+  # 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'
+  '';
 
   meta = {
     description = "GNU/Linux application to control backlights";
     homepage = https://haikarainen.github.io/light/;
     license = stdenv.lib.licenses.gpl3;
-    maintainers = with stdenv.lib.maintainers; [ puffnfresh ];
+    maintainers = with stdenv.lib.maintainers; [ puffnfresh dtzWill ];
     platforms = stdenv.lib.platforms.linux;
   };
 }