Gentoo Archives: gentoo-commits

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/kreport/, dev-libs/kreport/files/
Date: Wed, 01 Jun 2022 10:04:03
Message-Id: 1654077827.9dd923ee0825e6277f6ac48bee93324450f69f82.asturm@gentoo
1 commit: 9dd923ee0825e6277f6ac48bee93324450f69f82
2 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
3 AuthorDate: Wed Jun 1 09:44:17 2022 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Wed Jun 1 10:03:47 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9dd923ee
7
8 dev-libs/kreport: EAPI-8, python3.10, GCC-12, backport "3.2.1" fixes
9
10 - Fix commit 20ac57b5bde469aa43aa530c9fb006a2ed0328fc missing to disable
11 Qt5Webkit.
12
13 Closes: https://bugs.gentoo.org/845660
14 Package-Manager: Portage-3.0.30, Repoman-3.0.3
15 Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
16
17 .../kreport-3.2.0-Q_REQUIRED_RESULT-placing.patch | 54 +++++++
18 .../files/kreport-3.2.0-fix-cmake-config.patch | 35 +++++
19 .../files/kreport-3.2.0-fix-insane-delay.patch | 166 +++++++++++++++++++++
20 dev-libs/kreport/files/kreport-3.2.0-gcc12.patch | 26 ++++
21 dev-libs/kreport/kreport-3.2.0-r3.ebuild | 63 ++++++++
22 5 files changed, 344 insertions(+)
23
24 diff --git a/dev-libs/kreport/files/kreport-3.2.0-Q_REQUIRED_RESULT-placing.patch b/dev-libs/kreport/files/kreport-3.2.0-Q_REQUIRED_RESULT-placing.patch
25 new file mode 100644
26 index 000000000000..bb90243c688e
27 --- /dev/null
28 +++ b/dev-libs/kreport/files/kreport-3.2.0-Q_REQUIRED_RESULT-placing.patch
29 @@ -0,0 +1,54 @@
30 +From b37de83728dc7463dea37f71417560ae602f615d Mon Sep 17 00:00:00 2001
31 +From: Jaroslaw Staniek <staniek@×××.org>
32 +Date: Sat, 1 Feb 2020 19:07:52 +0100
33 +Subject: [PATCH] TRIVIAL Move Q_REQUIRED_RESULT to correct place
34 +
35 +This can fix builds for newer MSVC
36 +---
37 + src/common/KReportDataSource.h | 2 +-
38 + src/common/KReportPluginManager.h | 2 +-
39 + src/wrtembed/KReportDesigner.h | 2 +-
40 + 3 files changed, 3 insertions(+), 3 deletions(-)
41 +
42 +diff --git a/src/common/KReportDataSource.h b/src/common/KReportDataSource.h
43 +index 4761af6c..89490b47 100644
44 +--- a/src/common/KReportDataSource.h
45 ++++ b/src/common/KReportDataSource.h
46 +@@ -124,7 +124,7 @@ public:
47 + //! Creates a new instance with data source. Default implementation returns @c nullptr.
48 + //! @a source is implementation-specific identifier.
49 + //! Owner of the returned pointer is the caller.
50 +- virtual KReportDataSource* create(const QString &source) const Q_REQUIRED_RESULT;
51 ++ virtual Q_REQUIRED_RESULT KReportDataSource* create(const QString &source) const;
52 +
53 + private:
54 + Q_DISABLE_COPY(KReportDataSource)
55 +diff --git a/src/common/KReportPluginManager.h b/src/common/KReportPluginManager.h
56 +index a8c4efcf..9ea01804 100644
57 +--- a/src/common/KReportPluginManager.h
58 ++++ b/src/common/KReportPluginManager.h
59 +@@ -49,7 +49,7 @@ class KREPORT_EXPORT KReportPluginManager : public QObject
60 +
61 + KReportPluginInterface* plugin(const QString& id) const;
62 +
63 +- QList<QAction*> createActions(QObject *parent) Q_REQUIRED_RESULT;
64 ++ Q_REQUIRED_RESULT QList<QAction*> createActions(QObject *parent);
65 +
66 + private:
67 + // class for access to the constructor
68 +diff --git a/src/wrtembed/KReportDesigner.h b/src/wrtembed/KReportDesigner.h
69 +index 404c8fd4..b5b64a30 100644
70 +--- a/src/wrtembed/KReportDesigner.h
71 ++++ b/src/wrtembed/KReportDesigner.h
72 +@@ -106,7 +106,7 @@ public:
73 + @return Pointer to a new report section section object, ownership is transferred to
74 + the caller
75 + */
76 +- KReportDesignerSection* createSection() Q_REQUIRED_RESULT;
77 ++ Q_REQUIRED_RESULT KReportDesignerSection* createSection();
78 +
79 + /**
80 + @brief Deletes the section specified
81 +--
82 +GitLab
83 +
84
85 diff --git a/dev-libs/kreport/files/kreport-3.2.0-fix-cmake-config.patch b/dev-libs/kreport/files/kreport-3.2.0-fix-cmake-config.patch
86 new file mode 100644
87 index 000000000000..625a05bd7f21
88 --- /dev/null
89 +++ b/dev-libs/kreport/files/kreport-3.2.0-fix-cmake-config.patch
90 @@ -0,0 +1,35 @@
91 +From 4ce3e8a857f2540909e1c23b73beef62eb3ab5fa Mon Sep 17 00:00:00 2001
92 +From: jordi fita i mas <jfita@×××××××××.com>
93 +Date: Sat, 11 Apr 2020 22:37:20 +0200
94 +Subject: [PATCH] Add Qt5PrintSupport and KF5CoreAddons dependencies to CMake
95 + config
96 +
97 +Reviewers: staniek
98 +
99 +Reviewed By: staniek
100 +
101 +Subscribers: staniek
102 +
103 +Tags: #kreport
104 +
105 +Differential Revision: https://phabricator.kde.org/D28736
106 +---
107 + src/KReportConfig.cmake.in | 2 ++
108 + 1 file changed, 2 insertions(+)
109 +
110 +diff --git a/src/KReportConfig.cmake.in b/src/KReportConfig.cmake.in
111 +index 7d74122b..9828fcc1 100644
112 +--- a/src/KReportConfig.cmake.in
113 ++++ b/src/KReportConfig.cmake.in
114 +@@ -20,6 +20,8 @@ include(CMakeFindDependencyMacro)
115 + find_dependency(Qt5Core @REQUIRED_QT_VERSION@)
116 + find_dependency(Qt5Widgets @REQUIRED_QT_VERSION@)
117 + find_dependency(Qt5Xml @REQUIRED_QT_VERSION@)
118 ++find_dependency(Qt5PrintSupport @REQUIRED_QT_VERSION@)
119 ++find_dependency(KF5CoreAddons @REQUIRED_KF5_VERSION@)
120 + find_dependency(KPropertyWidgets @REQUIRED_KPROPERTY_VERSION@)
121 +
122 + include("${CMAKE_CURRENT_LIST_DIR}/KReportTargets.cmake")
123 +--
124 +GitLab
125 +
126
127 diff --git a/dev-libs/kreport/files/kreport-3.2.0-fix-insane-delay.patch b/dev-libs/kreport/files/kreport-3.2.0-fix-insane-delay.patch
128 new file mode 100644
129 index 000000000000..cf059f0ca829
130 --- /dev/null
131 +++ b/dev-libs/kreport/files/kreport-3.2.0-fix-insane-delay.patch
132 @@ -0,0 +1,166 @@
133 +From 779479c5474e080a857b2d80bdc86b9cab6531a0 Mon Sep 17 00:00:00 2001
134 +From: Jaroslaw Staniek <staniek@×××.org>
135 +Date: Fri, 1 Nov 2019 19:54:00 +0100
136 +Subject: [PATCH] Fix insane delay in report items creation
137 +
138 +Summary:
139 +Fix insane delay in report items creation by not instantiating hi-resolution QPrinter object for each item.
140 +
141 +To be honest I am not understanding the whole word-wrapping algorithm used here.
142 +
143 +Test Plan:
144 +Approach 1: Run KEXI and create report with large number of pages. Use at
145 +least one text element.
146 +Before the fix there's noticeable O(N) delay.
147 +
148 +Approach 2: Also if we enter static value for the text item the kreportexample
149 +app, there is noticeable delay on each key press before this fix.
150 +
151 +Expected: all is smooth after the fix.
152 +
153 +Reviewers: piggz
154 +
155 +Reviewed By: piggz
156 +
157 +Subscribers: Kexi-Devel-list
158 +
159 +Tags: #kreport
160 +
161 +Differential Revision: https://phabricator.kde.org/D25108
162 +---
163 + src/CMakeLists.txt | 2 ++
164 + src/common/KReportUtils_p.cpp | 14 +++++++++++---
165 + src/common/KReportUtils_p.h | 12 +++++++++++-
166 + src/items/text/KReportItemText.cpp | 11 ++++++-----
167 + 4 files changed, 30 insertions(+), 9 deletions(-)
168 +
169 +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
170 +index e15d5ca6..1cf0b389 100644
171 +--- a/src/CMakeLists.txt
172 ++++ b/src/CMakeLists.txt
173 +@@ -198,6 +198,8 @@ target_link_libraries(KReportUtilsPrivate
174 + Qt5::Widgets
175 + KF5::ConfigGui
176 + KF5::WidgetsAddons
177 ++ PRIVATE
178 ++ Qt5::PrintSupport
179 + )
180 +
181 + ecm_setup_version(${PROJECT_VERSION}
182 +diff --git a/src/common/KReportUtils_p.cpp b/src/common/KReportUtils_p.cpp
183 +index 5ac288bb..0fd90c2f 100644
184 +--- a/src/common/KReportUtils_p.cpp
185 ++++ b/src/common/KReportUtils_p.cpp
186 +@@ -1,5 +1,5 @@
187 + /* This file is part of the KDE project
188 +- Copyright (C) 2015-2016 Jarosław Staniek <staniek@×××.org>
189 ++ Copyright (C) 2015-2019 Jarosław Staniek <staniek@×××.org>
190 + Copyright (C) 2016 Adam Pigg <adam@××××××××.uk>
191 +
192 + This library is free software; you can redistribute it and/or
193 +@@ -26,13 +26,14 @@
194 + #include <KMessageBox>
195 +
196 + #include <QApplication>
197 ++#include <QDebug>
198 + #include <QDir>
199 + #include <QFileInfo>
200 ++#include <QGlobalStatic>
201 ++#include <QPrinter>
202 + #include <QRegularExpression>
203 + #include <QResource>
204 + #include <QStandardPaths>
205 +-#include <QDebug>
206 +-#include <QGlobalStatic>
207 +
208 + #ifdef Q_WS_X11
209 + #include <QX11Info>
210 +@@ -329,6 +330,13 @@ int dpiY()
211 + return s_instance->m_dpiY;
212 + }
213 +
214 ++Q_GLOBAL_STATIC_WITH_ARGS(QPrinter, s_printerInstance, (QPrinter::HighResolution))
215 ++
216 ++QPrinter* highResolutionPrinter()
217 ++{
218 ++ return s_printerInstance;
219 ++}
220 ++
221 + PageLayout::PageLayout() : QPageLayout(QPageSize(QPageSize::A4), QPageLayout::Portrait, QMarginsF(0,0,0,0))
222 + {
223 + }
224 +diff --git a/src/common/KReportUtils_p.h b/src/common/KReportUtils_p.h
225 +index 1d223f6e..9e4b111b 100644
226 +--- a/src/common/KReportUtils_p.h
227 ++++ b/src/common/KReportUtils_p.h
228 +@@ -1,5 +1,5 @@
229 + /* This file is part of the KDE project
230 +- Copyright (C) 2015-2016 Jarosław Staniek <staniek@×××.org>
231 ++ Copyright (C) 2015-2019 Jarosław Staniek <staniek@×××.org>
232 +
233 + This library is free software; you can redistribute it and/or
234 + modify it under the terms of the GNU Library General Public
235 +@@ -26,6 +26,8 @@
236 + #include <QRect>
237 + #include <QStandardPaths>
238 +
239 ++class QPrinter;
240 ++
241 + const bool DEFAULT_SHOW_GRID = true;
242 + const bool DEFAULT_SNAP_TO_GRID = true;
243 + const int DEFAULT_GRID_DIVISIONS = 4;
244 +@@ -173,6 +175,14 @@ int dpiX();
245 +
246 + int dpiY();
247 +
248 ++/*!
249 ++ * Returns a high-resolution printer
250 ++ *
251 ++ * The QPrinter(QPrinter::HighResolution)) instance is created on first call.
252 ++ * The global printer helps to optimize access to QPrinter when report items need it.
253 ++ */
254 ++QPrinter* highResolutionPrinter();
255 ++
256 + //! This class is wrapper that fixes a critical QTBUG-47551 bug in default constructor of QPageLayout
257 + //! Default constructor of QPageLayout does not initialize units.
258 + //! https://bugreports.qt.io/browse/QTBUG-47551
259 +diff --git a/src/items/text/KReportItemText.cpp b/src/items/text/KReportItemText.cpp
260 +index 29f63998..e05088fa 100644
261 +--- a/src/items/text/KReportItemText.cpp
262 ++++ b/src/items/text/KReportItemText.cpp
263 +@@ -1,5 +1,6 @@
264 + /* This file is part of the KDE project
265 + * Copyright (C) 2007-2008 by Adam Pigg (adam@××××××××.uk)
266 ++ * Copyright (C) 2019 Jarosław Staniek <staniek@×××.org>
267 + *
268 + * This library is free software; you can redistribute it and/or
269 + * modify it under the terms of the GNU Lesser General Public
270 +@@ -17,8 +18,9 @@
271 +
272 + #include "KReportItemText.h"
273 + #include "KReportRenderObjects.h"
274 +-#include "kreportplugin_debug.h"
275 + #include "KReportUtils.h"
276 ++#include "KReportUtils_p.h"
277 ++#include "kreportplugin_debug.h"
278 +
279 + #include <KPropertyListData>
280 + #include <KPropertySet>
281 +@@ -217,11 +219,10 @@ int KReportItemText::renderSimpleData(OROPage *page, OROSection *section, const
282 + int pos = 0;
283 + QChar separator;
284 + QRegularExpression re(QLatin1String("\\s"));
285 +- QPrinter prnt(QPrinter::HighResolution);
286 +- QFontMetricsF fm(font(), &prnt);
287 ++ const QFontMetricsF fm(font(), KReportPrivate::highResolutionPrinter());
288 +
289 +- // int intRectWidth = (int)(trf.width() * prnt.resolution()) - 10;
290 +- int intRectWidth = (int)((size().width() / 72) * prnt.resolution());
291 ++ const int intRectWidth
292 ++ = (int)((size().width() / 72) * KReportPrivate::highResolutionPrinter()->resolution());
293 + int intLineCounter = 0;
294 + qreal intBaseTop = trf.top();
295 + qreal intRectHeight = trf.height();
296 +--
297 +GitLab
298 +
299
300 diff --git a/dev-libs/kreport/files/kreport-3.2.0-gcc12.patch b/dev-libs/kreport/files/kreport-3.2.0-gcc12.patch
301 new file mode 100644
302 index 000000000000..ce48a27f1dc3
303 --- /dev/null
304 +++ b/dev-libs/kreport/files/kreport-3.2.0-gcc12.patch
305 @@ -0,0 +1,26 @@
306 +From 4b4b94f0bafcb49cefb1e453edd04a46d6ceacce Mon Sep 17 00:00:00 2001
307 +From: =?UTF-8?q?=C3=96mer=20Fad=C4=B1l=20Usta?= <omerusta@×××××.com>
308 +Date: Thu, 12 May 2022 05:01:48 +0000
309 +Subject: [PATCH] Fix build with GCC 12 (standard attributes in middle of
310 + decl-specifiers)
311 +
312 +---
313 + src/common/KReportDataSource.h | 2 +-
314 + 1 file changed, 1 insertion(+), 1 deletion(-)
315 +
316 +diff --git a/src/common/KReportDataSource.h b/src/common/KReportDataSource.h
317 +index 89490b47..0e45b644 100644
318 +--- a/src/common/KReportDataSource.h
319 ++++ b/src/common/KReportDataSource.h
320 +@@ -124,7 +124,7 @@ public:
321 + //! Creates a new instance with data source. Default implementation returns @c nullptr.
322 + //! @a source is implementation-specific identifier.
323 + //! Owner of the returned pointer is the caller.
324 +- virtual Q_REQUIRED_RESULT KReportDataSource* create(const QString &source) const;
325 ++ Q_REQUIRED_RESULT virtual KReportDataSource* create(const QString &source) const;
326 +
327 + private:
328 + Q_DISABLE_COPY(KReportDataSource)
329 +--
330 +GitLab
331 +
332
333 diff --git a/dev-libs/kreport/kreport-3.2.0-r3.ebuild b/dev-libs/kreport/kreport-3.2.0-r3.ebuild
334 new file mode 100644
335 index 000000000000..7eb744926983
336 --- /dev/null
337 +++ b/dev-libs/kreport/kreport-3.2.0-r3.ebuild
338 @@ -0,0 +1,63 @@
339 +# Copyright 1999-2022 Gentoo Authors
340 +# Distributed under the terms of the GNU General Public License v2
341 +
342 +EAPI=8
343 +
344 +ECM_QTHELP="true"
345 +ECM_TEST="true"
346 +PYTHON_COMPAT=( python3_{8..10} )
347 +KFMIN=5.82.0
348 +QTMIN=5.15.2
349 +VIRTUALX_REQUIRED="test"
350 +inherit ecm kde.org python-any-r1
351 +
352 +DESCRIPTION="Framework for creation and generation of reports in multiple formats"
353 +HOMEPAGE="https://community.kde.org/KReport"
354 +
355 +if [[ ${KDE_BUILD_TYPE} = release ]]; then
356 + SRC_URI="mirror://kde/stable/${PN}/src/${P}.tar.xz"
357 + KEYWORDS="~amd64 ~x86"
358 +fi
359 +
360 +LICENSE="LGPL-2+"
361 +SLOT="5/4"
362 +IUSE="marble +scripting"
363 +
364 +RDEPEND="
365 + >=dev-libs/kproperty-${PV}:5=
366 + >=dev-qt/qtgui-${QTMIN}:5
367 + >=dev-qt/qtprintsupport-${QTMIN}:5
368 + >=dev-qt/qtwidgets-${QTMIN}:5
369 + >=dev-qt/qtxml-${QTMIN}:5
370 + >=kde-frameworks/kconfig-${KFMIN}:5
371 + >=kde-frameworks/kcoreaddons-${KFMIN}:5
372 + >=kde-frameworks/kguiaddons-${KFMIN}:5
373 + >=kde-frameworks/kwidgetsaddons-${KFMIN}:5
374 + marble? ( kde-apps/marble:5= )
375 + scripting? ( >=dev-qt/qtdeclarative-${QTMIN}:5 )
376 +"
377 +DEPEND="${RDEPEND}
378 + ${PYTHON_DEPS}
379 +"
380 +
381 +PATCHES=(
382 + "${FILESDIR}/${P}-gcc10.patch"
383 + "${FILESDIR}/${P}-fix-insane-delay.patch"
384 + "${FILESDIR}/${P}-fix-cmake-config.patch"
385 + "${FILESDIR}/${P}-Q_REQUIRED_RESULT-placing.patch" # gcc12-patch dep
386 + "${FILESDIR}/${P}-gcc12.patch"
387 +)
388 +
389 +pkg_setup() {
390 + python-any-r1_pkg_setup
391 + ecm_pkg_setup
392 +}
393 +
394 +src_configure() {
395 + local mycmakeargs=(
396 + -DCMAKE_DISABLE_FIND_PACKAGE_Qt5WebKitWidgets=ON
397 + $(cmake_use_find_package marble Marble)
398 + -DKREPORT_SCRIPTING=$(usex scripting)
399 + )
400 + ecm_src_configure
401 +}