Gentoo Archives: gentoo-commits

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-editors/kile/files/, app-editors/kile/
Date: Sun, 18 Oct 2020 15:47:58
Message-Id: 1603035854.7931d9873c4f988e34b873dc77213818c6e4e110.asturm@gentoo
1 commit: 7931d9873c4f988e34b873dc77213818c6e4e110
2 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
3 AuthorDate: Sat Oct 17 19:57:45 2020 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Sun Oct 18 15:44:14 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7931d987
7
8 app-editors/kile: Drop kde-frameworks/khtml dep, various fixes
9
10 - update HOMEPAGE while at it
11 - drop obsolete blocker
12
13 KDE-Bug: https://bugs.kde.org/show_bug.cgi?id=413473
14 KDE-Bug: https://bugs.kde.org/show_bug.cgi?id=413506
15 Package-Manager: Portage-3.0.8, Repoman-3.0.1
16 Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
17
18 ...-2.9.93-fix-crash-when-deleting-templates.patch | 35 +++++
19 .../files/kile-2.9.93-fix-ktoolbar-usage.patch | 25 ++++
20 ...-2.9.93-fix-overriding-existing-templates.patch | 164 +++++++++++++++++++++
21 app-editors/kile/files/kile-2.9.93-no-khtml.patch | 58 ++++++++
22 app-editors/kile/kile-2.9.93-r1.ebuild | 76 ++++++++++
23 5 files changed, 358 insertions(+)
24
25 diff --git a/app-editors/kile/files/kile-2.9.93-fix-crash-when-deleting-templates.patch b/app-editors/kile/files/kile-2.9.93-fix-crash-when-deleting-templates.patch
26 new file mode 100644
27 index 00000000000..232bd389483
28 --- /dev/null
29 +++ b/app-editors/kile/files/kile-2.9.93-fix-crash-when-deleting-templates.patch
30 @@ -0,0 +1,35 @@
31 +From 483743aa9f194376a8b496ac4e58a946070a36af Mon Sep 17 00:00:00 2001
32 +From: Michel Ludwig <michel.ludwig@×××××××.net>
33 +Date: Sun, 1 Dec 2019 09:09:55 +0100
34 +Subject: [PATCH] Don't crash when deleting templates
35 +
36 +BUG: 413506
37 +---
38 + src/dialogs/managetemplatesdialog.cpp | 11 -----------
39 + 1 file changed, 11 deletions(-)
40 +
41 +diff --git a/src/dialogs/managetemplatesdialog.cpp b/src/dialogs/managetemplatesdialog.cpp
42 +index fe6537ad..c5298b21 100644
43 +--- a/src/dialogs/managetemplatesdialog.cpp
44 ++++ b/src/dialogs/managetemplatesdialog.cpp
45 +@@ -317,17 +317,6 @@ bool ManageTemplatesDialog::removeTemplate()
46 +
47 + KileTemplate::Info templateInfo = templateItem->getTemplateInfo();
48 +
49 +- KIO::StatJob* statJob = KIO::stat(QUrl::fromUserInput(templateInfo.path), KIO::StatJob::DestinationSide, 0);
50 +- KIO::StatJob* statJob2 = KIO::stat(QUrl::fromUserInput(templateInfo.icon), KIO::StatJob::DestinationSide, 0);
51 +- KJobWidgets::setWindow(statJob, this);
52 +- KJobWidgets::setWindow(statJob2, this);
53 +- statJob->exec();
54 +- statJob2->exec();
55 +- if ((statJob->error() && statJob2->error()) || !QFileInfo(templateInfo.icon).exists()) {
56 +- KMessageBox::error(this, i18n("Sorry, but you do not have the necessary permissions to remove the selected template."));
57 +- return false;
58 +- }
59 +-
60 + if (KMessageBox::warningYesNo(this, i18n("You are about to remove the template \"%1\"; are you sure?", templateInfo.name)) == KMessageBox::No) {
61 + return false;
62 + }
63 +--
64 +GitLab
65 +
66
67 diff --git a/app-editors/kile/files/kile-2.9.93-fix-ktoolbar-usage.patch b/app-editors/kile/files/kile-2.9.93-fix-ktoolbar-usage.patch
68 new file mode 100644
69 index 00000000000..2afd0622ea3
70 --- /dev/null
71 +++ b/app-editors/kile/files/kile-2.9.93-fix-ktoolbar-usage.patch
72 @@ -0,0 +1,25 @@
73 +From 5c268679da2fb2cdc414890bdd79a5592e37cb22 Mon Sep 17 00:00:00 2001
74 +From: =?UTF-8?q?Andrius=20=C5=A0tikonas?= <andrius@××××××××.eu>
75 +Date: Tue, 15 Sep 2020 15:33:51 +0100
76 +Subject: [PATCH] Fix KToolbar usage.
77 +
78 +---
79 + src/widgets/scriptsmanagementwidget.cpp | 2 +-
80 + 1 file changed, 1 insertion(+), 1 deletion(-)
81 +
82 +diff --git a/src/widgets/scriptsmanagementwidget.cpp b/src/widgets/scriptsmanagementwidget.cpp
83 +index 79552da3..94f58f18 100644
84 +--- a/src/widgets/scriptsmanagementwidget.cpp
85 ++++ b/src/widgets/scriptsmanagementwidget.cpp
86 +@@ -66,7 +66,7 @@ ScriptsManagement::ScriptsManagement(KileInfo *kileInfo, QWidget *parent, const
87 + baseLayout->setContentsMargins(0, 0, 0, 0);
88 + setLayout(baseLayout);
89 +
90 +- m_toolBar = new KToolBar(this, "scriptControlToolBar");
91 ++ m_toolBar = new KToolBar("scriptControlToolBar", this);
92 + m_toolBar->setToolButtonStyle(Qt::ToolButtonIconOnly);
93 + m_toolBar->setIconDimensions(KIconLoader::SizeSmall);
94 +
95 +--
96 +GitLab
97 +
98
99 diff --git a/app-editors/kile/files/kile-2.9.93-fix-overriding-existing-templates.patch b/app-editors/kile/files/kile-2.9.93-fix-overriding-existing-templates.patch
100 new file mode 100644
101 index 00000000000..f303cff0b0f
102 --- /dev/null
103 +++ b/app-editors/kile/files/kile-2.9.93-fix-overriding-existing-templates.patch
104 @@ -0,0 +1,164 @@
105 +From 7a55cf2d93c9daa13f2fa2ec1ae25646507cfc0c Mon Sep 17 00:00:00 2001
106 +From: Michel Ludwig <michel.ludwig@×××××××.net>
107 +Date: Sun, 1 Dec 2019 15:56:05 +0100
108 +Subject: [PATCH] Fix overriding of existing templates
109 +
110 +Also, don't delete the original file after the template has been
111 +created from it.
112 +
113 +BUG: 413473
114 +
115 +* asturm 2020-10-17: backport to 2.9.93 (drop unnecessary string change)
116 +
117 +---
118 + src/dialogs/managetemplatesdialog.cpp | 7 ++-
119 + src/templates.cpp | 78 ++-------------------------
120 + src/templates.h | 10 ++--
121 + 3 files changed, 12 insertions(+), 83 deletions(-)
122 +
123 +diff --git a/src/dialogs/managetemplatesdialog.cpp b/src/dialogs/managetemplatesdialog.cpp
124 +index c5298b21..77d5d6ff 100644
125 +--- a/src/dialogs/managetemplatesdialog.cpp
126 ++++ b/src/dialogs/managetemplatesdialog.cpp
127 +@@ -292,11 +292,10 @@ void ManageTemplatesDialog::addTemplate()
128 + reject();
129 + return;
130 + }
131 +- returnValue = m_templateManager->replace(templateInfo, m_sourceURL, templateName, iconURL);
132 +- }
133 +- else {
134 +- returnValue = m_templateManager->add(m_sourceURL, templateName, iconURL);
135 + }
136 ++
137 ++ returnValue = m_templateManager->add(m_sourceURL, templateName, iconURL);
138 ++
139 + if (!returnValue) {
140 + KMessageBox::error(this, i18n("Failed to create the template."));
141 + reject();
142 +diff --git a/src/templates.cpp b/src/templates.cpp
143 +--- a/src/templates.cpp
144 ++++ b/src/templates.cpp
145 +@@ -82,7 +82,10 @@ bool Manager::copyAppData(const QUrl &src, const QString& subdir, const QString&
146 + testDir.mkpath(dir);
147 + }
148 + // copy file
149 +- KIO::FileCopyJob* copyJob = KIO::file_copy(src, targetURL);
150 ++ if(src == targetURL) { // copying a file over itself
151 ++ return true;
152 ++ }
153 ++ KIO::FileCopyJob* copyJob = KIO::file_copy(src, targetURL, -1, KIO::Overwrite);
154 + KJobWidgets::setWindow(copyJob, m_kileInfo->mainWindow());
155 + return copyJob->exec();
156 + }
157 +@@ -130,77 +133,6 @@ bool Manager::remove(Info ti) {
158 + return removeAppData(ti.path) && removeAppData(ti.icon);
159 + }
160 +
161 +-bool Manager::replace(const KileTemplate::Info& toBeReplaced, const QUrl &newTemplateSourceURL, const QString& newName, const QUrl& newIcon) {
162 +- KileDocument::Type type = m_kileInfo->extensions()->determineDocumentType(newTemplateSourceURL);
163 +-
164 +- //start by copying the files that belong to the new template to a safe place
165 +- QString templateTempFile, iconTempFile;
166 +-
167 +- if( newTemplateSourceURL.isLocalFile() ) {
168 +- // file protocol. We do not need the network
169 +- templateTempFile = newTemplateSourceURL.toLocalFile();
170 +- }
171 +- else {
172 +- QTemporaryFile tmpFile;
173 +- tmpFile.setAutoRemove( false );
174 +- tmpFile.open();
175 +-
176 +- templateTempFile = tmpFile.fileName();
177 +- m_TempFilePath = tmpFile.fileName();
178 +- KIO::FileCopyJob* fileCopyJob = KIO::file_copy( newTemplateSourceURL, QUrl::fromLocalFile(templateTempFile), -1, KIO::Overwrite );
179 +- KJobWidgets::setWindow( fileCopyJob, m_kileInfo->mainWindow() );
180 +-
181 +- if( ! fileCopyJob->exec() ) {
182 +- return false;
183 +- }
184 +- }
185 +-
186 +- if( newIcon.isLocalFile() ) {
187 +- // file protocol. We do not need the network
188 +- iconTempFile = newIcon.toLocalFile();
189 +- }
190 +- else {
191 +- QTemporaryFile tmpFile;
192 +- tmpFile.setAutoRemove( false );
193 +- tmpFile.open();
194 +-
195 +- iconTempFile = tmpFile.fileName();
196 +- m_TempFilePath = tmpFile.fileName();
197 +- KIO::FileCopyJob* fileCopyJob = KIO::file_copy( newIcon, QUrl::fromLocalFile(iconTempFile), -1, KIO::Overwrite );
198 +- KJobWidgets::setWindow( fileCopyJob, m_kileInfo->mainWindow() );
199 +-
200 +- if( ! fileCopyJob->exec() ) {
201 +- if( ! templateTempFile.isEmpty() )
202 +- QFile::remove( templateTempFile );
203 +- return false;
204 +- }
205 +- }
206 +-
207 +- //now delete the template that should be replaced
208 +- if(!remove(toBeReplaced)) {
209 +- if( ! templateTempFile.isEmpty() )
210 +- QFile::remove( templateTempFile );
211 +- if( ! iconTempFile.isEmpty() )
212 +- QFile::remove( iconTempFile );
213 +- }
214 +-
215 +- //finally, create the new template
216 +- if(!add(QUrl::fromUserInput(templateTempFile), type, newName, QUrl::fromUserInput(iconTempFile))) {
217 +- if( ! templateTempFile.isEmpty() )
218 +- QFile::remove( templateTempFile );
219 +- if( ! iconTempFile.isEmpty() )
220 +- QFile::remove( iconTempFile );
221 +- return false;
222 +- }
223 +-
224 +- if( ! templateTempFile.isEmpty() )
225 +- QFile::remove( templateTempFile );
226 +- if( ! iconTempFile.isEmpty() )
227 +- QFile::remove( iconTempFile );
228 +-
229 +- return true;
230 +-}
231 +-
232 + void Manager::scanForTemplates() {
233 + KILE_DEBUG_MAIN << "===scanForTemplates()===================";
234 + QStringList dirs = KileUtilities::locateAll(QStandardPaths::AppDataLocation, "templates", QStandardPaths::LocateDirectory);
235 +diff --git a/src/templates.h b/src/templates.h
236 +--- a/src/templates.h
237 ++++ b/src/templates.h
238 +@@ -1,7 +1,7 @@
239 + /***************************************************************************************
240 + begin : Sat Apr 26 2003
241 + copyright : (C) 2003 by Jeroen Wijnhout (wijnhout@×××××××××××.nl)
242 +- 2007, 2008 by Michel Ludwig (michel.ludwig@×××××××.net)
243 ++ 2007-2019 by Michel Ludwig (michel.ludwig@×××××××.net)
244 + ***************************************************************************************/
245 +
246 + /***************************************************************************
247 +@@ -79,15 +79,13 @@ public:
248 + **/
249 + bool searchForTemplate(const QString& name, KileDocument::Type& type) const;
250 +
251 +- // add a template in $HOME/kile/templates/
252 ++ // Add a template in .kde/share/kile/templates/
253 ++ // This function will override any existing template.
254 + bool add(const QUrl &templateSourceURL, const QString &name, const QUrl &icon);
255 +
256 +- // remove a template from $HOME/kile/templates/
257 ++ // Remove a template from .kde/share/kile/templates/
258 + bool remove(KileTemplate::Info ti);
259 +
260 +- // replaces a template
261 +- bool replace(const KileTemplate::Info& toBeReplaced, const QUrl &newTemplateSourceURL, const QString& newName, const QUrl& newIcon);
262 +-
263 + // these have to be methods as we cannot use i18n calls in global objects
264 + static QString defaultEmptyTemplateCaption();
265 + static QString defaultEmptyLaTeXTemplateCaption();
266 +--
267 +GitLab
268 +
269
270 diff --git a/app-editors/kile/files/kile-2.9.93-no-khtml.patch b/app-editors/kile/files/kile-2.9.93-no-khtml.patch
271 new file mode 100644
272 index 00000000000..cf055fc8449
273 --- /dev/null
274 +++ b/app-editors/kile/files/kile-2.9.93-no-khtml.patch
275 @@ -0,0 +1,58 @@
276 +From 7c050b5e306cab115573aea1bfc951aaaa1203e9 Mon Sep 17 00:00:00 2001
277 +From: Michel Ludwig <michel.ludwig@×××××××.net>
278 +Date: Fri, 22 Nov 2019 09:40:53 +0100
279 +Subject: [PATCH] Remove dependency on KHTML
280 +
281 +---
282 + CMakeLists.txt | 1 -
283 + src/CMakeLists.txt | 2 --
284 + src/kilelauncher.cpp | 1 -
285 + 3 files changed, 4 deletions(-)
286 +
287 +diff --git a/CMakeLists.txt b/CMakeLists.txt
288 +index 1bea621f..1b25e3a4 100644
289 +--- a/CMakeLists.txt
290 ++++ b/CMakeLists.txt
291 +@@ -46,7 +46,6 @@ find_package(KF5 5.31 REQUIRED COMPONENTS
292 + I18n
293 + IconThemes
294 + Init
295 +- KHtml
296 + KIO
297 + Parts
298 + TextEditor
299 +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
300 +index 77626894..e23480fd 100644
301 +--- a/src/CMakeLists.txt
302 ++++ b/src/CMakeLists.txt
303 +@@ -55,7 +55,6 @@ set(kile_SRCS
304 + dialogs/usermenu/usermenuitem.cpp
305 + dialogs/usermenu/usermenutree.cpp
306 + dialogs/validatorinputdialog.cpp
307 +- docpart.cpp
308 + documentinfo.cpp
309 + editorcommands.cpp
310 + editorextension.cpp
311 +@@ -238,7 +237,6 @@ PUBLIC
312 + KF5::Crash
313 + KF5::DBusAddons
314 + KF5::GuiAddons
315 +- KF5::KHtml
316 + KF5::I18n
317 + KF5::IconThemes
318 + KF5::KIOCore
319 +diff --git a/src/kilelauncher.cpp b/src/kilelauncher.cpp
320 +index c0bcdf9d..24a1f5b4 100644
321 +--- a/src/kilelauncher.cpp
322 ++++ b/src/kilelauncher.cpp
323 +@@ -16,7 +16,6 @@
324 +
325 + #include <config.h>
326 +
327 +-#include "docpart.h"
328 + #include "kileconfig.h"
329 + #include "kileinfo.h"
330 + #include "kiletool.h"
331 +--
332 +GitLab
333 +
334
335 diff --git a/app-editors/kile/kile-2.9.93-r1.ebuild b/app-editors/kile/kile-2.9.93-r1.ebuild
336 new file mode 100644
337 index 00000000000..853588a26eb
338 --- /dev/null
339 +++ b/app-editors/kile/kile-2.9.93-r1.ebuild
340 @@ -0,0 +1,76 @@
341 +# Copyright 1999-2020 Gentoo Authors
342 +# Distributed under the terms of the GNU General Public License v2
343 +
344 +EAPI=7
345 +
346 +ECM_HANDBOOK="forceoptional"
347 +KDE_ORG_CATEGORY="office"
348 +KFMIN=5.74.0
349 +QTMIN=5.14.2
350 +inherit ecm kde.org
351 +
352 +DESCRIPTION="Latex Editor and TeX shell based on KDE Frameworks"
353 +HOMEPAGE="https://kde.org/applications/en/kile https://kile.sourceforge.io/"
354 +
355 +if [[ ${KDE_BUILD_TYPE} == release ]]; then
356 + SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
357 + KEYWORDS="~amd64 ~x86"
358 +fi
359 +
360 +LICENSE="FDL-1.2 GPL-2"
361 +SLOT="5"
362 +IUSE="+pdf +png"
363 +
364 +DEPEND="
365 + >=dev-qt/qtdbus-${QTMIN}:5
366 + >=dev-qt/qtscript-${QTMIN}:5
367 + >=dev-qt/qttest-${QTMIN}:5
368 + >=dev-qt/qtwidgets-${QTMIN}:5
369 + kde-apps/okular:5
370 + >=kde-frameworks/kconfig-${KFMIN}:5
371 + >=kde-frameworks/kcoreaddons-${KFMIN}:5
372 + >=kde-frameworks/kcrash-${KFMIN}:5
373 + >=kde-frameworks/kdbusaddons-${KFMIN}:5
374 + >=kde-frameworks/kdoctools-${KFMIN}:5
375 + >=kde-frameworks/kguiaddons-${KFMIN}:5
376 + >=kde-frameworks/ki18n-${KFMIN}:5
377 + >=kde-frameworks/kiconthemes-${KFMIN}:5
378 + >=kde-frameworks/kinit-${KFMIN}:5
379 + >=kde-frameworks/kio-${KFMIN}:5
380 + >=kde-frameworks/kparts-${KFMIN}:5
381 + >=kde-frameworks/ktexteditor-${KFMIN}:5
382 + >=kde-frameworks/kwindowsystem-${KFMIN}:5
383 + >=kde-frameworks/kxmlgui-${KFMIN}:5
384 + pdf? ( app-text/poppler[qt5] )
385 +"
386 +RDEPEND="${DEPEND}
387 + kde-apps/konsole:5
388 + kde-apps/okular:5[pdf?]
389 + virtual/latex-base
390 + virtual/tex-base
391 + pdf? (
392 + app-text/ghostscript-gpl
393 + app-text/texlive-core
394 + )
395 + png? (
396 + app-text/dvipng
397 + virtual/imagemagick-tools[png?]
398 + )
399 +"
400 +
401 +DOCS=( AUTHORS ChangeLog kile-remote-control.txt README{,.cwl} )
402 +
403 +PATCHES=(
404 + "${FILESDIR}/${P}-cmake.patch"
405 + "${FILESDIR}/${P}-no-khtml.patch"
406 + "${FILESDIR}/${P}-fix-crash-when-deleting-templates.patch"
407 + "${FILESDIR}/${P}-fix-overriding-existing-templates.patch"
408 + "${FILESDIR}/${P}-fix-ktoolbar-usage.patch"
409 +)
410 +
411 +src_configure() {
412 + local mycmakeargs=(
413 + $(cmake_use_find_package pdf Poppler)
414 + )
415 + ecm_src_configure
416 +}