1 { lib, stdenv, fetchFromGitLab, qmake, wrapQtAppsHook, libusb1, hidapi, pkg-config, coreutils, mbedtls_2, qtbase, qttools, symlinkJoin, openrgb }:
3 stdenv.mkDerivation rec {
7 src = fetchFromGitLab {
8 owner = "CalcProgrammer1";
10 rev = "release_${version}";
11 sha256 = "sha256-XBLj4EfupyeVHRc0pVI7hrXFoCNJ7ak2yO0QSfhBsGU=";
14 nativeBuildInputs = [ qmake pkg-config wrapQtAppsHook ];
15 buildInputs = [ libusb1 hidapi mbedtls_2 qtbase qttools ];
18 patchShebangs scripts/build-udev-rules.sh
19 substituteInPlace scripts/build-udev-rules.sh \
20 --replace /bin/chmod "${coreutils}/bin/chmod"
23 doInstallCheck = true;
24 installCheckPhase = ''
25 HOME=$TMPDIR $out/bin/openrgb --help > /dev/null
28 passthru.withPlugins = plugins:
29 let pluginsDir = symlinkJoin {
30 name = "openrgb-plugins";
32 # Remove all library version symlinks except one,
33 # or they will result in duplicates in the UI.
34 # We leave the one pointing to the actual library, usually the most
35 # qualified one (eg. libOpenRGBHardwareSyncPlugin.so.1.0.0).
37 for f in $out/lib/*; do
38 if [ "$(dirname $(readlink "$f"))" == "." ]; then
44 in openrgb.overrideAttrs (old: {
45 qmakeFlags = old.qmakeFlags or [] ++ [
46 # Welcome to Escape Hell, we have backslashes
47 ''DEFINES+=OPENRGB_EXTRA_PLUGIN_DIRECTORY=\\\""${lib.escape ["\\" "\"" " "] (toString pluginsDir)}/lib\\\""''
52 description = "Open source RGB lighting control";
53 homepage = "https://gitlab.com/CalcProgrammer1/OpenRGB";
54 maintainers = with maintainers; [ jonringer ];
55 license = licenses.gpl2Plus;
56 platforms = platforms.linux;
57 mainProgram = "openrgb";