Add gnome theme for qt6

This commit is contained in:
linsui 2022-10-23 21:46:02 +08:00
parent 41bd3b658a
commit 16f0d689de
4 changed files with 47 additions and 8 deletions

View File

@ -12,7 +12,13 @@ let
isLxqt = cfg.platformTheme == "lxqt"; isLxqt = cfg.platformTheme == "lxqt";
isKde = cfg.platformTheme == "kde"; isKde = cfg.platformTheme == "kde";
packages = if isQGnome then [ pkgs.qgnomeplatform pkgs.adwaita-qt ] packages =
if isQGnome then [
pkgs.qgnomeplatform
pkgs.adwaita-qt
pkgs.qgnomeplatform-qt6
pkgs.adwaita-qt6
]
else if isQtStyle then [ pkgs.libsForQt5.qtstyleplugins ] else if isQtStyle then [ pkgs.libsForQt5.qtstyleplugins ]
else if isQt5ct then [ pkgs.libsForQt5.qt5ct ] else if isQt5ct then [ pkgs.libsForQt5.qt5ct ]
else if isLxqt then [ pkgs.lxqt.lxqt-qtplugin pkgs.lxqt.lxqt-config ] else if isLxqt then [ pkgs.lxqt.lxqt-qtplugin pkgs.lxqt.lxqt-config ]
@ -40,6 +46,7 @@ in
example = "gnome"; example = "gnome";
relatedPackages = [ relatedPackages = [
"qgnomeplatform" "qgnomeplatform"
"qgnomeplatform-qt6"
["libsForQt5" "qtstyleplugins"] ["libsForQt5" "qtstyleplugins"]
["libsForQt5" "qt5ct"] ["libsForQt5" "qt5ct"]
["lxqt" "lxqt-qtplugin"] ["lxqt" "lxqt-qtplugin"]
@ -71,6 +78,7 @@ in
example = "adwaita"; example = "adwaita";
relatedPackages = [ relatedPackages = [
"adwaita-qt" "adwaita-qt"
"adwaita-qt6"
["libsForQt5" "qtstyleplugins"] ["libsForQt5" "qtstyleplugins"]
]; ];
description = lib.mdDoc '' description = lib.mdDoc ''

View File

@ -1,16 +1,17 @@
{ mkDerivation { stdenv
, stdenv
, lib , lib
, fetchFromGitHub , fetchFromGitHub
, nix-update-script , nix-update-script
, cmake , cmake
, ninja , ninja
, qtbase , qtbase
, qtwayland
, qt5 , qt5
, xorg , xorg
, useQt6 ? false
}: }:
mkDerivation rec { stdenv.mkDerivation rec {
pname = "adwaita-qt"; pname = "adwaita-qt";
version = "1.4.1"; version = "1.4.1";
@ -30,9 +31,19 @@ mkDerivation rec {
buildInputs = [ buildInputs = [
qtbase qtbase
qt5.qtx11extras
] ++ lib.optionals stdenv.isLinux [ ] ++ lib.optionals stdenv.isLinux [
xorg.libxcb xorg.libxcb
] ++ lib.optionals (!useQt6) [
qt5.qtx11extras
] ++ lib.optionals useQt6 [
qtwayland
];
# Qt setup hook complains about missing `wrapQtAppsHook` otherwise.
dontWrapQtApps = true;
cmakeFlags = lib.optionals useQt6 [
"-DUSE_QT6=true"
]; ];
postPatch = '' postPatch = ''

View File

@ -1,19 +1,22 @@
{ mkDerivation { stdenv
, lib , lib
, fetchFromGitHub , fetchFromGitHub
, nix-update-script , nix-update-script
, cmake , cmake
, pkg-config , pkg-config
, adwaita-qt , adwaita-qt
, adwaita-qt6
, glib , glib
, gtk3 , gtk3
, qtbase , qtbase
, qtwayland
, pantheon , pantheon
, substituteAll , substituteAll
, gsettings-desktop-schemas , gsettings-desktop-schemas
, useQt6 ? false
}: }:
mkDerivation rec { stdenv.mkDerivation rec {
pname = "qgnomeplatform"; pname = "qgnomeplatform";
version = "0.8.4"; version = "0.8.4";
@ -38,15 +41,24 @@ mkDerivation rec {
]; ];
buildInputs = [ buildInputs = [
adwaita-qt
glib glib
gtk3 gtk3
qtbase qtbase
] ++ lib.optionals (!useQt6) [
adwaita-qt
] ++ lib.optionals useQt6 [
adwaita-qt6
qtwayland
]; ];
# Qt setup hook complains about missing `wrapQtAppsHook` otherwise.
dontWrapQtApps = true;
cmakeFlags = [ cmakeFlags = [
"-DGLIB_SCHEMAS_DIR=${glib.getSchemaPath gsettings-desktop-schemas}" "-DGLIB_SCHEMAS_DIR=${glib.getSchemaPath gsettings-desktop-schemas}"
"-DQT_PLUGINS_DIR=${placeholder "out"}/${qtbase.qtPluginPrefix}" "-DQT_PLUGINS_DIR=${placeholder "out"}/${qtbase.qtPluginPrefix}"
] ++ lib.optionals useQt6 [
"-DUSE_QT6=true"
]; ];
passthru = { passthru = {

View File

@ -22554,6 +22554,10 @@ with pkgs;
qgnomeplatform = libsForQt5.callPackage ../development/libraries/qgnomeplatform { }; qgnomeplatform = libsForQt5.callPackage ../development/libraries/qgnomeplatform { };
qgnomeplatform-qt6 = qt6Packages.callPackage ../development/libraries/qgnomeplatform {
useQt6 = true;
};
randomx = darwin.apple_sdk_11_0.callPackage ../development/libraries/randomx { }; randomx = darwin.apple_sdk_11_0.callPackage ../development/libraries/randomx { };
remodel = callPackage ../development/tools/remodel { remodel = callPackage ../development/tools/remodel {
@ -26425,6 +26429,10 @@ with pkgs;
adwaita-qt = libsForQt5.callPackage ../data/themes/adwaita-qt { }; adwaita-qt = libsForQt5.callPackage ../data/themes/adwaita-qt { };
adwaita-qt6 = qt6Packages.callPackage ../data/themes/adwaita-qt {
useQt6 = true;
};
adw-gtk3 = callPackage ../data/themes/adw-gtk3 { }; adw-gtk3 = callPackage ../data/themes/adw-gtk3 { };
agave = callPackage ../data/fonts/agave { }; agave = callPackage ../data/fonts/agave { };