1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-21 13:10:33 +00:00
nixpkgs/pkgs/applications/misc/openrgb/default.nix
Stefan Frijters 25e46dda3d openrgb: Fix udev rules with hardcoded /bin/chmod
New rules introduced in openrgb 0.6.

openrgb: Implement nixpkgs-review suggestions

* warning: missing-phase-hooks
* warning: unclear-gpl
* warning: unnecessary-parallel-building
2021-06-05 08:19:58 -07:00

45 lines
1.1 KiB
Nix

{ lib, mkDerivation, fetchFromGitLab, qmake, libusb1, hidapi, pkg-config, coreutils }:
mkDerivation rec {
pname = "openrgb";
version = "0.6";
src = fetchFromGitLab {
owner = "CalcProgrammer1";
repo = "OpenRGB";
rev = "release_${version}";
sha256 = "sha256-x/wGD39Jm/kmcTEZP3BnLXxyv/jkPOJd6mLCO0dp5wM=";
};
nativeBuildInputs = [ qmake pkg-config ];
buildInputs = [ libusb1 hidapi ];
installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp openrgb $out/bin
substituteInPlace 60-openrgb.rules \
--replace /bin/chmod "${coreutils}/bin/chmod"
mkdir -p $out/etc/udev/rules.d
cp 60-openrgb.rules $out/etc/udev/rules.d
runHook postInstall
'';
doInstallCheck = true;
installCheckPhase = ''
HOME=$TMPDIR $out/bin/openrgb --help > /dev/null
'';
meta = with lib; {
description = "Open source RGB lighting control";
homepage = "https://gitlab.com/CalcProgrammer1/OpenRGB";
maintainers = with maintainers; [ jonringer ];
license = licenses.gpl2Plus;
platforms = platforms.linux;
};
}