nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at netboot-syslinux-multiplatform 58 lines 1.9 kB view raw
1{ lib, stdenv, fetchFromGitLab, qmake, wrapQtAppsHook, libusb1, hidapi, pkg-config, coreutils, mbedtls_2, qtbase, qttools, symlinkJoin, openrgb }: 2 3stdenv.mkDerivation rec { 4 pname = "openrgb"; 5 version = "0.8"; 6 7 src = fetchFromGitLab { 8 owner = "CalcProgrammer1"; 9 repo = "OpenRGB"; 10 rev = "release_${version}"; 11 sha256 = "sha256-46dL1D5oVlw6mNuFDCbbrUDmq42yFXV/qFJ1JnPT5/s="; 12 }; 13 14 nativeBuildInputs = [ qmake pkg-config wrapQtAppsHook ]; 15 buildInputs = [ libusb1 hidapi mbedtls_2 qtbase qttools ]; 16 17 postPatch = '' 18 patchShebangs scripts/build-udev-rules.sh 19 substituteInPlace scripts/build-udev-rules.sh \ 20 --replace /bin/chmod "${coreutils}/bin/chmod" 21 ''; 22 23 doInstallCheck = true; 24 installCheckPhase = '' 25 HOME=$TMPDIR $out/bin/openrgb --help > /dev/null 26 ''; 27 28 passthru.withPlugins = plugins: 29 let pluginsDir = symlinkJoin { 30 name = "openrgb-plugins"; 31 paths = 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). 36 postBuild = '' 37 for f in $out/lib/*; do 38 if [ "$(dirname $(readlink "$f"))" == "." ]; then 39 rm "$f" 40 fi 41 done 42 ''; 43 }; 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\\\""'' 48 ]; 49 }); 50 51 meta = with 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 }; 58}