Unverified Commit e8bb6bb8 authored by Matt Sturgeon's avatar Matt Sturgeon
Browse files

openrgb: 0.9 → 1.0rc2

- https://codeberg.org/OpenRGB/OpenRGB/releases/tag/release_candidate_1.0rc1
> Plugin API has been updated to API version 4 so until the official 1.0
> release, use the latest pipeline builds of the plugins.

- https://codeberg.org/OpenRGB/OpenRGB/releases/tag/release_candidate_1.0rc2


> There have been some upgrades to the user interface since 1.0rc1 and
> some additional device support and fixes.
> The plugin interface and SDK version remain the same as 1.0rc1, so
> plugins that worked with 1.0rc1 should work with 1.0rc2 as well.

As part of updating `withPlugins`, it has been re-implemented as a
wrapper derivation. This means the base package is not re-compiled when
it is used.

Co-authored-by: default avatarliberodark <liberodark@gmail.com>
Co-authored-by: default avatarMultipixelone <finn@cnwr.net>
parent 8181e8b7
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -97,6 +97,9 @@

- Added `dell-bios-fan-control` package and service.

- `openrgb` was updated to 1.0rc2, which now uses Plugin API version 4.
  Some existing OpenRGB plugins may be incompatible or require updates.

- We now use the upstream wrapper script for Gradle, supporting both the `JAVA_HOME` and `GRADLE_OPTS` environment variables.

## Nixpkgs Library {#sec-nixpkgs-release-26.05-lib}
+45 −30
Original line number Diff line number Diff line
@@ -2,10 +2,12 @@
  lib,
  stdenv,
  fetchFromGitLab,
  fetchpatch,
  libusb1,
  hidapi,
  pkg-config,
  coreutils,
  makeBinaryWrapper,
  mbedtls,
  symlinkJoin,
  qt6Packages,
@@ -13,17 +15,22 @@

stdenv.mkDerivation (finalAttrs: {
  pname = "openrgb";
  version = "0.9";
  version = "1.0rc2";

  src = fetchFromGitLab {
    owner = "CalcProgrammer1";
    repo = "OpenRGB";
    rev = "release_${finalAttrs.version}";
    hash = "sha256-XBLj4EfupyeVHRc0pVI7hrXFoCNJ7ak2yO0QSfhBsGU=";
    tag = "release_candidate_${finalAttrs.version}";
    hash = "sha256-vdIA9i1ewcrfX5U7FkcRR+ISdH5uRi9fz9YU5IkPKJQ=";
  };

  patches = [
    ./qlist-include.patch
    ./system-plugins-env.patch
    (fetchpatch {
      name = "Install-systemd-service-under-PREFIX.patch";
      url = "https://gitlab.com/CalcProgrammer1/OpenRGB/-/commit/b58b3c0402131918b3b988631f42617020df9346.patch";
      hash = "sha256-q5i5BNjaLbsXSYEXKQOR/cMm5ExckmW1n2r9H0j09T0=";
    })
  ];

  nativeBuildInputs = [
@@ -48,7 +55,12 @@ stdenv.mkDerivation (finalAttrs: {
  postPatch = ''
    patchShebangs scripts/build-udev-rules.sh
    substituteInPlace scripts/build-udev-rules.sh \
      --replace-fail /bin/chmod "${coreutils}/bin/chmod"
      --replace-fail '/usr/bin/env chmod' ${lib.getExe' coreutils "chmod"}
  '';

  postInstall = ''
    substituteInPlace "$out/lib/systemd/system/openrgb.service" \
      --replace-fail /usr/bin/openrgb "$out/bin/openrgb"
  '';

  doInstallCheck = true;
@@ -71,31 +83,34 @@ stdenv.mkDerivation (finalAttrs: {

  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).
    symlinkJoin {
      inherit (finalAttrs) version meta;
      pname = finalAttrs.pname + "-with-plugins";
      nativeBuildInputs = [ makeBinaryWrapper ];
      paths = [ finalAttrs.finalPackage ] ++ plugins;
      postBuild = ''
          for f in $out/lib/*; do
            if [ "$(dirname $(readlink "$f"))" == "." ]; then
              rm "$f"
        wrapProgram "$out/bin/openrgb" \
          --set OPENRGB_SYSTEM_PLUGIN_DIRECTORY "$out/lib/openrgb/plugins"

        # Update systemd service to use wrapped package
        service_file="$out/lib/systemd/system/openrgb.service"
        substitute "$service_file" openrgb.service \
          --replace-fail ${finalAttrs.finalPackage} "$out"
        mv --force openrgb.service "$service_file"

        # Check for unhandled references to the base package
        if grep \
            --dereference-recursive \
            --binary-files=without-match \
            --fixed-strings \
             ${finalAttrs.finalPackage} \
             "$out"
        then
          echo "ERROR: unexpected reference to base package"
          exit 1
        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";
+0 −16
Original line number Diff line number Diff line
Commit ID: 2fa7aa0ec87d9878293033db0e86bb62cddc47df
Change ID: mvrytuwvnokxyvmuworxptmtqpqpppxq
Author   : Marie Ramlow <me@nycode.dev> (2025-10-11 12:10:21)
Committer: Marie Ramlow <me@nycode.dev> (2025-10-11 12:17:20)

    OpenRGBFont: add QList include

diff --git a/qt/OpenRGBFont.cpp b/qt/OpenRGBFont.cpp
index 628bd35281..db1ab5fb76 100644
--- a/qt/OpenRGBFont.cpp
+++ b/qt/OpenRGBFont.cpp
@@ -1,3 +1,4 @@
+#include <QStringList>
 #include "OpenRGBFont.h"
 #include <QFontDatabase>
 
+23 −0
Original line number Diff line number Diff line
diff --git a/PluginManager.cpp b/PluginManager.cpp
index 157b6cd5..42d9b59d 100644
--- a/PluginManager.cpp
+++ b/PluginManager.cpp
@@ -59,6 +59,18 @@ void PluginManager::ScanAndLoadPlugins()
     filesystem::path plugins_dir = ResourceManager::get()->GetConfigurationDirectory() / plugins_path;
     ScanAndLoadPluginsFrom(plugins_dir, false);
 
+    /*---------------------------------------------------------*\
+    | Get the system plugins directory from the environment     |
+    |                                                           |
+    | Allow setting a system plugin directory during runtime,   |
+    | e.g. by Nixpkgs' `withPlugins` wrapper.                   |
+    \*---------------------------------------------------------*/
+    const char* system_plugins_dir = std::getenv("OPENRGB_SYSTEM_PLUGIN_DIRECTORY");
+    if(system_plugins_dir && *system_plugins_dir)
+    {
+        ScanAndLoadPluginsFrom(system_plugins_dir, true);
+    }
+
 #ifdef OPENRGB_SYSTEM_PLUGIN_DIRECTORY
     /*---------------------------------------------------------*\
     | Get the system plugins directory                          |