2021-06-05 13:04:26 +02:00
|
|
|
{ lib, mkDerivation, fetchFromGitLab, qmake, libusb1, hidapi, pkg-config, coreutils }:
|
2020-06-17 23:38:28 +02:00
|
|
|
|
|
|
|
mkDerivation rec {
|
|
|
|
pname = "openrgb";
|
2021-06-01 18:18:17 +02:00
|
|
|
version = "0.6";
|
2020-06-17 23:38:28 +02:00
|
|
|
|
2020-12-07 18:11:07 +01:00
|
|
|
src = fetchFromGitLab {
|
2020-06-17 23:38:28 +02:00
|
|
|
owner = "CalcProgrammer1";
|
|
|
|
repo = "OpenRGB";
|
|
|
|
rev = "release_${version}";
|
2021-06-01 18:18:17 +02:00
|
|
|
sha256 = "sha256-x/wGD39Jm/kmcTEZP3BnLXxyv/jkPOJd6mLCO0dp5wM=";
|
2020-06-17 23:38:28 +02:00
|
|
|
};
|
|
|
|
|
2020-08-09 02:57:13 +02:00
|
|
|
nativeBuildInputs = [ qmake pkg-config ];
|
2020-06-17 23:38:28 +02:00
|
|
|
buildInputs = [ libusb1 hidapi ];
|
|
|
|
|
|
|
|
installPhase = ''
|
2021-06-05 13:04:26 +02:00
|
|
|
runHook preInstall
|
|
|
|
|
2020-06-17 23:38:28 +02:00
|
|
|
mkdir -p $out/bin
|
2020-12-07 18:11:07 +01:00
|
|
|
cp openrgb $out/bin
|
2020-12-07 18:13:42 +01:00
|
|
|
|
2021-06-05 13:04:26 +02:00
|
|
|
substituteInPlace 60-openrgb.rules \
|
|
|
|
--replace /bin/chmod "${coreutils}/bin/chmod"
|
|
|
|
|
2020-12-07 18:13:42 +01:00
|
|
|
mkdir -p $out/etc/udev/rules.d
|
|
|
|
cp 60-openrgb.rules $out/etc/udev/rules.d
|
2021-06-05 13:04:26 +02:00
|
|
|
|
|
|
|
runHook postInstall
|
2020-12-07 18:11:07 +01:00
|
|
|
'';
|
|
|
|
|
2020-06-17 23:38:28 +02:00
|
|
|
doInstallCheck = true;
|
|
|
|
installCheckPhase = ''
|
2020-12-07 18:11:07 +01:00
|
|
|
HOME=$TMPDIR $out/bin/openrgb --help > /dev/null
|
2020-06-17 23:38:28 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Open source RGB lighting control";
|
|
|
|
homepage = "https://gitlab.com/CalcProgrammer1/OpenRGB";
|
|
|
|
maintainers = with maintainers; [ jonringer ];
|
2021-06-05 13:04:26 +02:00
|
|
|
license = licenses.gpl2Plus;
|
2020-06-17 23:38:28 +02:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|