···1+{ lib, stdenv, fetchFromGitLab, qmake, wrapQtAppsHook, libusb1, hidapi, pkg-config, coreutils, mbedtls_2, qtbase, qttools, symlinkJoin, openrgb }:
23stdenv.mkDerivation rec {
4 pname = "openrgb";
···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+ });
5051 meta = with lib; {
52 description = "Open source RGB lighting control";
···19 };
2021 unpackCmd = ''
22+ tar -xf $curSrc contents.tar.gz CHECKSUM metadata.config
23 mkdir contents
24 tar -C contents -xzf contents.tar.gz
25+ mv metadata.config contents/hex_metadata.config
26+27+ # To make the extracted hex tarballs appear legitimate to mix, we need to
28+ # make sure they contain not just the contents of contents.tar.gz but also
29+ # a .hex file with some lock metadata.
30+ # We use an old version of .hex file per hex's mix_task_test.exs since it
31+ # is just plain-text instead of an encoded format.
32+ # See: https://github.com/hexpm/hex/blob/main/test/hex/mix_task_test.exs#L410
33+ echo -n "${pkg},${version},$(cat CHECKSUM | tr '[:upper:]' '[:lower:]'),hexpm" > contents/.hex
34 '';
3536 installPhase = ''
···1-{ lib, stdenv, fetchFromGitHub, cmake }:
23stdenv.mkDerivation rec {
4 pname = "platform-folders";
···16 cmakeFlags = [
17 "-DBUILD_SHARED_LIBS=${if stdenv.hostPlatform.isStatic then "OFF" else "ON"}"
18 ];
001920 meta = with lib; {
21 description = "A C++ library to look for standard platform directories so that you do not need to write platform-specific code";
···1+{ lib, stdenv, fetchFromGitHub, cmake, gitUpdater }:
23stdenv.mkDerivation rec {
4 pname = "platform-folders";
···16 cmakeFlags = [
17 "-DBUILD_SHARED_LIBS=${if stdenv.hostPlatform.isStatic then "OFF" else "ON"}"
18 ];
19+20+ passthru.updateScript = gitUpdater { };
2122 meta = with lib; {
23 description = "A C++ library to look for standard platform directories so that you do not need to write platform-specific code";