summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Sturmlechner <asturm@gentoo.org>2018-10-06 00:40:56 +0200
committerAndreas Sturmlechner <asturm@gentoo.org>2018-10-06 00:42:04 +0200
commit6d9d48a6e22660c15e07daf03c8319d2741f071a (patch)
treeb558fe7c3a3ce48b2589f07c9e09957a1f32eafc /kde-apps
parentkde-apps/kdepim-meta: Drop kde-apps/syndication RDEPEND (diff)
downloadgentoo-6d9d48a6e22660c15e07daf03c8319d2741f071a.tar.gz
gentoo-6d9d48a6e22660c15e07daf03c8319d2741f071a.tar.bz2
gentoo-6d9d48a6e22660c15e07daf03c8319d2741f071a.zip
kde-apps/akregator: Fix build with kde-frameworks/syndication
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org> Package-Manager: Portage-2.3.50, Repoman-2.3.11
Diffstat (limited to 'kde-apps')
-rw-r--r--kde-apps/akregator/akregator-18.04.3-r1.ebuild60
-rw-r--r--kde-apps/akregator/files/akregator-18.04.3-syndication.patch222
2 files changed, 282 insertions, 0 deletions
diff --git a/kde-apps/akregator/akregator-18.04.3-r1.ebuild b/kde-apps/akregator/akregator-18.04.3-r1.ebuild
new file mode 100644
index 000000000000..8f0cffe52efc
--- /dev/null
+++ b/kde-apps/akregator/akregator-18.04.3-r1.ebuild
@@ -0,0 +1,60 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+KDE_HANDBOOK="forceoptional"
+KDE_TEST="forceoptional"
+inherit kde5
+
+DESCRIPTION="News feed aggregator"
+HOMEPAGE="https://www.kde.org/applications/internet/akregator"
+LICENSE="GPL-2+ handbook? ( FDL-1.2+ )"
+KEYWORDS="~amd64 ~x86"
+
+IUSE=""
+
+COMMON_DEPEND="
+ $(add_frameworks_dep kcmutils)
+ $(add_frameworks_dep kcodecs)
+ $(add_frameworks_dep kcompletion)
+ $(add_frameworks_dep kconfig)
+ $(add_frameworks_dep kconfigwidgets)
+ $(add_frameworks_dep kcoreaddons)
+ $(add_frameworks_dep kcrash)
+ $(add_frameworks_dep ki18n)
+ $(add_frameworks_dep kiconthemes)
+ $(add_frameworks_dep kio)
+ $(add_frameworks_dep kjobwidgets)
+ $(add_frameworks_dep knotifications)
+ $(add_frameworks_dep knotifyconfig)
+ $(add_frameworks_dep kparts)
+ $(add_frameworks_dep kservice)
+ $(add_frameworks_dep ktextwidgets)
+ $(add_frameworks_dep kwidgetsaddons)
+ $(add_frameworks_dep kxmlgui)
+ $(add_frameworks_dep syndication)
+ $(add_kdeapps_dep grantleetheme)
+ $(add_kdeapps_dep kontactinterface)
+ $(add_kdeapps_dep kpimtextedit)
+ $(add_kdeapps_dep libkdepim)
+ $(add_kdeapps_dep messagelib)
+ $(add_kdeapps_dep pimcommon)
+ $(add_qt_dep qtdbus)
+ $(add_qt_dep qtgui)
+ $(add_qt_dep qtnetwork)
+ $(add_qt_dep qtwebengine)
+ $(add_qt_dep qtwidgets)
+ $(add_qt_dep qtxml)
+"
+DEPEND="${COMMON_DEPEND}
+ dev-libs/grantlee:5
+"
+RDEPEND="${COMMON_DEPEND}
+ !kde-apps/kdepim-l10n
+"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-17.12.2-crashfix.patch"
+ "${FILESDIR}/${P}-syndication.patch"
+)
diff --git a/kde-apps/akregator/files/akregator-18.04.3-syndication.patch b/kde-apps/akregator/files/akregator-18.04.3-syndication.patch
new file mode 100644
index 000000000000..f20f8fffa93e
--- /dev/null
+++ b/kde-apps/akregator/files/akregator-18.04.3-syndication.patch
@@ -0,0 +1,222 @@
+From d2797fe48b6d4429cd30163fd75003118400511f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Daniel=20Vr=C3=A1til?= <dvratil@kde.org>
+Date: Sun, 22 Apr 2018 09:13:45 +0200
+Subject: Port away from remove Syndication API
+
+---
+ src/CMakeLists.txt | 1 +
+ src/akregator_part.cpp | 10 ------
+ src/feed/feed.cpp | 3 +-
+ src/feed/feedretriever.cpp | 78 ++++++++++++++++++++++++++++++++++++++++++++++
+ src/feed/feedretriever.h | 54 ++++++++++++++++++++++++++++++++
+ 5 files changed, 135 insertions(+), 11 deletions(-)
+ create mode 100644 src/feed/feedretriever.cpp
+ create mode 100644 src/feed/feedretriever.h
+
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index 86af10e..312daee 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -86,6 +86,7 @@ set(akregatorprivate_LIB_SRCS
+ article.cpp
+ feed/feed.cpp
+ feed/feedlist.cpp
++ feed/feedretriever.cpp
+ treenode.cpp
+ treenodevisitor.cpp
+ utils.cpp
+diff --git a/src/akregator_part.cpp b/src/akregator_part.cpp
+index 74acfab..afde53f 100644
+--- a/src/akregator_part.cpp
++++ b/src/akregator_part.cpp
+@@ -259,14 +259,6 @@ Part::Part(QWidget *parentWidget, QObject *parent, const QVariantList &)
+ connect(m_autosaveTimer, &QTimer::timeout, this, &Part::slotSaveFeedList);
+ m_autosaveTimer->start(5 * 60 * 1000); // 5 minutes
+
+- QString useragent = QStringLiteral("Akregator/%1; syndication").arg(QStringLiteral(AKREGATOR_VERSION));
+-
+- if (!Settings::customUserAgent().isEmpty()) {
+- useragent = Settings::customUserAgent();
+- }
+-
+- Syndication::FileRetriever::setUserAgent(useragent);
+-
+ loadPlugins(QStringLiteral("extension")); // FIXME: also unload them!
+ if (mCentralWidget->previousSessionCrashed()) {
+ mCentralWidget->needToRestoreCrashedSession();
+@@ -361,8 +353,6 @@ void Part::slotSettingsChanged()
+ m_actionManager->setTrayIcon(nullptr);
+ }
+
+- Syndication::FileRetriever::setUseCache(Settings::useHTMLCache());
+-
+ const QStringList fonts {
+ Settings::standardFont(),
+ Settings::fixedFont(),
+diff --git a/src/feed/feed.cpp b/src/feed/feed.cpp
+index 87ba473..774f506 100644
+--- a/src/feed/feed.cpp
++++ b/src/feed/feed.cpp
+@@ -36,6 +36,7 @@
+ #include "treenodevisitor.h"
+ #include "types.h"
+ #include "utils.h"
++#include "feedretriever.h"
+
+ #include <Syndication/Syndication>
+
+@@ -681,7 +682,7 @@ void Akregator::Feed::tryFetch()
+ d->loader = Syndication::Loader::create(this, SLOT(fetchCompleted(Syndication::Loader *,
+ Syndication::FeedPtr,
+ Syndication::ErrorCode)));
+- d->loader->loadFrom(QUrl(d->xmlUrl));
++ d->loader->loadFrom(QUrl(d->xmlUrl), new FeedRetriever());
+ }
+
+ void Akregator::Feed::slotImageFetched(const QPixmap &image)
+diff --git a/src/feed/feedretriever.cpp b/src/feed/feedretriever.cpp
+new file mode 100644
+index 0000000..62526c4
+--- /dev/null
++++ b/src/feed/feedretriever.cpp
+@@ -0,0 +1,78 @@
++/*
++ This file is part of Akregator.
++
++ Copyright (C) 2018 Daniel Vrátil <dvratil@kde.org>
++
++ This program is free software; you can redistribute it and/or modify
++ it under the terms of the GNU General Public License as published by
++ the Free Software Foundation; either version 2 of the License, or
++ (at your option) any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ GNU General Public License for more details.
++
++ You should have received a copy of the GNU General Public License
++ along with this program; if not, write to the Free Software
++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
++
++ As a special exception, permission is given to link this program
++ with any edition of Qt, and distribute the resulting executable,
++ without including the source code for Qt in the source distribution.
++*/
++
++#include "feedretriever.h"
++#include "akregatorconfig.h"
++#include "akregator-version.h"
++
++#include <KIO/StoredTransferJob>
++
++#include <QUrl>
++
++using namespace Akregator;
++
++FeedRetriever::FeedRetriever()
++ : Syndication::DataRetriever()
++{
++}
++
++void FeedRetriever::retrieveData(const QUrl &url)
++{
++ QString userAgent = QStringLiteral("Akregator/%1; syndication").arg(QStringLiteral(AKREGATOR_VERSION));
++ if (!Settings::customUserAgent().isEmpty()) {
++ userAgent = Settings::customUserAgent();
++ }
++ bool useCache = Settings::useHTMLCache();
++
++ auto job = KIO::storedGet(url, KIO::NoReload, KIO::HideProgressInfo);
++ job->addMetaData(QStringLiteral("UserAgent"), userAgent);
++ job->addMetaData(QStringLiteral("cache"), useCache ? QStringLiteral("refresh") : QStringLiteral("reload"));
++ connect(job, &KJob::result, this, &FeedRetriever::getFinished);
++ mJob = job;
++ mJob->start();
++}
++
++int FeedRetriever::errorCode() const
++{
++ return mError;
++}
++
++void FeedRetriever::abort()
++{
++ if (mJob) {
++ mJob->kill();
++ mJob = nullptr;
++ }
++}
++
++void FeedRetriever::getFinished(KJob *job)
++{
++ if (job->error()) {
++ mError = job->error();
++ Q_EMIT dataRetrieved({}, false);
++ return;
++ }
++
++ Q_EMIT dataRetrieved(static_cast<KIO::StoredTransferJob*>(job)->data(), true);
++}
+diff --git a/src/feed/feedretriever.h b/src/feed/feedretriever.h
+new file mode 100644
+index 0000000..3a0ff3d
+--- /dev/null
++++ b/src/feed/feedretriever.h
+@@ -0,0 +1,54 @@
++/*
++ This file is part of Akregator.
++
++ Copyright (C) 2018 Daniel Vrátil <dvratil@kde.org>
++
++ This program is free software; you can redistribute it and/or modify
++ it under the terms of the GNU General Public License as published by
++ the Free Software Foundation; either version 2 of the License, or
++ (at your option) any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ GNU General Public License for more details.
++
++ You should have received a copy of the GNU General Public License
++ along with this program; if not, write to the Free Software
++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
++
++ As a special exception, permission is given to link this program
++ with any edition of Qt, and distribute the resulting executable,
++ without including the source code for Qt in the source distribution.
++*/
++
++#ifndef FEEDRETRIEVER_H_
++#define FEEDRETRIEVER_H_
++
++#include <syndication/dataretriever.h>
++
++class KJob;
++
++namespace Akregator {
++
++class FeedRetriever : public Syndication::DataRetriever
++{
++ Q_OBJECT
++public:
++ explicit FeedRetriever();
++
++ void retrieveData(const QUrl &url) override;
++ void abort() override;
++ int errorCode() const override;
++
++private Q_SLOTS:
++ void getFinished(KJob *job);
++
++private:
++ KJob *mJob = nullptr;
++ int mError = 0;
++};
++
++}
++
++#endif
+--
+cgit v0.11.2