Files
nixpkgs/pkgs/by-name/op/openrgb/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

97 lines
2.1 KiB
Nix

{
lib,
stdenv,
fetchFromGitLab,
libsForQt5,
libusb1,
hidapi,
pkg-config,
coreutils,
mbedtls_2,
symlinkJoin,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "openrgb";
version = "0.9";
src = fetchFromGitLab {
owner = "CalcProgrammer1";
repo = "OpenRGB";
rev = "release_${finalAttrs.version}";
hash = "sha256-XBLj4EfupyeVHRc0pVI7hrXFoCNJ7ak2yO0QSfhBsGU=";
};
nativeBuildInputs = [
pkg-config
]
++ (with libsForQt5; [
qmake
wrapQtAppsHook
]);
buildInputs = [
libusb1
hidapi
mbedtls_2
]
++ (with libsForQt5; [
qtbase
qttools
qtwayland
]);
postPatch = ''
patchShebangs scripts/build-udev-rules.sh
substituteInPlace scripts/build-udev-rules.sh \
--replace-fail /bin/chmod "${coreutils}/bin/chmod"
'';
doInstallCheck = true;
installCheckPhase = ''
runHook preInstallCheck
HOME=$TMPDIR $out/bin/openrgb --help > /dev/null
runHook postInstallCheck
'';
passthru.withPlugins =
plugins:
let
pluginsDir = symlinkJoin {
name = "openrgb-plugins";
paths = plugins;
# Remove all library version symlinks except one,
# or they will result in duplicates in the UI.
# We leave the one pointing to the actual library, usually the most
# qualified one (eg. libOpenRGBHardwareSyncPlugin.so.1.0.0).
postBuild = ''
for f in $out/lib/*; do
if [ "$(dirname $(readlink "$f"))" == "." ]; then
rm "$f"
fi
done
'';
};
in
finalAttrs.finalPackage.overrideAttrs (old: {
qmakeFlags = old.qmakeFlags or [ ] ++ [
# Welcome to Escape Hell, we have backslashes
''DEFINES+=OPENRGB_EXTRA_PLUGIN_DIRECTORY=\\\""${
lib.escape [ "\\" "\"" " " ] (toString pluginsDir)
}/lib\\\""''
];
});
meta = {
description = "Open source RGB lighting control";
homepage = "https://gitlab.com/CalcProgrammer1/OpenRGB";
maintainers = with lib.maintainers; [ johnrtitor ];
license = lib.licenses.gpl2Plus;
platforms = lib.platforms.linux;
mainProgram = "openrgb";
};
})