From 70b618f72ea19a7f2e5fbbcac69757ecf74b0270 Mon Sep 17 00:00:00 2001 From: SamLukeYes Date: Sun, 26 Nov 2023 15:33:27 +0800 Subject: [PATCH] qadwaitadecorations: init at 0.1.3 --- .../qa/qadwaitadecorations/package.nix | 58 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 4 ++ 2 files changed, 62 insertions(+) create mode 100644 pkgs/by-name/qa/qadwaitadecorations/package.nix diff --git a/pkgs/by-name/qa/qadwaitadecorations/package.nix b/pkgs/by-name/qa/qadwaitadecorations/package.nix new file mode 100644 index 000000000000..74ba857f03b0 --- /dev/null +++ b/pkgs/by-name/qa/qadwaitadecorations/package.nix @@ -0,0 +1,58 @@ +{ lib +, stdenv +, fetchFromGitHub +, cmake +, qt5 +, qt6 +, wayland +, nix-update-script +, useQt6 ? false + +# Shadows support on Qt5 requires the feature backported from Qt6: +# https://src.fedoraproject.org/rpms/qt5-qtwayland/blob/rawhide/f/qtwayland-decoration-support-backports-from-qt6.patch +, qt5ShadowsSupport ? false +}: + +let + qt = if useQt6 then qt6 else qt5; + qtVersion = if useQt6 then "6" else "5"; + +in stdenv.mkDerivation (finalAttrs: { + pname = "qadwaitadecorations"; + version = "0.1.3"; + + src = fetchFromGitHub { + owner = "FedoraQt"; + repo = "QAdwaitaDecorations"; + rev = finalAttrs.version; + hash = "sha256-9uK2ojukuwzOz/genWiCch4c3pL5qEfyy8ERpFxS8/8="; + }; + + nativeBuildInputs = [ + cmake + ]; + + buildInputs = with qt; [ + qtbase + qtsvg + qtwayland + wayland + ]; + + dontWrapQtApps = true; + + cmakeFlags = [ + "-DQT_PLUGINS_DIR=${placeholder "out"}/${qt.qtbase.qtPluginPrefix}" + ] ++ lib.optional useQt6 "-DUSE_QT6=true" + ++ lib.optional qt5ShadowsSupport "-DHAS_QT6_SUPPORT=true"; + + passthru.updateScript = nix-update-script { }; + + meta = { + description = "Qt${qtVersion} Wayland decoration plugin using libadwaita style"; + homepage = "https://github.com/FedoraQt/QAdwaitaDecorations"; + license = lib.licenses.lgpl21Plus; + maintainers = with lib.maintainers; [ samlukeyes123 ]; + platforms = lib.platforms.linux; + }; +}) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index bce2f4635b70..b6b2455859a6 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -24772,6 +24772,10 @@ with pkgs; qrupdate = callPackage ../development/libraries/qrupdate { }; + qadwaitadecorations-qt6 = callPackage ../by-name/qa/qadwaitadecorations/package.nix { + useQt6 = true; + }; + qgnomeplatform = libsForQt5.callPackage ../development/libraries/qgnomeplatform { }; qgnomeplatform-qt6 = qt6Packages.callPackage ../development/libraries/qgnomeplatform {