[packages/kp5-plasma-workspace] - added patch for AppStreamQt5 1.x

qboosh qboosh at pld-linux.org
Fri Apr 19 21:05:04 CEST 2024


commit dcc18eb40ee1a8066bcf2451c35e4e4bec77b621
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Fri Apr 19 20:52:24 2024 +0200

    - added patch for AppStreamQt5 1.x

 kp5-plasma-workspace.spec         |   6 +-
 plasma-workspace-appstream1.patch | 115 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 119 insertions(+), 2 deletions(-)
---
diff --git a/kp5-plasma-workspace.spec b/kp5-plasma-workspace.spec
index 96bae50..075fbd4 100644
--- a/kp5-plasma-workspace.spec
+++ b/kp5-plasma-workspace.spec
@@ -3,6 +3,7 @@
 %bcond_with	tests		# build with tests
 # TODO:
 #  * dbusmenu-qt5 , Support for notification area menus via the DBusMenu protocol , <https://launchpad.net/libdbusmenu-qt>
+#  * Could NOT find AppMenuGtkModule (missing: AppMenuGtk3Module_LIBRARY AppMenuGtk2Module_LIBRARY)
 #
 %define		kdeplasmaver	5.27.11
 %define		qtver		5.15.2
@@ -19,6 +20,7 @@ Group:		X11/Libraries
 Source0:	https://download.kde.org/stable/plasma/%{kdeplasmaver}/%{kpname}-%{version}.tar.xz
 # Source0-md5:	ae751485c237143987f987191064ddfd
 Source1:	kde.pam
+Patch0:		plasma-workspace-appstream1.patch
 URL:		https://kde.org/
 BuildRequires:	AppStream-qt5-devel >= 1.0.2
 BuildRequires:	NetworkManager-devel >= 1.4
@@ -157,6 +159,7 @@ Pliki nagłówkowe dla programistów używających %{kpname}.
 
 %prep
 %setup -q -n %{kpname}-%{version}
+%patch0 -p1
 
 %build
 %cmake -B build \
@@ -333,8 +336,7 @@ rm -rf $RPM_BUILD_ROOT
 %ghost %{_libdir}/libnotificationmanager.so.1
 %{_libdir}/libnotificationmanager.so.5.*.*
 %{_libdir}/qt5/plugins/kf5/kio/applications.so
-# AppStream 0.x is required to build this
-#%{_libdir}/qt5/plugins/kf5/krunner/krunner_appstream.so
+%{_libdir}/qt5/plugins/kf5/krunner/krunner_appstream.so
 %{_libdir}/qt5/plugins/kf5/krunner/krunner_bookmarksrunner.so
 %{_libdir}/qt5/plugins/kf5/krunner/krunner_kill.so
 %{_libdir}/qt5/plugins/kf5/krunner/krunner_placesrunner.so
diff --git a/plasma-workspace-appstream1.patch b/plasma-workspace-appstream1.patch
new file mode 100644
index 0000000..1bafc4f
--- /dev/null
+++ b/plasma-workspace-appstream1.patch
@@ -0,0 +1,115 @@
+--- plasma-workspace-5.27.11/CMakeLists.txt.orig	2024-03-06 12:26:44.000000000 +0100
++++ plasma-workspace-5.27.11/CMakeLists.txt	2024-04-19 19:10:24.300471629 +0200
+@@ -183,12 +183,12 @@ if(FONTCONFIG_FOUND)
+   find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS PrintSupport)
+ endif()
+ 
+-find_package(AppStreamQt 0.10.6)
+-set_package_properties(AppStreamQt PROPERTIES DESCRIPTION "Access metadata for listing available software"
++find_package(AppStreamQt5 1.0.0)
++set_package_properties(AppStreamQt5 PROPERTIES DESCRIPTION "Access metadata for listing available software"
+                        URL "https://www.freedesktop.org/wiki/Distributions/AppStream/"
+                        TYPE OPTIONAL)
+ 
+-if(${AppStreamQt_FOUND})
++if(${AppStreamQt5_FOUND})
+     set(HAVE_APPSTREAMQT true)
+ endif()
+ 
+--- plasma-workspace-5.27.11/runners/CMakeLists.txt.orig	2024-03-06 12:26:45.000000000 +0100
++++ plasma-workspace-5.27.11/runners/CMakeLists.txt	2024-04-19 19:48:24.908129658 +0200
+@@ -14,7 +14,7 @@ add_subdirectory(shell)
+ add_subdirectory(webshortcuts)
+ add_subdirectory(windowedwidgets)
+ 
+-if(AppStreamQt_FOUND)
++if(AppStreamQt5_FOUND)
+     add_subdirectory(appstream)
+ endif()
+ 
+--- plasma-workspace-5.27.11/applets/kicker/plugin/actionlist.cpp.orig	2024-03-06 12:26:45.000000000 +0100
++++ plasma-workspace-5.27.11/applets/kicker/plugin/actionlist.cpp	2024-04-19 19:30:46.728147966 +0200
+@@ -32,7 +32,7 @@
+ #include "containmentinterface.h"
+ 
+ #ifdef HAVE_APPSTREAMQT
+-#include <AppStreamQt/pool.h>
++#include <AppStreamQt5/pool.h>
+ #endif
+ 
+ namespace KAStats = KActivities::Stats;
+@@ -448,10 +448,10 @@ bool handleAppstreamActions(const QStrin
+ 
+     const auto components =
+         appstreamPool->componentsByLaunchable(AppStream::Launchable::KindDesktopId, service->desktopEntryName() + QLatin1String(".desktop"));
+-    if (components.empty()) {
++    if (components.isEmpty()) {
+         return false;
+     }
+-    return QDesktopServices::openUrl(QUrl(QLatin1String("appstream://") + components[0].id()));
++    return QDesktopServices::openUrl(QUrl(QLatin1String("appstream://") + (*components.begin()).id()));
+ #else
+     return false;
+ #endif
+--- plasma-workspace-5.27.11/runners/appstream/appstreamrunner.h.orig	2024-03-06 12:26:45.000000000 +0100
++++ plasma-workspace-5.27.11/runners/appstream/appstreamrunner.h	2024-04-19 20:14:39.284693907 +0200
+@@ -6,7 +6,7 @@
+ 
+ #pragma once
+ 
+-#include <AppStreamQt/pool.h>
++#include <AppStreamQt5/pool.h>
+ #include <KRunner/AbstractRunner>
+ #include <QMutex>
+ 
+@@ -22,7 +22,7 @@ public:
+     void run(const Plasma::RunnerContext &context, const Plasma::QueryMatch &action) override;
+ 
+ private:
+-    QList<AppStream::Component> findComponentsByString(const QString &query);
++    AppStream::ComponentBox findComponentsByString(const QString &query);
+ 
+     AppStream::Pool m_db;
+     QMutex m_appstreamMutex;
+--- plasma-workspace-5.27.11/runners/appstream/appstreamrunner.cpp.orig	2024-03-06 12:26:45.000000000 +0100
++++ plasma-workspace-5.27.11/runners/appstream/appstreamrunner.cpp	2024-04-19 20:24:28.295058106 +0200
+@@ -6,7 +6,7 @@
+ 
+ #include "appstreamrunner.h"
+ 
+-#include <AppStreamQt/icon.h>
++#include <AppStreamQt5/icon.h>
+ 
+ #include <QDebug>
+ #include <QDesktopServices>
+@@ -90,9 +90,12 @@ void InstallerRunner::match(Plasma::Runn
+     }
+ 
+     std::set<QString> uniqueIds;
+-    const auto components = findComponentsByString(context.query()).mid(0, 3);
++    const auto components = findComponentsByString(context.query());
+ 
++    int idx = 0;
+     for (const AppStream::Component &component : components) {
++        if (++idx > 3)
++            break;
+         if (component.kind() != AppStream::Component::KindDesktopApp)
+             continue;
+ 
+@@ -145,13 +148,14 @@ void InstallerRunner::run(const Plasma::
+         qCWarning(RUNNER_APPSTREAM) << "couldn't open" << appstreamUrl;
+ }
+ 
+-QList<AppStream::Component> InstallerRunner::findComponentsByString(const QString &query)
++AppStream::ComponentBox InstallerRunner::findComponentsByString(const QString &query)
+ {
+     QMutexLocker locker(&m_appstreamMutex);
+     QString error;
+     static bool warnedOnce = false;
+-    static bool opened = m_db.load(&error);
++    static bool opened = m_db.load();
+     if (!opened) {
++        error = m_db.lastError();
+         if (warnedOnce) {
+             qCDebug(RUNNER_APPSTREAM) << "Had errors when loading AppStream metadata pool" << error;
+         } else {
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/kp5-plasma-workspace.git/commitdiff/dcc18eb40ee1a8066bcf2451c35e4e4bec77b621



More information about the pld-cvs-commit mailing list