Unverified Commit 5c4383af authored by Masum Reza's avatar Masum Reza Committed by GitHub
Browse files

openrgb: bump mbedtls, build with Qt 6 (#450962)

parents 6b6d5165 82c85ef8
Loading
Loading
Loading
Loading
+17 −6
Original line number Diff line number Diff line
@@ -2,11 +2,12 @@
  lib,
  stdenv,
  fetchFromGitLab,
  libsForQt5,
  openrgb,
  glib,
  openal,
  pkg-config,
  kdePackages,
  fetchpatch,
}:

stdenv.mkDerivation (finalAttrs: {
@@ -21,20 +22,30 @@ stdenv.mkDerivation (finalAttrs: {
    fetchSubmodules = true;
  };

  patches = [
    # Fix Qt6 issues in OpenRGBPluginsFont.cpp
    (fetchpatch {
      url = "https://gitlab.com/OpenRGBDevelopers/OpenRGBEffectsPlugin/-/commit/e952b0ed390045d4f4adec8e74b3126c2f8abcab.patch";
      hash = "sha256-xMsnVyrn/Cv2x2xQtAnPb5HJc+WolNx4v7h0TkTj9DU=";
    })
    ./qt5compat.patch
  ];

  postPatch = ''
    # Use the source of openrgb from nixpkgs instead of the submodule
    rm -r OpenRGB
    ln -s ${openrgb.src} OpenRGB
  '';

  nativeBuildInputs = with libsForQt5; [
    qmake
  nativeBuildInputs = [
    pkg-config
    wrapQtAppsHook
    kdePackages.wrapQtAppsHook
    kdePackages.qmake
  ];

  buildInputs = with libsForQt5; [
    qtbase
  buildInputs = [
    kdePackages.qtbase
    kdePackages.qt5compat
    glib
    openal
  ];
+114 −0
Original line number Diff line number Diff line
Commit ID: 20f227f4ef942e2ead5a3a684248c2da48c979bc
Change ID: rwlwzspvylkypuqoornwzvuvpuzorvso
Author   : Alexey Sokolov <alexey+github@asokolov.org> (2025-07-21 22:34:37)
Committer: Marie Ramlow <me@nycode.dev> (2025-10-12 12:05:01)

    Fix build with Qt6 using core5compat

    Updated to add Qt5 backwards compatibility by Adam Honse <calcprogrammer1@gmail.com>

diff --git a/Effects/Ambient/RectangleSelector.cpp b/Effects/Ambient/RectangleSelector.cpp
index 8f28ddcbcc..d8b4f56a1d 100644
--- a/Effects/Ambient/RectangleSelector.cpp
+++ b/Effects/Ambient/RectangleSelector.cpp
@@ -1,6 +1,5 @@
 #include "RectangleSelector.h"
 #include <math.h>
-#include <QDesktopWidget>
 #include <QBrush>
 
 RectangleSelector::RectangleSelector(QWidget* parent)
@@ -57,7 +56,7 @@
 
     QPainter painter(this);
 
-    texture.setDevicePixelRatio(devicePixelRatioF() / qApp->desktop()->devicePixelRatioF());
+    texture.setDevicePixelRatio(devicePixelRatioF() / qApp->primaryScreen()->devicePixelRatio());
 
     painter.setPen(QColor(0, 0, 0, 128));
     painter.setBrush(Qt::NoBrush);
@@ -69,7 +68,7 @@
     for(QScreen *screen :  QApplication::screens())
     {
         QRect geometry = screen->geometry();
-        qreal ratio = screen->devicePixelRatio() / qApp->desktop()->devicePixelRatioF();
+        qreal ratio = screen->devicePixelRatio() / qApp->primaryScreen()->devicePixelRatio();
         QRect physical_geometry(geometry.x(), geometry.y(), std::lrint((qreal) geometry.width() * ratio), lrint((qreal) geometry.height() * ratio));
 
         if(physical_geometry.contains(rect.center()))
@@ -92,7 +91,7 @@
     for(QScreen *screen :  QApplication::screens())
     {
         QRect geometry = screen->geometry();
-        qreal ratio = screen->devicePixelRatio() / qApp->desktop()->devicePixelRatioF();
+        qreal ratio = screen->devicePixelRatio() / qApp->primaryScreen()->devicePixelRatio();
 
         screen_geometries.emplace_back(geometry.x(), geometry.y(),
                                        std::lrint((qreal) geometry.width() * ratio),
diff --git a/Effects/Shaders/GLSLHighlighter.h b/Effects/Shaders/GLSLHighlighter.h
index 7e9f21423b..ca9bf42c3c 100644
--- a/Effects/Shaders/GLSLHighlighter.h
+++ b/Effects/Shaders/GLSLHighlighter.h
@@ -2,6 +2,7 @@
 #define GLSLHIGHLIGHTER_H
 
 #include <QSyntaxHighlighter>
+#include <QRegExp>
 
 class GLSLHighlighter : public QSyntaxHighlighter
 {
diff --git a/OpenRGBEffectPage.cpp b/OpenRGBEffectPage.cpp
index 0d6e4ab0fb..4b756cf63c 100644
--- a/OpenRGBEffectPage.cpp
+++ b/OpenRGBEffectPage.cpp
@@ -38,7 +38,7 @@
     | Extra options and custom widgets                |
     \*-----------------------------------------------*/
     ui->ExtraOptions->addWidget(effect);
-    ui->ExtraOptions->setMargin(0);
+    ui->ExtraOptions->setContentsMargins(0, 0, 0, 0);
     effect->setParent(ui->extra_settings);
 
     InitUi();
diff --git a/OpenRGBEffectsPlugin.pro b/OpenRGBEffectsPlugin.pro
index 3e53316519..fec852f88c 100644
--- a/OpenRGBEffectsPlugin.pro
+++ b/OpenRGBEffectsPlugin.pro
@@ -1,4 +1,10 @@
-QT += gui widgets core
+QT += gui widgets core opengl
+
+if(greaterThan(QT_MAJOR_VERSION, 5)) {
+QT +=                                                                                           \
+    core5compat                                                                                 \
+}
+
 DEFINES += OPEN_RGB_EFFECTS_PLUGIN_LIBRARY
 TEMPLATE = lib
 
diff --git a/SaveProfilePopup.cpp b/SaveProfilePopup.cpp
index 7297dad8b7..4fa837235f 100644
--- a/SaveProfilePopup.cpp
+++ b/SaveProfilePopup.cpp
@@ -2,8 +2,8 @@
 #include "ui_SaveProfilePopup.h"
 #include "OpenRGBEffectSettings.h"
 
-#include <QRegExp>
-#include <QRegExpValidator>
+#include <QRegularExpression>
+#include <QRegularExpressionValidator>
 
 SaveProfilePopup::SaveProfilePopup(QWidget *parent) :
     QWidget(parent),
@@ -12,8 +12,8 @@
     ui->setupUi(this);
 
     // only letters or numbers, - _ and .
-    QRegExp re("^[\\w\\-_.]+$");
-    QRegExpValidator *validator = new QRegExpValidator(re, this);
+    QRegularExpression re("^[\\w\\-_.]+$");
+    QRegularExpressionValidator *validator = new QRegularExpressionValidator(re, this);
     ui->filename->setValidator(validator);
 
     std::vector<std::string> filenames = OpenRGBEffectSettings::ListProfiles();
+15 −6
Original line number Diff line number Diff line
@@ -2,12 +2,13 @@
  lib,
  stdenv,
  fetchFromGitLab,
  libsForQt5,
  openrgb,
  glib,
  libgtop,
  lm_sensors,
  pkg-config,
  kdePackages,
  fetchpatch,
}:

stdenv.mkDerivation (finalAttrs: {
@@ -21,6 +22,14 @@ stdenv.mkDerivation (finalAttrs: {
    hash = "sha256-3sQFiqmXhuavce/6v3XBpp6PAduY7t440nXfbfCX9a0=";
  };

  patches = [
    # Fix Qt 6 build
    (fetchpatch {
      url = "https://gitlab.com/OpenRGBDevelopers/OpenRGBHardwareSyncPlugin/-/commit/62707c260953fb5ac2bb782595c18791bf54ff97.patch";
      hash = "sha256-xMsnVyrn/Cv2x2xQtAnPb5HJc+WolNx4v7h0TkTj9DU=";
    })
  ];

  postPatch = ''
    # Use the source of openrgb from nixpkgs instead of the submodule
    rmdir OpenRGB
@@ -29,17 +38,17 @@ stdenv.mkDerivation (finalAttrs: {
    rm -r dependencies/lhwm-cpp-wrapper
  '';

  buildInputs = with libsForQt5; [
    qtbase
  buildInputs = [
    kdePackages.qtbase
    glib
    libgtop
    lm_sensors
  ];

  nativeBuildInputs = with libsForQt5; [
    qmake
  nativeBuildInputs = [
    pkg-config
    wrapQtAppsHook
    kdePackages.qmake
    kdePackages.wrapQtAppsHook
  ];

  meta = with lib; {
+13 −6
Original line number Diff line number Diff line
@@ -2,13 +2,13 @@
  lib,
  stdenv,
  fetchFromGitLab,
  libsForQt5,
  libusb1,
  hidapi,
  pkg-config,
  coreutils,
  mbedtls_2,
  mbedtls,
  symlinkJoin,
  kdePackages,
}:

stdenv.mkDerivation (finalAttrs: {
@@ -22,21 +22,24 @@ stdenv.mkDerivation (finalAttrs: {
    hash = "sha256-XBLj4EfupyeVHRc0pVI7hrXFoCNJ7ak2yO0QSfhBsGU=";
  };

  patches = [
    ./qlist-include.patch
  ];

  nativeBuildInputs = [
    pkg-config
  ]
  ++ (with libsForQt5; [
  ++ (with kdePackages; [
    qmake
    wrapQtAppsHook
  ]);

  buildInputs = [

    libusb1
    hidapi
    mbedtls_2
    mbedtls
  ]
  ++ (with libsForQt5; [
  ++ (with kdePackages; [
    qtbase
    qttools
    qtwayland
@@ -57,6 +60,10 @@ stdenv.mkDerivation (finalAttrs: {
    runHook postInstallCheck
  '';

  qmakeFlags = [
    "QT_TOOL.lrelease.binary=${lib.getDev kdePackages.qttools}/bin/lrelease"
  ];

  passthru.withPlugins =
    plugins:
    let
+16 −0
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>