1 |
commit: 7d2c6b47ac07745bb3ec057bd93543114038b945 |
2 |
Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue May 17 18:50:38 2022 +0000 |
4 |
Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue May 17 19:01:49 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7d2c6b47 |
7 |
|
8 |
kde-plasma/kdeplasma-addons: Backport 5.24.6 POTD wallpaper fixes |
9 |
|
10 |
Package-Manager: Portage-3.0.30, Repoman-3.0.3 |
11 |
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org> |
12 |
|
13 |
...-5.24.5-fix-potd-wallpapers-change-freq-1.patch | 47 ++++++++++++++ |
14 |
...-5.24.5-fix-potd-wallpapers-change-freq-2.patch | 44 +++++++++++++ |
15 |
.../kdeplasma-addons-5.24.5-r1.ebuild | 75 ++++++++++++++++++++++ |
16 |
3 files changed, 166 insertions(+) |
17 |
|
18 |
diff --git a/kde-plasma/kdeplasma-addons/files/kdeplasma-addons-5.24.5-fix-potd-wallpapers-change-freq-1.patch b/kde-plasma/kdeplasma-addons/files/kdeplasma-addons-5.24.5-fix-potd-wallpapers-change-freq-1.patch |
19 |
new file mode 100644 |
20 |
index 000000000000..5e692fa1fedb |
21 |
--- /dev/null |
22 |
+++ b/kde-plasma/kdeplasma-addons/files/kdeplasma-addons-5.24.5-fix-potd-wallpapers-change-freq-1.patch |
23 |
@@ -0,0 +1,47 @@ |
24 |
+From d3bb3dc1d96ef7d734503e6d78dc3ce35106a628 Mon Sep 17 00:00:00 2001 |
25 |
+From: Fushan Wen <qydwhotmail@×××××.com> |
26 |
+Date: Thu, 5 May 2022 10:16:45 +0800 |
27 |
+Subject: [PATCH] wallpapers/potd: Give random chooser a seed in |
28 |
+ simonstalenhagprovider |
29 |
+ |
30 |
+Make the seed depend on the current date. |
31 |
+ |
32 |
+CCBUG: 453391 |
33 |
+--- |
34 |
+ dataengines/potd/simonstalenhagprovider.cpp | 10 +++++++--- |
35 |
+ 1 file changed, 7 insertions(+), 3 deletions(-) |
36 |
+ |
37 |
+diff --git a/dataengines/potd/simonstalenhagprovider.cpp b/dataengines/potd/simonstalenhagprovider.cpp |
38 |
+index ebcb3423f..fe273ec79 100644 |
39 |
+--- a/dataengines/potd/simonstalenhagprovider.cpp |
40 |
++++ b/dataengines/potd/simonstalenhagprovider.cpp |
41 |
+@@ -6,10 +6,11 @@ |
42 |
+ |
43 |
+ #include "simonstalenhagprovider.h" |
44 |
+ |
45 |
++#include <random> |
46 |
++ |
47 |
+ #include <QDebug> |
48 |
+ #include <QJsonArray> |
49 |
+ #include <QJsonDocument> |
50 |
+-#include <QRandomGenerator> |
51 |
+ |
52 |
+ #include <KIO/Job> |
53 |
+ #include <KPluginFactory> |
54 |
+@@ -28,8 +29,11 @@ static QJsonValue randomArrayValueByKey(const QJsonObject &object, QLatin1String |
55 |
+ return result; |
56 |
+ } |
57 |
+ |
58 |
+- auto arraySize = array.size(); |
59 |
+- return array.at(QRandomGenerator::global()->bounded(arraySize)); |
60 |
++ // Plasma 5.24.0 release date |
61 |
++ std::mt19937 randomEngine(QDate(2022, 2, 3).daysTo(QDate::currentDate())); |
62 |
++ std::uniform_int_distribution<int> distrib(0, array.size() - 1); |
63 |
++ |
64 |
++ return array.at(distrib(randomEngine)); |
65 |
+ } |
66 |
+ |
67 |
+ SimonStalenhagProvider::SimonStalenhagProvider(QObject *parent, const QVariantList &args) |
68 |
+-- |
69 |
+GitLab |
70 |
+ |
71 |
|
72 |
diff --git a/kde-plasma/kdeplasma-addons/files/kdeplasma-addons-5.24.5-fix-potd-wallpapers-change-freq-2.patch b/kde-plasma/kdeplasma-addons/files/kdeplasma-addons-5.24.5-fix-potd-wallpapers-change-freq-2.patch |
73 |
new file mode 100644 |
74 |
index 000000000000..af9ef33516e9 |
75 |
--- /dev/null |
76 |
+++ b/kde-plasma/kdeplasma-addons/files/kdeplasma-addons-5.24.5-fix-potd-wallpapers-change-freq-2.patch |
77 |
@@ -0,0 +1,44 @@ |
78 |
+From 326ae3a24ccb1f1b526f4742a84e4ce24046effd Mon Sep 17 00:00:00 2001 |
79 |
+From: Fushan Wen <qydwhotmail@×××××.com> |
80 |
+Date: Thu, 5 May 2022 10:19:22 +0800 |
81 |
+Subject: [PATCH] wallpapers/potd: Give random chooser a seed in flickrprovider |
82 |
+ |
83 |
+Make the seed depend on the current date. |
84 |
+ |
85 |
+BUG: 453391 |
86 |
+FIXED-IN: 5.24.6 |
87 |
+--- |
88 |
+ dataengines/potd/flickrprovider.cpp | 9 +++++++-- |
89 |
+ 1 file changed, 7 insertions(+), 2 deletions(-) |
90 |
+ |
91 |
+diff --git a/dataengines/potd/flickrprovider.cpp b/dataengines/potd/flickrprovider.cpp |
92 |
+index fe542f2b5..3861bd700 100644 |
93 |
+--- a/dataengines/potd/flickrprovider.cpp |
94 |
++++ b/dataengines/potd/flickrprovider.cpp |
95 |
+@@ -7,8 +7,9 @@ |
96 |
+ |
97 |
+ #include "flickrprovider.h" |
98 |
+ |
99 |
++#include <random> |
100 |
++ |
101 |
+ #include <QDebug> |
102 |
+-#include <QRandomGenerator> |
103 |
+ #include <QRegularExpression> |
104 |
+ #include <QUrlQuery> |
105 |
+ |
106 |
+@@ -127,7 +128,11 @@ void FlickrProvider::xmlRequestFinished(KJob *_job) |
107 |
+ } |
108 |
+ |
109 |
+ if (m_photoList.begin() != m_photoList.end()) { |
110 |
+- QUrl url(m_photoList.at(QRandomGenerator::global()->bounded(m_photoList.size()))); |
111 |
++ // Plasma 5.24.0 release date |
112 |
++ std::mt19937 randomEngine(QDate(2022, 2, 3).daysTo(QDate::currentDate())); |
113 |
++ std::uniform_int_distribution<int> distrib(0, m_photoList.size() - 1); |
114 |
++ |
115 |
++ QUrl url(m_photoList.at(distrib(randomEngine))); |
116 |
+ KIO::StoredTransferJob *imageJob = KIO::storedGet(url, KIO::NoReload, KIO::HideProgressInfo); |
117 |
+ connect(imageJob, &KIO::StoredTransferJob::finished, this, &FlickrProvider::imageRequestFinished); |
118 |
+ } else { |
119 |
+-- |
120 |
+GitLab |
121 |
+ |
122 |
|
123 |
diff --git a/kde-plasma/kdeplasma-addons/kdeplasma-addons-5.24.5-r1.ebuild b/kde-plasma/kdeplasma-addons/kdeplasma-addons-5.24.5-r1.ebuild |
124 |
new file mode 100644 |
125 |
index 000000000000..9a10ede0eccc |
126 |
--- /dev/null |
127 |
+++ b/kde-plasma/kdeplasma-addons/kdeplasma-addons-5.24.5-r1.ebuild |
128 |
@@ -0,0 +1,75 @@ |
129 |
+# Copyright 1999-2022 Gentoo Authors |
130 |
+# Distributed under the terms of the GNU General Public License v2 |
131 |
+ |
132 |
+EAPI=8 |
133 |
+ |
134 |
+ECM_HANDBOOK="forceoptional" |
135 |
+KFMIN=5.90.0 |
136 |
+PVCUT=$(ver_cut 1-3) |
137 |
+QTMIN=5.15.2 |
138 |
+VIRTUALX_REQUIRED="test" |
139 |
+inherit ecm kde.org optfeature |
140 |
+ |
141 |
+DESCRIPTION="Extra Plasma applets and engines" |
142 |
+ |
143 |
+LICENSE="GPL-2 LGPL-2" |
144 |
+SLOT="5" |
145 |
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~x86" |
146 |
+IUSE="share webengine" |
147 |
+ |
148 |
+RESTRICT="test" # bug 727846 |
149 |
+ |
150 |
+DEPEND=" |
151 |
+ >=dev-qt/qtdbus-${QTMIN}:5 |
152 |
+ >=dev-qt/qtdeclarative-${QTMIN}:5 |
153 |
+ >=dev-qt/qtgui-${QTMIN}:5 |
154 |
+ >=dev-qt/qtwidgets-${QTMIN}:5 |
155 |
+ >=kde-frameworks/karchive-${KFMIN}:5 |
156 |
+ >=kde-frameworks/kcmutils-${KFMIN}:5 |
157 |
+ >=kde-frameworks/kcompletion-${KFMIN}:5 |
158 |
+ >=kde-frameworks/kconfig-${KFMIN}:5 |
159 |
+ >=kde-frameworks/kconfigwidgets-${KFMIN}:5 |
160 |
+ >=kde-frameworks/kcoreaddons-${KFMIN}:5 |
161 |
+ >=kde-frameworks/kdeclarative-${KFMIN}:5 |
162 |
+ >=kde-frameworks/kholidays-${KFMIN}:5 |
163 |
+ >=kde-frameworks/ki18n-${KFMIN}:5 |
164 |
+ >=kde-frameworks/kio-${KFMIN}:5 |
165 |
+ >=kde-frameworks/knewstuff-${KFMIN}:5 |
166 |
+ >=kde-frameworks/knotifications-${KFMIN}:5 |
167 |
+ >=kde-frameworks/kpackage-${KFMIN}:5 |
168 |
+ >=kde-frameworks/krunner-${KFMIN}:5 |
169 |
+ >=kde-frameworks/kservice-${KFMIN}:5 |
170 |
+ >=kde-frameworks/kunitconversion-${KFMIN}:5 |
171 |
+ >=kde-frameworks/kwidgetsaddons-${KFMIN}:5 |
172 |
+ >=kde-frameworks/kwindowsystem-${KFMIN}:5 |
173 |
+ >=kde-frameworks/kxmlgui-${KFMIN}:5 |
174 |
+ >=kde-frameworks/plasma-${KFMIN}:5 |
175 |
+ >=kde-frameworks/sonnet-${KFMIN}:5 |
176 |
+ share? ( >=kde-frameworks/purpose-${KFMIN}:5 ) |
177 |
+ webengine? ( >=dev-qt/qtwebengine-${QTMIN}:5 ) |
178 |
+" |
179 |
+RDEPEND="${DEPEND} |
180 |
+ >=dev-qt/qtquickcontrols-${QTMIN}:5 |
181 |
+ >=dev-qt/qtquickcontrols2-${QTMIN}:5 |
182 |
+ >=kde-plasma/plasma-workspace-${PVCUT}:5 |
183 |
+" |
184 |
+ |
185 |
+PATCHES=( |
186 |
+ "${FILESDIR}"/${P}-fix-potd-wallpapers-change-freq-{1,2}.patch # KDE-bug 453391 |
187 |
+) |
188 |
+ |
189 |
+src_configure() { |
190 |
+ local mycmakeargs=( |
191 |
+ $(cmake_use_find_package share KF5Purpose) |
192 |
+ $(cmake_use_find_package webengine Qt5WebEngine) |
193 |
+ ) |
194 |
+ |
195 |
+ ecm_src_configure |
196 |
+} |
197 |
+ |
198 |
+pkg_postinst() { |
199 |
+ if [[ -z "${REPLACING_VERSIONS}" ]]; then |
200 |
+ optfeature "Disk quota applet" sys-fs/quota |
201 |
+ fi |
202 |
+ ecm_pkg_postinst |
203 |
+} |