1 |
commit: 6d9d48a6e22660c15e07daf03c8319d2741f071a |
2 |
Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Oct 5 22:40:56 2018 +0000 |
4 |
Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Oct 5 22:42:04 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6d9d48a6 |
7 |
|
8 |
kde-apps/akregator: Fix build with kde-frameworks/syndication |
9 |
|
10 |
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org> |
11 |
Package-Manager: Portage-2.3.50, Repoman-2.3.11 |
12 |
|
13 |
kde-apps/akregator/akregator-18.04.3-r1.ebuild | 60 ++++++ |
14 |
.../files/akregator-18.04.3-syndication.patch | 222 +++++++++++++++++++++ |
15 |
2 files changed, 282 insertions(+) |
16 |
|
17 |
diff --git a/kde-apps/akregator/akregator-18.04.3-r1.ebuild b/kde-apps/akregator/akregator-18.04.3-r1.ebuild |
18 |
new file mode 100644 |
19 |
index 00000000000..8f0cffe52ef |
20 |
--- /dev/null |
21 |
+++ b/kde-apps/akregator/akregator-18.04.3-r1.ebuild |
22 |
@@ -0,0 +1,60 @@ |
23 |
+# Copyright 1999-2018 Gentoo Authors |
24 |
+# Distributed under the terms of the GNU General Public License v2 |
25 |
+ |
26 |
+EAPI=6 |
27 |
+ |
28 |
+KDE_HANDBOOK="forceoptional" |
29 |
+KDE_TEST="forceoptional" |
30 |
+inherit kde5 |
31 |
+ |
32 |
+DESCRIPTION="News feed aggregator" |
33 |
+HOMEPAGE="https://www.kde.org/applications/internet/akregator" |
34 |
+LICENSE="GPL-2+ handbook? ( FDL-1.2+ )" |
35 |
+KEYWORDS="~amd64 ~x86" |
36 |
+ |
37 |
+IUSE="" |
38 |
+ |
39 |
+COMMON_DEPEND=" |
40 |
+ $(add_frameworks_dep kcmutils) |
41 |
+ $(add_frameworks_dep kcodecs) |
42 |
+ $(add_frameworks_dep kcompletion) |
43 |
+ $(add_frameworks_dep kconfig) |
44 |
+ $(add_frameworks_dep kconfigwidgets) |
45 |
+ $(add_frameworks_dep kcoreaddons) |
46 |
+ $(add_frameworks_dep kcrash) |
47 |
+ $(add_frameworks_dep ki18n) |
48 |
+ $(add_frameworks_dep kiconthemes) |
49 |
+ $(add_frameworks_dep kio) |
50 |
+ $(add_frameworks_dep kjobwidgets) |
51 |
+ $(add_frameworks_dep knotifications) |
52 |
+ $(add_frameworks_dep knotifyconfig) |
53 |
+ $(add_frameworks_dep kparts) |
54 |
+ $(add_frameworks_dep kservice) |
55 |
+ $(add_frameworks_dep ktextwidgets) |
56 |
+ $(add_frameworks_dep kwidgetsaddons) |
57 |
+ $(add_frameworks_dep kxmlgui) |
58 |
+ $(add_frameworks_dep syndication) |
59 |
+ $(add_kdeapps_dep grantleetheme) |
60 |
+ $(add_kdeapps_dep kontactinterface) |
61 |
+ $(add_kdeapps_dep kpimtextedit) |
62 |
+ $(add_kdeapps_dep libkdepim) |
63 |
+ $(add_kdeapps_dep messagelib) |
64 |
+ $(add_kdeapps_dep pimcommon) |
65 |
+ $(add_qt_dep qtdbus) |
66 |
+ $(add_qt_dep qtgui) |
67 |
+ $(add_qt_dep qtnetwork) |
68 |
+ $(add_qt_dep qtwebengine) |
69 |
+ $(add_qt_dep qtwidgets) |
70 |
+ $(add_qt_dep qtxml) |
71 |
+" |
72 |
+DEPEND="${COMMON_DEPEND} |
73 |
+ dev-libs/grantlee:5 |
74 |
+" |
75 |
+RDEPEND="${COMMON_DEPEND} |
76 |
+ !kde-apps/kdepim-l10n |
77 |
+" |
78 |
+ |
79 |
+PATCHES=( |
80 |
+ "${FILESDIR}/${PN}-17.12.2-crashfix.patch" |
81 |
+ "${FILESDIR}/${P}-syndication.patch" |
82 |
+) |
83 |
|
84 |
diff --git a/kde-apps/akregator/files/akregator-18.04.3-syndication.patch b/kde-apps/akregator/files/akregator-18.04.3-syndication.patch |
85 |
new file mode 100644 |
86 |
index 00000000000..f20f8fffa93 |
87 |
--- /dev/null |
88 |
+++ b/kde-apps/akregator/files/akregator-18.04.3-syndication.patch |
89 |
@@ -0,0 +1,222 @@ |
90 |
+From d2797fe48b6d4429cd30163fd75003118400511f Mon Sep 17 00:00:00 2001 |
91 |
+From: =?UTF-8?q?Daniel=20Vr=C3=A1til?= <dvratil@×××.org> |
92 |
+Date: Sun, 22 Apr 2018 09:13:45 +0200 |
93 |
+Subject: Port away from remove Syndication API |
94 |
+ |
95 |
+--- |
96 |
+ src/CMakeLists.txt | 1 + |
97 |
+ src/akregator_part.cpp | 10 ------ |
98 |
+ src/feed/feed.cpp | 3 +- |
99 |
+ src/feed/feedretriever.cpp | 78 ++++++++++++++++++++++++++++++++++++++++++++++ |
100 |
+ src/feed/feedretriever.h | 54 ++++++++++++++++++++++++++++++++ |
101 |
+ 5 files changed, 135 insertions(+), 11 deletions(-) |
102 |
+ create mode 100644 src/feed/feedretriever.cpp |
103 |
+ create mode 100644 src/feed/feedretriever.h |
104 |
+ |
105 |
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt |
106 |
+index 86af10e..312daee 100644 |
107 |
+--- a/src/CMakeLists.txt |
108 |
++++ b/src/CMakeLists.txt |
109 |
+@@ -86,6 +86,7 @@ set(akregatorprivate_LIB_SRCS |
110 |
+ article.cpp |
111 |
+ feed/feed.cpp |
112 |
+ feed/feedlist.cpp |
113 |
++ feed/feedretriever.cpp |
114 |
+ treenode.cpp |
115 |
+ treenodevisitor.cpp |
116 |
+ utils.cpp |
117 |
+diff --git a/src/akregator_part.cpp b/src/akregator_part.cpp |
118 |
+index 74acfab..afde53f 100644 |
119 |
+--- a/src/akregator_part.cpp |
120 |
++++ b/src/akregator_part.cpp |
121 |
+@@ -259,14 +259,6 @@ Part::Part(QWidget *parentWidget, QObject *parent, const QVariantList &) |
122 |
+ connect(m_autosaveTimer, &QTimer::timeout, this, &Part::slotSaveFeedList); |
123 |
+ m_autosaveTimer->start(5 * 60 * 1000); // 5 minutes |
124 |
+ |
125 |
+- QString useragent = QStringLiteral("Akregator/%1; syndication").arg(QStringLiteral(AKREGATOR_VERSION)); |
126 |
+- |
127 |
+- if (!Settings::customUserAgent().isEmpty()) { |
128 |
+- useragent = Settings::customUserAgent(); |
129 |
+- } |
130 |
+- |
131 |
+- Syndication::FileRetriever::setUserAgent(useragent); |
132 |
+- |
133 |
+ loadPlugins(QStringLiteral("extension")); // FIXME: also unload them! |
134 |
+ if (mCentralWidget->previousSessionCrashed()) { |
135 |
+ mCentralWidget->needToRestoreCrashedSession(); |
136 |
+@@ -361,8 +353,6 @@ void Part::slotSettingsChanged() |
137 |
+ m_actionManager->setTrayIcon(nullptr); |
138 |
+ } |
139 |
+ |
140 |
+- Syndication::FileRetriever::setUseCache(Settings::useHTMLCache()); |
141 |
+- |
142 |
+ const QStringList fonts { |
143 |
+ Settings::standardFont(), |
144 |
+ Settings::fixedFont(), |
145 |
+diff --git a/src/feed/feed.cpp b/src/feed/feed.cpp |
146 |
+index 87ba473..774f506 100644 |
147 |
+--- a/src/feed/feed.cpp |
148 |
++++ b/src/feed/feed.cpp |
149 |
+@@ -36,6 +36,7 @@ |
150 |
+ #include "treenodevisitor.h" |
151 |
+ #include "types.h" |
152 |
+ #include "utils.h" |
153 |
++#include "feedretriever.h" |
154 |
+ |
155 |
+ #include <Syndication/Syndication> |
156 |
+ |
157 |
+@@ -681,7 +682,7 @@ void Akregator::Feed::tryFetch() |
158 |
+ d->loader = Syndication::Loader::create(this, SLOT(fetchCompleted(Syndication::Loader *, |
159 |
+ Syndication::FeedPtr, |
160 |
+ Syndication::ErrorCode))); |
161 |
+- d->loader->loadFrom(QUrl(d->xmlUrl)); |
162 |
++ d->loader->loadFrom(QUrl(d->xmlUrl), new FeedRetriever()); |
163 |
+ } |
164 |
+ |
165 |
+ void Akregator::Feed::slotImageFetched(const QPixmap &image) |
166 |
+diff --git a/src/feed/feedretriever.cpp b/src/feed/feedretriever.cpp |
167 |
+new file mode 100644 |
168 |
+index 0000000..62526c4 |
169 |
+--- /dev/null |
170 |
++++ b/src/feed/feedretriever.cpp |
171 |
+@@ -0,0 +1,78 @@ |
172 |
++/* |
173 |
++ This file is part of Akregator. |
174 |
++ |
175 |
++ Copyright (C) 2018 Daniel Vrátil <dvratil@×××.org> |
176 |
++ |
177 |
++ This program is free software; you can redistribute it and/or modify |
178 |
++ it under the terms of the GNU General Public License as published by |
179 |
++ the Free Software Foundation; either version 2 of the License, or |
180 |
++ (at your option) any later version. |
181 |
++ |
182 |
++ This program is distributed in the hope that it will be useful, |
183 |
++ but WITHOUT ANY WARRANTY; without even the implied warranty of |
184 |
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
185 |
++ GNU General Public License for more details. |
186 |
++ |
187 |
++ You should have received a copy of the GNU General Public License |
188 |
++ along with this program; if not, write to the Free Software |
189 |
++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
190 |
++ |
191 |
++ As a special exception, permission is given to link this program |
192 |
++ with any edition of Qt, and distribute the resulting executable, |
193 |
++ without including the source code for Qt in the source distribution. |
194 |
++*/ |
195 |
++ |
196 |
++#include "feedretriever.h" |
197 |
++#include "akregatorconfig.h" |
198 |
++#include "akregator-version.h" |
199 |
++ |
200 |
++#include <KIO/StoredTransferJob> |
201 |
++ |
202 |
++#include <QUrl> |
203 |
++ |
204 |
++using namespace Akregator; |
205 |
++ |
206 |
++FeedRetriever::FeedRetriever() |
207 |
++ : Syndication::DataRetriever() |
208 |
++{ |
209 |
++} |
210 |
++ |
211 |
++void FeedRetriever::retrieveData(const QUrl &url) |
212 |
++{ |
213 |
++ QString userAgent = QStringLiteral("Akregator/%1; syndication").arg(QStringLiteral(AKREGATOR_VERSION)); |
214 |
++ if (!Settings::customUserAgent().isEmpty()) { |
215 |
++ userAgent = Settings::customUserAgent(); |
216 |
++ } |
217 |
++ bool useCache = Settings::useHTMLCache(); |
218 |
++ |
219 |
++ auto job = KIO::storedGet(url, KIO::NoReload, KIO::HideProgressInfo); |
220 |
++ job->addMetaData(QStringLiteral("UserAgent"), userAgent); |
221 |
++ job->addMetaData(QStringLiteral("cache"), useCache ? QStringLiteral("refresh") : QStringLiteral("reload")); |
222 |
++ connect(job, &KJob::result, this, &FeedRetriever::getFinished); |
223 |
++ mJob = job; |
224 |
++ mJob->start(); |
225 |
++} |
226 |
++ |
227 |
++int FeedRetriever::errorCode() const |
228 |
++{ |
229 |
++ return mError; |
230 |
++} |
231 |
++ |
232 |
++void FeedRetriever::abort() |
233 |
++{ |
234 |
++ if (mJob) { |
235 |
++ mJob->kill(); |
236 |
++ mJob = nullptr; |
237 |
++ } |
238 |
++} |
239 |
++ |
240 |
++void FeedRetriever::getFinished(KJob *job) |
241 |
++{ |
242 |
++ if (job->error()) { |
243 |
++ mError = job->error(); |
244 |
++ Q_EMIT dataRetrieved({}, false); |
245 |
++ return; |
246 |
++ } |
247 |
++ |
248 |
++ Q_EMIT dataRetrieved(static_cast<KIO::StoredTransferJob*>(job)->data(), true); |
249 |
++} |
250 |
+diff --git a/src/feed/feedretriever.h b/src/feed/feedretriever.h |
251 |
+new file mode 100644 |
252 |
+index 0000000..3a0ff3d |
253 |
+--- /dev/null |
254 |
++++ b/src/feed/feedretriever.h |
255 |
+@@ -0,0 +1,54 @@ |
256 |
++/* |
257 |
++ This file is part of Akregator. |
258 |
++ |
259 |
++ Copyright (C) 2018 Daniel Vrátil <dvratil@×××.org> |
260 |
++ |
261 |
++ This program is free software; you can redistribute it and/or modify |
262 |
++ it under the terms of the GNU General Public License as published by |
263 |
++ the Free Software Foundation; either version 2 of the License, or |
264 |
++ (at your option) any later version. |
265 |
++ |
266 |
++ This program is distributed in the hope that it will be useful, |
267 |
++ but WITHOUT ANY WARRANTY; without even the implied warranty of |
268 |
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
269 |
++ GNU General Public License for more details. |
270 |
++ |
271 |
++ You should have received a copy of the GNU General Public License |
272 |
++ along with this program; if not, write to the Free Software |
273 |
++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
274 |
++ |
275 |
++ As a special exception, permission is given to link this program |
276 |
++ with any edition of Qt, and distribute the resulting executable, |
277 |
++ without including the source code for Qt in the source distribution. |
278 |
++*/ |
279 |
++ |
280 |
++#ifndef FEEDRETRIEVER_H_ |
281 |
++#define FEEDRETRIEVER_H_ |
282 |
++ |
283 |
++#include <syndication/dataretriever.h> |
284 |
++ |
285 |
++class KJob; |
286 |
++ |
287 |
++namespace Akregator { |
288 |
++ |
289 |
++class FeedRetriever : public Syndication::DataRetriever |
290 |
++{ |
291 |
++ Q_OBJECT |
292 |
++public: |
293 |
++ explicit FeedRetriever(); |
294 |
++ |
295 |
++ void retrieveData(const QUrl &url) override; |
296 |
++ void abort() override; |
297 |
++ int errorCode() const override; |
298 |
++ |
299 |
++private Q_SLOTS: |
300 |
++ void getFinished(KJob *job); |
301 |
++ |
302 |
++private: |
303 |
++ KJob *mJob = nullptr; |
304 |
++ int mError = 0; |
305 |
++}; |
306 |
++ |
307 |
++} |
308 |
++ |
309 |
++#endif |
310 |
+-- |
311 |
+cgit v0.11.2 |