summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Palimaka <kensington@gentoo.org>2016-11-17 05:37:49 +1100
committerMichael Palimaka <kensington@gentoo.org>2016-11-17 05:38:30 +1100
commit7bc55c6cfd54f8989f8d7a7e5cdd49c29fb43c83 (patch)
tree4826c27e657035a600c19ae56ed3a9c105bd33e2 /kde-plasma/plasma-workspace
parentdev-vcs/bzr: remove old (diff)
downloadgentoo-7bc55c6cfd54f8989f8d7a7e5cdd49c29fb43c83.tar.gz
gentoo-7bc55c6cfd54f8989f8d7a7e5cdd49c29fb43c83.tar.bz2
gentoo-7bc55c6cfd54f8989f8d7a7e5cdd49c29fb43c83.zip
kde-plasma/plasma-workspace: backport patch from upstream resolving krunner crash
Package-Manager: portage-2.3.2
Diffstat (limited to 'kde-plasma/plasma-workspace')
-rw-r--r--kde-plasma/plasma-workspace/files/plasma-workspace-5.8.3-krunner-crash.patch441
-rw-r--r--kde-plasma/plasma-workspace/plasma-workspace-5.8.3-r2.ebuild176
2 files changed, 617 insertions, 0 deletions
diff --git a/kde-plasma/plasma-workspace/files/plasma-workspace-5.8.3-krunner-crash.patch b/kde-plasma/plasma-workspace/files/plasma-workspace-5.8.3-krunner-crash.patch
new file mode 100644
index 000000000000..9b238b68b698
--- /dev/null
+++ b/kde-plasma/plasma-workspace/files/plasma-workspace-5.8.3-krunner-crash.patch
@@ -0,0 +1,441 @@
+From 3f859c3dbdded68cc96d4c695ff27d15c387da09 Mon Sep 17 00:00:00 2001
+From: Aleix Pol <aleixpol@kde.org>
+Date: Mon, 10 Oct 2016 16:30:24 +0200
+Subject: [PATCH] Port to new plasma-framework API
+
+Reduces unnecessary castings.
+Ports away the WindowedWidgets runner from KService
+
+REVIEW: 129101
+---
+ applets/systemtray/systemtray.cpp | 30 +++++++-------
+ .../shellprivate/widgetexplorer/widgetexplorer.cpp | 14 +++----
+ plasma-windowed/plasmawindowedcorona.cpp | 2 +-
+ runners/windowedwidgets/windowedwidgetsrunner.cpp | 46 ++++++++++------------
+ runners/windowedwidgets/windowedwidgetsrunner.h | 2 +-
+ shell/alternativeshelper.cpp | 6 +--
+ shell/containmentconfigview.cpp | 2 +-
+ shell/scripting/containment.cpp | 4 +-
+ shell/scripting/widget.cpp | 2 +-
+ shell/shellcorona.cpp | 15 +++----
+ 10 files changed, 60 insertions(+), 63 deletions(-)
+
+diff --git a/applets/systemtray/systemtray.cpp b/applets/systemtray/systemtray.cpp
+index e1cd610..ecc23a4 100644
+--- a/applets/systemtray/systemtray.cpp
++++ b/applets/systemtray/systemtray.cpp
+@@ -99,19 +99,19 @@ void SystemTray::init()
+ {
+ Containment::init();
+
+- for (const auto &info: Plasma::PluginLoader::self()->listAppletInfo(QString())) {
+- if (!info.isValid() || info.property(QStringLiteral("X-Plasma-NotificationArea")) != "true") {
++ for (const auto &info: Plasma::PluginLoader::self()->listAppletMetaData(QString())) {
++ if (!info.isValid() || info.value(QStringLiteral("X-Plasma-NotificationArea")) != "true") {
+ continue;
+ }
+- m_systrayApplets[info.pluginName()] = info;
++ m_systrayApplets[info.pluginId()] = KPluginInfo(info);
+
+- if (info.isPluginEnabledByDefault()) {
+- m_defaultPlasmoids += info.pluginName();
++ if (info.isEnabledByDefault()) {
++ m_defaultPlasmoids += info.pluginId();
+ }
+- const QString dbusactivation = info.property(QStringLiteral("X-Plasma-DBusActivationService")).toString();
++ const QString dbusactivation = info.value(QStringLiteral("X-Plasma-DBusActivationService"));
+ if (!dbusactivation.isEmpty()) {
+- qCDebug(SYSTEM_TRAY) << "ST Found DBus-able Applet: " << info.pluginName() << dbusactivation;
+- m_dbusActivatableTasks[info.pluginName()] = dbusactivation;
++ qCDebug(SYSTEM_TRAY) << "ST Found DBus-able Applet: " << info.pluginId() << dbusactivation;
++ m_dbusActivatableTasks[info.pluginId()] = dbusactivation;
+ }
+ }
+ }
+@@ -119,12 +119,12 @@ void SystemTray::init()
+ void SystemTray::newTask(const QString &task)
+ {
+ foreach (Plasma::Applet *applet, applets()) {
+- if (!applet->pluginInfo().isValid()) {
++ if (!applet->pluginMetaData().isValid()) {
+ continue;
+ }
+
+ //only allow one instance per applet
+- if (task == applet->pluginInfo().pluginName()) {
++ if (task == applet->pluginMetaData().pluginId()) {
+ //Applet::destroy doesn't delete the applet from Containment::applets in the same event
+ //potentially a dbus activated service being restarted can be added in this time.
+ if (!applet->destroyed()) {
+@@ -156,7 +156,7 @@ void SystemTray::newTask(const QString &task)
+ void SystemTray::cleanupTask(const QString &task)
+ {
+ foreach (Plasma::Applet *applet, applets()) {
+- if (!applet->pluginInfo().isValid() || task == applet->pluginInfo().pluginName()) {
++ if (!applet->pluginMetaData().isValid() || task == applet->pluginMetaData().pluginId()) {
+ //we are *not* cleaning the config here, because since is one
+ //of those automatically loaded/unloaded by dbus, we want to recycle
+ //the config the next time it's loaded, in case the user configured something here
+@@ -255,11 +255,11 @@ Q_INVOKABLE QString SystemTray::plasmoidCategory(QQuickItem *appletInterface) co
+ }
+
+ Plasma::Applet *applet = appletInterface->property("_plasma_applet").value<Plasma::Applet*>();
+- if (!applet || !applet->pluginInfo().isValid()) {
++ if (!applet || !applet->pluginMetaData().isValid()) {
+ return "UnknownCategory";
+ }
+
+- const QString cat = applet->pluginInfo().property(QStringLiteral("X-Plasma-NotificationAreaCategory")).toString();
++ const QString cat = applet->pluginMetaData().value(QStringLiteral("X-Plasma-NotificationAreaCategory"));
+
+ if (cat.isEmpty()) {
+ return "UnknownCategory";
+@@ -385,11 +385,11 @@ void SystemTray::restorePlasmoids()
+ foreach (Plasma::Applet *applet, applets()) {
+ //Here it should always be valid.
+ //for some reason it not always is.
+- if (!applet->pluginInfo().isValid()) {
++ if (!applet->pluginMetaData().isValid()) {
+ applet->config().parent().deleteGroup();
+ applet->deleteLater();
+ } else {
+- const QString task = applet->pluginInfo().pluginName();
++ const QString task = applet->pluginMetaData().pluginId();
+ if (!m_allowedPlasmoids.contains(task)) {
+ //in those cases we do delete the applet config completely
+ //as they were explicitly disabled by the user
+diff --git a/components/shellprivate/widgetexplorer/widgetexplorer.cpp b/components/shellprivate/widgetexplorer/widgetexplorer.cpp
+index c2b38a8..b445897 100644
+--- a/components/shellprivate/widgetexplorer/widgetexplorer.cpp
++++ b/components/shellprivate/widgetexplorer/widgetexplorer.cpp
+@@ -249,14 +249,14 @@ void WidgetExplorerPrivate::addContainment(Containment *containment)
+ QObject::connect(containment, SIGNAL(appletRemoved(Plasma::Applet*)), q, SLOT(appletRemoved(Plasma::Applet*)));
+
+ foreach (Applet *applet, containment->applets()) {
+- if (applet->pluginInfo().isValid()) {
++ if (applet->pluginMetaData().isValid()) {
+ Containment *childContainment = applet->property("containment").value<Containment*>();
+ if (childContainment) {
+ addContainment(childContainment);
+ }
+- runningApplets[applet->pluginInfo().pluginName()]++;
++ runningApplets[applet->pluginMetaData().pluginId()]++;
+ } else {
+- qDebug() << "Invalid plugininfo. :(";
++ qDebug() << "Invalid plugin metadata. :(";
+ }
+ }
+ }
+@@ -268,10 +268,10 @@ void WidgetExplorerPrivate::containmentDestroyed()
+
+ void WidgetExplorerPrivate::appletAdded(Plasma::Applet *applet)
+ {
+- if (!applet->pluginInfo().isValid()) {
++ if (!applet->pluginMetaData().isValid()) {
+ return;
+ }
+- QString name = applet->pluginInfo().pluginName();
++ QString name = applet->pluginMetaData().pluginId();
+
+ runningApplets[name]++;
+ appletNames.insert(applet, name);
+@@ -471,9 +471,9 @@ void WidgetExplorer::uninstall(const QString &pluginName)
+ const auto &applets = c->applets();
+
+ foreach (Applet *applet, applets) {
+- const auto &appletInfo = applet->pluginInfo();
++ const auto &appletInfo = applet->pluginMetaData();
+
+- if (appletInfo.isValid() && appletInfo.pluginName() == pluginName) {
++ if (appletInfo.isValid() && appletInfo.pluginId() == pluginName) {
+ applet->destroy();
+ }
+ }
+diff --git a/plasma-windowed/plasmawindowedcorona.cpp b/plasma-windowed/plasmawindowedcorona.cpp
+index fbacbf8..b68d270 100644
+--- a/plasma-windowed/plasmawindowedcorona.cpp
++++ b/plasma-windowed/plasmawindowedcorona.cpp
+@@ -51,7 +51,7 @@ void PlasmaWindowedCorona::loadApplet(const QString &applet, const QVariantList
+
+ //forbid more instances per applet (todo: activate the correpsponding already loaded applet)
+ for (Plasma::Applet *a : cont->applets()) {
+- if (a->pluginInfo().pluginName() == applet) {
++ if (a->pluginMetaData().pluginId() == applet) {
+ return;
+ }
+ }
+diff --git a/runners/windowedwidgets/windowedwidgetsrunner.cpp b/runners/windowedwidgets/windowedwidgetsrunner.cpp
+index 5ccbd27..7f093a7 100644
+--- a/runners/windowedwidgets/windowedwidgetsrunner.cpp
++++ b/runners/windowedwidgets/windowedwidgetsrunner.cpp
+@@ -60,24 +60,22 @@ void WindowedWidgetsRunner::match(Plasma::RunnerContext &context)
+
+ QList<Plasma::QueryMatch> matches;
+
+- foreach (const KPluginInfo &info, Plasma::PluginLoader::self()->listAppletInfo(QString())) {
+- KService::Ptr service = info.service();
+-
+- if (((service->name().contains(term, Qt::CaseInsensitive) ||
+- service->genericName().contains(term, Qt::CaseInsensitive) ||
+- service->comment().contains(term, Qt::CaseInsensitive)) ||
+- service->categories().contains(term, Qt::CaseInsensitive) ||
++ foreach (const KPluginMetaData &md, Plasma::PluginLoader::self()->listAppletMetaData(QString())) {
++ if (((md.name().contains(term, Qt::CaseInsensitive) ||
++ md.value(QLatin1String("GenericName")).contains(term, Qt::CaseInsensitive) ||
++ md.description().contains(term, Qt::CaseInsensitive)) ||
++ md.category().contains(term, Qt::CaseInsensitive) ||
+ term.startsWith(i18nc("Note this is a KRunner keyword", "mobile applications"))) &&
+- !info.property(QStringLiteral("NoDisplay")).toBool()) {
++ !md.rawData().value(QStringLiteral("NoDisplay")).toBool()) {
+
+- QVariant val = info.property(QStringLiteral("X-Plasma-StandAloneApp"));
++ QVariant val = md.value(QStringLiteral("X-Plasma-StandAloneApp"));
+ if (!val.isValid() || !val.toBool()) {
+ continue;
+ }
+
+ Plasma::QueryMatch match(this);
+- setupMatch(service, match);
+- if (service->name().compare(term, Qt::CaseInsensitive) == 0) {
++ setupMatch(md, match);
++ if (md.name().compare(term, Qt::CaseInsensitive) == 0) {
+ match.setType(Plasma::QueryMatch::ExactMatch);
+ match.setRelevance(1);
+ } else {
+@@ -85,8 +83,6 @@ void WindowedWidgetsRunner::match(Plasma::RunnerContext &context)
+ match.setRelevance(0.7);
+ }
+ matches << match;
+-
+- qDebug() << service;
+ }
+ }
+
+@@ -100,27 +96,27 @@ void WindowedWidgetsRunner::match(Plasma::RunnerContext &context)
+ void WindowedWidgetsRunner::run(const Plasma::RunnerContext &context, const Plasma::QueryMatch &match)
+ {
+ Q_UNUSED(context);
+- KService::Ptr service = KService::serviceByStorageId(match.data().toString());
+- if (service) {
+- QProcess::startDetached(QStringLiteral("plasmawindowed"), QStringList() << service->property(QStringLiteral("X-KDE-PluginInfo-Name"), QVariant::String).toString());
++ KPluginMetaData md(match.data().toString());
++ if (md.isValid()) {
++ QProcess::startDetached(QStringLiteral("plasmawindowed"), QStringList() << md.pluginId());
+ }
+ }
+
+-void WindowedWidgetsRunner::setupMatch(const KService::Ptr &service, Plasma::QueryMatch &match)
++void WindowedWidgetsRunner::setupMatch(const KPluginMetaData &md, Plasma::QueryMatch &match)
+ {
+- const QString name = service->name();
++ const QString name = md.pluginId();
+
+ match.setText(name);
+- match.setData(service->storageId());
++ match.setData(md.metaDataFileName());
+
+- if (!service->genericName().isEmpty() && service->genericName() != name) {
+- match.setSubtext(service->genericName());
+- } else if (!service->comment().isEmpty()) {
+- match.setSubtext(service->comment());
++ if (!md.name().isEmpty() && md.name() != name) {
++ match.setSubtext(md.name());
++ } else if (!md.description().isEmpty()) {
++ match.setSubtext(md.description());
+ }
+
+- if (!service->icon().isEmpty()) {
+- match.setIconName(service->icon());
++ if (!md.iconName().isEmpty()) {
++ match.setIconName(md.iconName());
+ }
+ }
+
+diff --git a/runners/windowedwidgets/windowedwidgetsrunner.h b/runners/windowedwidgets/windowedwidgetsrunner.h
+index 2294965..fbc8006 100644
+--- a/runners/windowedwidgets/windowedwidgetsrunner.h
++++ b/runners/windowedwidgets/windowedwidgetsrunner.h
+@@ -48,7 +48,7 @@ protected Q_SLOTS:
+
+
+ protected:
+- void setupMatch(const KService::Ptr &service, Plasma::QueryMatch &action);
++ void setupMatch(const KPluginMetaData &md, Plasma::QueryMatch &action);
+ };
+
+ #endif
+diff --git a/shell/alternativeshelper.cpp b/shell/alternativeshelper.cpp
+index d0f5dfd..6d76307 100644
+--- a/shell/alternativeshelper.cpp
++++ b/shell/alternativeshelper.cpp
+@@ -38,12 +38,12 @@ AlternativesHelper::~AlternativesHelper()
+
+ QStringList AlternativesHelper::appletProvides() const
+ {
+- return m_applet->pluginInfo().property(QStringLiteral("X-Plasma-Provides")).toStringList();
++ return KPluginMetaData::readStringList(m_applet->pluginMetaData().rawData(), QStringLiteral("X-Plasma-Provides"));
+ }
+
+ QString AlternativesHelper::currentPlugin() const
+ {
+- return m_applet->pluginInfo().pluginName();
++ return m_applet->pluginMetaData().pluginId();
+ }
+
+ QQuickItem *AlternativesHelper::applet() const
+@@ -53,7 +53,7 @@ QQuickItem *AlternativesHelper::applet() const
+
+ void AlternativesHelper::loadAlternative(const QString &plugin)
+ {
+- if (plugin == m_applet->pluginInfo().pluginName() || m_applet->isContainment()) {
++ if (plugin == m_applet->pluginMetaData().pluginId() || m_applet->isContainment()) {
+ return;
+ }
+
+diff --git a/shell/containmentconfigview.cpp b/shell/containmentconfigview.cpp
+index cec067e..4c9d146 100644
+--- a/shell/containmentconfigview.cpp
++++ b/shell/containmentconfigview.cpp
+@@ -104,7 +104,7 @@ QAbstractItemModel *ContainmentConfigView::currentContainmentActionsModel()
+
+ QString ContainmentConfigView::containmentPlugin() const
+ {
+- return m_containment->pluginInfo().pluginName();
++ return m_containment->pluginMetaData().pluginId();
+ }
+
+ void ContainmentConfigView::setContainmentPlugin(const QString &plugin)
+diff --git a/shell/scripting/containment.cpp b/shell/scripting/containment.cpp
+index 6040e62..96e2009 100644
+--- a/shell/scripting/containment.cpp
++++ b/shell/scripting/containment.cpp
+@@ -248,7 +248,7 @@ QScriptValue Containment::widgets(QScriptContext *context, QScriptEngine *engine
+ int count = 0;
+
+ foreach (Plasma::Applet *widget, c->d->containment.data()->applets()) {
+- if (widgetType.isEmpty() || widget->pluginInfo().pluginName() == widgetType) {
++ if (widgetType.isEmpty() || widget->pluginMetaData().pluginId() == widgetType) {
+ widgets.setProperty(count, env->wrap(widget));
+ ++count;
+ }
+@@ -273,7 +273,7 @@ QString Containment::type() const
+ return QString();
+ }
+
+- return d->containment.data()->pluginInfo().pluginName();
++ return d->containment.data()->pluginMetaData().pluginId();
+ }
+
+ void Containment::remove()
+diff --git a/shell/scripting/widget.cpp b/shell/scripting/widget.cpp
+index a651c2a..b58822b 100644
+--- a/shell/scripting/widget.cpp
++++ b/shell/scripting/widget.cpp
+@@ -65,7 +65,7 @@ uint Widget::id() const
+ QString Widget::type() const
+ {
+ if (d->applet) {
+- return d->applet.data()->pluginInfo().pluginName();
++ return d->applet.data()->pluginMetaData().pluginId();
+ }
+
+ return QString();
+diff --git a/shell/shellcorona.cpp b/shell/shellcorona.cpp
+index 33259da..598fdb0 100644
+--- a/shell/shellcorona.cpp
++++ b/shell/shellcorona.cpp
+@@ -406,7 +406,7 @@ QByteArray ShellCorona::dumpCurrentLayoutJS() const
+ || cont->location() == Plasma::Types::BottomEdge
+ || cont->location() == Plasma::Types::LeftEdge
+ || cont->location() == Plasma::Types::RightEdge) &&
+- cont->pluginInfo().pluginName() != QStringLiteral("org.kde.plasma.private.systemtray");
++ cont->pluginMetaData().pluginId() != QStringLiteral("org.kde.plasma.private.systemtray");
+ };
+
+ auto isDesktop = [] (Plasma::Containment *cont) {
+@@ -493,7 +493,7 @@ QByteArray ShellCorona::dumpCurrentLayoutJS() const
+
+ KConfigGroup appletConfig = applet->config();
+
+- appletJson.insert("plugin", applet->pluginInfo().pluginName());
++ appletJson.insert("plugin", applet->pluginMetaData().pluginId());
+ appletJson.insert("config", dumpconfigGroupJS(appletConfig));
+
+ appletsJsonArray << appletJson;
+@@ -560,7 +560,7 @@ QByteArray ShellCorona::dumpCurrentLayoutJS() const
+ QJsonObject appletJson;
+
+ appletJson.insert("title", applet->title());
+- appletJson.insert("plugin", applet->pluginInfo().pluginName());
++ appletJson.insert("plugin", applet->pluginMetaData().pluginId());
+
+ appletJson.insert("geometry.x", geometry.x() / gridUnit);
+ appletJson.insert("geometry.y", geometry.y() / gridUnit);
+@@ -1238,11 +1238,11 @@ void ShellCorona::handleContainmentAdded(Plasma::Containment *c)
+
+ void ShellCorona::executeSetupPlasmoidScript(Plasma::Containment *containment, Plasma::Applet *applet)
+ {
+- if (!applet->pluginInfo().isValid() || !containment->pluginInfo().isValid()) {
++ if (!applet->pluginMetaData().isValid() || !containment->pluginMetaData().isValid()) {
+ return;
+ }
+
+- const QString scriptFile = m_lookAndFeelPackage.filePath("plasmoidsetupscripts", applet->pluginInfo().pluginName() + ".js");
++ const QString scriptFile = m_lookAndFeelPackage.filePath("plasmoidsetupscripts", applet->pluginMetaData().pluginId() + ".js");
+
+ if (scriptFile.isEmpty()) {
+ return;
+@@ -1541,7 +1541,7 @@ Plasma::Containment *ShellCorona::setContainmentTypeForScreen(int screen, const
+ //if creation failed or invalid plugin, give up
+ if (!newContainment) {
+ return oldContainment;
+- } else if (!newContainment->pluginInfo().isValid()) {
++ } else if (!newContainment->pluginMetaData().isValid()) {
+ newContainment->deleteLater();
+ return oldContainment;
+ }
+@@ -1975,7 +1975,8 @@ void ShellCorona::activateLauncherMenu()
+ for (auto it = m_panelViews.constBegin(), end = m_panelViews.constEnd(); it != end; ++it) {
+ const auto applets = it.key()->applets();
+ for (auto applet : applets) {
+- if (applet->pluginInfo().property("X-Plasma-Provides").toStringList().contains(QStringLiteral("org.kde.plasma.launchermenu"))) {
++ const auto provides = KPluginMetaData::readStringList(applet->pluginMetaData().rawData(), QStringLiteral("X-Plasma-Provides"));
++ if (provides.contains(QLatin1String("org.kde.plasma.launchermenu"))) {
+ if (!applet->globalShortcut().isEmpty()) {
+ emit applet->activated();
+ return;
+--
+2.7.3
+
+From 59b2d1effcee8d449cbbcd237ba8cebaeb4dd949 Mon Sep 17 00:00:00 2001
+From: Kai Uwe Broulik <kde@privat.broulik.de>
+Date: Mon, 14 Nov 2016 15:23:00 +0100
+Subject: [PATCH] [Windowed Widgets Runner] Don't access invalid
+ KPluginMetaData
+
+BUG: 372017
+FIXED-IN: 5.8.4
+
+Differential Revision: https://phabricator.kde.org/D3356
+---
+ runners/windowedwidgets/windowedwidgetsrunner.cpp | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/runners/windowedwidgets/windowedwidgetsrunner.cpp b/runners/windowedwidgets/windowedwidgetsrunner.cpp
+index 7f093a7..706b1bb 100644
+--- a/runners/windowedwidgets/windowedwidgetsrunner.cpp
++++ b/runners/windowedwidgets/windowedwidgetsrunner.cpp
+@@ -61,6 +61,10 @@ void WindowedWidgetsRunner::match(Plasma::RunnerContext &context)
+ QList<Plasma::QueryMatch> matches;
+
+ foreach (const KPluginMetaData &md, Plasma::PluginLoader::self()->listAppletMetaData(QString())) {
++ if (!md.isValid()) {
++ continue;
++ }
++
+ if (((md.name().contains(term, Qt::CaseInsensitive) ||
+ md.value(QLatin1String("GenericName")).contains(term, Qt::CaseInsensitive) ||
+ md.description().contains(term, Qt::CaseInsensitive)) ||
+--
+2.7.3
+
diff --git a/kde-plasma/plasma-workspace/plasma-workspace-5.8.3-r2.ebuild b/kde-plasma/plasma-workspace/plasma-workspace-5.8.3-r2.ebuild
new file mode 100644
index 000000000000..c97f621a5c86
--- /dev/null
+++ b/kde-plasma/plasma-workspace/plasma-workspace-5.8.3-r2.ebuild
@@ -0,0 +1,176 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+KDE_HANDBOOK="forceoptional"
+KDE_TEST="forceoptional"
+VIRTUALX_REQUIRED="test"
+inherit kde5 multilib qmake-utils
+
+DESCRIPTION="KDE Plasma workspace"
+KEYWORDS="~amd64 ~arm ~x86"
+IUSE="+calendar geolocation gps prison qalculate +semantic-desktop"
+
+COMMON_DEPEND="
+ $(add_frameworks_dep kactivities)
+ $(add_frameworks_dep kauth)
+ $(add_frameworks_dep kbookmarks)
+ $(add_frameworks_dep kcmutils)
+ $(add_frameworks_dep kcompletion)
+ $(add_frameworks_dep kconfig)
+ $(add_frameworks_dep kconfigwidgets)
+ $(add_frameworks_dep kcoreaddons)
+ $(add_frameworks_dep kcrash)
+ $(add_frameworks_dep kdbusaddons)
+ $(add_frameworks_dep kdeclarative)
+ $(add_frameworks_dep kdelibs4support)
+ $(add_frameworks_dep kdesu)
+ $(add_frameworks_dep kglobalaccel)
+ $(add_frameworks_dep kguiaddons)
+ $(add_frameworks_dep ki18n)
+ $(add_frameworks_dep kiconthemes)
+ $(add_frameworks_dep kidletime)
+ $(add_frameworks_dep kio)
+ $(add_frameworks_dep kitemmodels)
+ $(add_frameworks_dep kitemviews)
+ $(add_frameworks_dep kjobwidgets)
+ $(add_frameworks_dep kjs)
+ $(add_frameworks_dep kjsembed)
+ $(add_frameworks_dep knewstuff)
+ $(add_frameworks_dep knotifications)
+ $(add_frameworks_dep knotifyconfig)
+ $(add_frameworks_dep kpackage)
+ $(add_frameworks_dep krunner)
+ $(add_frameworks_dep kservice)
+ $(add_frameworks_dep ktexteditor)
+ $(add_frameworks_dep ktextwidgets)
+ $(add_frameworks_dep kwallet)
+ $(add_frameworks_dep kwayland)
+ $(add_frameworks_dep kwidgetsaddons)
+ $(add_frameworks_dep kwindowsystem)
+ $(add_frameworks_dep kxmlgui)
+ $(add_frameworks_dep kxmlrpcclient)
+ $(add_frameworks_dep plasma)
+ $(add_frameworks_dep solid)
+ $(add_plasma_dep kscreenlocker)
+ $(add_plasma_dep kwin)
+ $(add_plasma_dep libksysguard)
+ $(add_qt_dep qtconcurrent)
+ $(add_qt_dep qtdbus)
+ $(add_qt_dep qtdeclarative 'widgets')
+ $(add_qt_dep qtgui 'jpeg')
+ $(add_qt_dep qtnetwork)
+ $(add_qt_dep qtscript)
+ $(add_qt_dep qtsql)
+ $(add_qt_dep qtwidgets)
+ $(add_qt_dep qtx11extras)
+ $(add_qt_dep qtxml)
+ dev-libs/libdbusmenu-qt[qt5]
+ media-libs/phonon[qt5]
+ sys-libs/zlib
+ x11-libs/libICE
+ x11-libs/libSM
+ x11-libs/libX11
+ x11-libs/libXau
+ x11-libs/libxcb
+ x11-libs/libXfixes
+ x11-libs/libXrender
+ x11-libs/xcb-util
+ x11-libs/xcb-util-image
+ calendar? ( $(add_kdeapps_dep kholidays) )
+ geolocation? ( $(add_frameworks_dep networkmanager-qt) )
+ gps? ( sci-geosciences/gpsd )
+ prison? ( media-libs/prison:5 )
+ qalculate? ( sci-libs/libqalculate )
+ semantic-desktop? ( $(add_frameworks_dep baloo) )
+"
+RDEPEND="${COMMON_DEPEND}
+ $(add_frameworks_dep kded)
+ $(add_kdeapps_dep kio-extras)
+ $(add_plasma_dep kde-cli-tools)
+ $(add_plasma_dep ksysguard)
+ $(add_plasma_dep milou)
+ $(add_plasma_dep plasma-integration)
+ $(add_qt_dep qdbus)
+ $(add_qt_dep qtgraphicaleffects)
+ $(add_qt_dep qtpaths)
+ $(add_qt_dep qtquickcontrols 'widgets')
+ app-text/iso-codes
+ x11-apps/mkfontdir
+ x11-apps/xmessage
+ x11-apps/xprop
+ x11-apps/xrdb
+ x11-apps/xset
+ x11-apps/xsetroot
+ !dev-libs/xembed-sni-proxy
+ !kde-base/freespacenotifier:4
+ !kde-base/libtaskmanager:4
+ !kde-base/kcminit:4
+ !kde-base/kdebase-startkde:4
+ !kde-base/klipper:4
+ !kde-base/krunner:4
+ !kde-base/ksmserver:4
+ !kde-base/ksplash:4
+ !kde-base/plasma-workspace:4
+"
+DEPEND="${COMMON_DEPEND}
+ x11-proto/xproto
+"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-5.4-startkde-script.patch"
+ # stable branch
+ "${FILESDIR}/${PN}-5.8.3-all-outputs-known.patch"
+ "${FILESDIR}/${PN}-5.8.3-sync-app-w-applets-config.patch"
+ "${FILESDIR}/${PN}-5.8.3-dont-connect-twice.patch"
+ "${FILESDIR}/${PN}-5.8.3-screenpool-screenchange.patch"
+ "${FILESDIR}/${PN}-5.8.3-krunner-crash.patch"
+ # master
+ "${FILESDIR}/${PN}-5.7.90-baloo-optional.patch"
+ "${FILESDIR}/${PN}-5.8.3-systray-cpuload.patch"
+)
+
+RESTRICT+=" test"
+
+src_prepare() {
+ kde5_src_prepare
+
+ sed -e "s|\`qtpaths|\`$(qt5_get_bindir)/qtpaths|" \
+ -i startkde/startkde.cmake startkde/startplasmacompositor.cmake || die
+}
+
+src_configure() {
+ local mycmakeargs=(
+ $(cmake-utils_use_find_package calendar KF5Holidays)
+ $(cmake-utils_use_find_package geolocation KF5NetworkManagerQt)
+ $(cmake-utils_use_find_package gps libgps)
+ $(cmake-utils_use_find_package prison KF5Prison)
+ $(cmake-utils_use_find_package qalculate Qalculate)
+ $(cmake-utils_use_find_package semantic-desktop KF5Baloo)
+ )
+
+ kde5_src_configure
+}
+
+src_install() {
+ kde5_src_install
+
+ # startup and shutdown scripts
+ insinto /etc/plasma/startup
+ doins "${FILESDIR}/10-agent-startup.sh"
+
+ insinto /etc/plasma/shutdown
+ doins "${FILESDIR}/10-agent-shutdown.sh"
+}
+
+pkg_postinst () {
+ kde5_pkg_postinst
+
+ echo
+ elog "To enable gpg-agent and/or ssh-agent in Plasma sessions,"
+ elog "edit ${EPREFIX}/etc/plasma/startup/10-agent-startup.sh and"
+ elog "${EPREFIX}/etc/plasma/shutdown/10-agent-shutdown.sh"
+ echo
+}