about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorSefa Eyeoglu <contact@scrumplex.net>2024-03-25 12:09:30 +0100
committerGitHub <noreply@github.com>2024-03-25 12:09:30 +0100
commit411f1f7b4a2820e9fe64d28bdf6217867aed4f25 (patch)
treee27450040f946a6078c46364ed8822d18488e138 /pkgs
parent8621265c46da02ad812a17fe382316fc360750bb (diff)
qtstyleplugin-kvantum: 1.0.10 -> 1.1.0 (#297048)
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/libraries/qtstyleplugin-kvantum/default.nix41
-rw-r--r--pkgs/top-level/qt5-packages.nix4
-rw-r--r--pkgs/top-level/qt6-packages.nix4
3 files changed, 28 insertions, 21 deletions
diff --git a/pkgs/development/libraries/qtstyleplugin-kvantum/default.nix b/pkgs/development/libraries/qtstyleplugin-kvantum/default.nix
index 64f3b81edde98..63e02e98ff747 100644
--- a/pkgs/development/libraries/qtstyleplugin-kvantum/default.nix
+++ b/pkgs/development/libraries/qtstyleplugin-kvantum/default.nix
@@ -2,6 +2,7 @@
 , stdenv
 , fetchFromGitHub
 , fetchpatch
+, cmake
 , qmake
 , qtbase
 , qtsvg
@@ -14,23 +15,24 @@
 , wrapQtAppsHook
 , gitUpdater
 
-, qt5Kvantum ? null
+, qt6Kvantum ? null
 }:
 let
-  isQt6 = lib.versionAtLeast qtbase.version "6";
+  isQt5 = lib.versionOlder qtbase.version "6";
 in
-stdenv.mkDerivation rec {
-  pname = "qtstyleplugin-kvantum${lib.optionalString isQt6 "6"}";
-  version = "1.0.10";
+stdenv.mkDerivation (finalAttrs: {
+  pname = "qtstyleplugin-kvantum${lib.optionalString isQt5 "5"}";
+  version = "1.1.0";
 
   src = fetchFromGitHub {
     owner = "tsujan";
     repo = "Kvantum";
-    rev = "V${version}";
-    sha256 = "48Blio8qHLmXSKG0c1tphXSfiwQXs0Xqwxe187nM3Ro=";
+    rev = "V${finalAttrs.version}";
+    hash = "sha256-i+QjVPSzWNPVQmQkB+u/3Wrvqqoz5OIjRdyZKXzxZh4=";
   };
 
   nativeBuildInputs = [
+    cmake
     qmake
     qttools
     wrapQtAppsHook
@@ -41,10 +43,11 @@ stdenv.mkDerivation rec {
     qtsvg
     libX11
     libXext
-  ] ++ lib.optionals (!isQt6) [ qtx11extras kwindowsystem ]
-    ++ lib.optional isQt6 qtwayland;
+    kwindowsystem
+  ] ++ lib.optionals isQt5 [ qtx11extras ]
+    ++ lib.optionals (!isQt5) [ qtwayland ];
 
-  sourceRoot = "${src.name}/Kvantum";
+  sourceRoot = "${finalAttrs.src.name}/Kvantum";
 
   patches = [
     (fetchpatch {
@@ -56,15 +59,19 @@ stdenv.mkDerivation rec {
   ];
 
   postPatch = ''
-    # Fix plugin dir
-    substituteInPlace style/style.pro \
-      --replace "\$\$[QT_INSTALL_PLUGINS]" "$out/$qtPluginPrefix"
+    substituteInPlace style/CMakeLists.txt \
+      --replace-fail '"''${_Qt6_PLUGIN_INSTALL_DIR}/' "\"$out/$qtPluginPrefix/" \
+      --replace-fail '"''${_Qt5_PLUGIN_INSTALL_DIR}/' "\"$out/$qtPluginPrefix/"
   '';
 
-  postInstall = lib.optionalString isQt6 ''
-    # make default Kvantum themes available for Qt 6 apps
+  cmakeFlags = [
+    (lib.cmakeBool "ENABLE_QT5" isQt5)
+  ];
+
+  postInstall = lib.optionalString isQt5 ''
+    # make default Kvantum themes available for Qt 5 apps
     mkdir -p "$out/share"
-    ln -s "${qt5Kvantum}/share/Kvantum" "$out/share/Kvantum"
+    ln -s "${qt6Kvantum}/share/Kvantum" "$out/share/Kvantum"
   '';
 
   passthru.updateScript = gitUpdater {
@@ -78,4 +85,4 @@ stdenv.mkDerivation rec {
     platforms = platforms.linux;
     maintainers = with maintainers; [ romildo Scrumplex ];
   };
-}
+})
diff --git a/pkgs/top-level/qt5-packages.nix b/pkgs/top-level/qt5-packages.nix
index 0cf6ab88c323b..7c861a3300320 100644
--- a/pkgs/top-level/qt5-packages.nix
+++ b/pkgs/top-level/qt5-packages.nix
@@ -251,7 +251,9 @@ in (noExtraAttrs (kdeFrameworks // plasmaMobileGear // plasma5 // plasma5.thirdP
 
   qtstyleplugins = callPackage ../development/libraries/qtstyleplugins { };
 
-  qtstyleplugin-kvantum = callPackage ../development/libraries/qtstyleplugin-kvantum { };
+  qtstyleplugin-kvantum = callPackage ../development/libraries/qtstyleplugin-kvantum {
+    qt6Kvantum = pkgs.qt6Packages.qtstyleplugin-kvantum;
+  };
 
   quazip = callPackage ../development/libraries/quazip { };
 
diff --git a/pkgs/top-level/qt6-packages.nix b/pkgs/top-level/qt6-packages.nix
index b7e6b00c2a34e..70e4212cfdc52 100644
--- a/pkgs/top-level/qt6-packages.nix
+++ b/pkgs/top-level/qt6-packages.nix
@@ -79,9 +79,7 @@ makeScopeWithSplicing' {
 
   qtpbfimageplugin = callPackage ../development/libraries/qtpbfimageplugin { };
 
-  qtstyleplugin-kvantum = callPackage ../development/libraries/qtstyleplugin-kvantum {
-    qt5Kvantum = pkgs.libsForQt5.qtstyleplugin-kvantum;
-  };
+  qtstyleplugin-kvantum = kdePackages.callPackage ../development/libraries/qtstyleplugin-kvantum { };
 
   qtutilities = callPackage ../development/libraries/qtutilities { };