kde-frameworks/ktexteditor: Fix runtime crash
authorAndreas Sturmlechner <asturm@gentoo.org>
Fri, 1 Nov 2019 19:37:32 +0000 (20:37 +0100)
committerAndreas Sturmlechner <asturm@gentoo.org>
Fri, 1 Nov 2019 19:39:05 +0000 (20:39 +0100)
See also: https://mail.kde.org/pipermail/kde-distro-packagers/2019-October/000389.html
KDE-Bug: https://bugs.kde.org/show_bug.cgi?id=413474
Package-Manager: Portage-2.3.78, Repoman-2.3.17
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
kde-frameworks/ktexteditor/files/ktexteditor-5.63.0-crashfix.patch [new file with mode: 0644]
kde-frameworks/ktexteditor/ktexteditor-5.63.0-r1.ebuild [new file with mode: 0644]

diff --git a/kde-frameworks/ktexteditor/files/ktexteditor-5.63.0-crashfix.patch b/kde-frameworks/ktexteditor/files/ktexteditor-5.63.0-crashfix.patch
new file mode 100644 (file)
index 0000000..f6c867c
--- /dev/null
@@ -0,0 +1,27 @@
+From f6e72a23052339253daa79095391625cf01c96f1 Mon Sep 17 00:00:00 2001
+From: Christoph Cullmann <cullmann@kde.org>
+Date: Mon, 28 Oct 2019 20:32:13 +0100
+Subject: fix crash
+
+BUG: 413474
+---
+ src/utils/katevariableexpansionhelpers.cpp | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/src/utils/katevariableexpansionhelpers.cpp b/src/utils/katevariableexpansionhelpers.cpp
+index db71d0f..89aab3d 100644
+--- a/src/utils/katevariableexpansionhelpers.cpp
++++ b/src/utils/katevariableexpansionhelpers.cpp
+@@ -278,7 +278,9 @@ KateVariableExpansionDialog::KateVariableExpansionDialog(QWidget *parent)
+     connect(m_listView, &QAbstractItemView::activated, [this, lblDescription, lblCurrentValue](const QModelIndex &index) {
+         if (index.isValid()) {
+             const auto &var = m_variables[m_filterModel->mapToSource(index).row()];
+-            const auto name = QStringLiteral("%{") + var.name() + QLatin1Char('}');
++
++            // not auto, don't fall for string builder, see bug 413474
++            const QString name = QStringLiteral("%{") + var.name() + QLatin1Char('}');
+             if (parentWidget() && parentWidget()->window()) {
+                 auto currentWidget = parentWidget()->window()->focusWidget();
+-- 
+cgit v1.1
diff --git a/kde-frameworks/ktexteditor/ktexteditor-5.63.0-r1.ebuild b/kde-frameworks/ktexteditor/ktexteditor-5.63.0-r1.ebuild
new file mode 100644 (file)
index 0000000..371a1c9
--- /dev/null
@@ -0,0 +1,58 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+VIRTUALX_REQUIRED="test"
+inherit kde5
+
+DESCRIPTION="Framework providing a full text editor component"
+LICENSE="LGPL-2+"
+KEYWORDS="~amd64 ~arm ~arm64 ~x86"
+IUSE="editorconfig git"
+
+BDEPEND="
+       test? ( $(add_frameworks_dep kservice) )
+"
+DEPEND="
+       $(add_frameworks_dep karchive)
+       $(add_frameworks_dep kauth)
+       $(add_frameworks_dep kcodecs)
+       $(add_frameworks_dep kcompletion)
+       $(add_frameworks_dep kconfig)
+       $(add_frameworks_dep kconfigwidgets)
+       $(add_frameworks_dep kcoreaddons)
+       $(add_frameworks_dep kguiaddons)
+       $(add_frameworks_dep ki18n)
+       $(add_frameworks_dep kiconthemes)
+       $(add_frameworks_dep kio)
+       $(add_frameworks_dep kitemviews)
+       $(add_frameworks_dep kjobwidgets)
+       $(add_frameworks_dep kparts)
+       $(add_frameworks_dep ktextwidgets)
+       $(add_frameworks_dep kwidgetsaddons)
+       $(add_frameworks_dep kxmlgui)
+       $(add_frameworks_dep sonnet)
+       $(add_frameworks_dep syntax-highlighting)
+       $(add_qt_dep qtdeclarative)
+       $(add_qt_dep qtgui)
+       $(add_qt_dep qtprintsupport)
+       $(add_qt_dep qtwidgets)
+       $(add_qt_dep qtxml)
+       editorconfig? ( app-text/editorconfig-core-c )
+       git? ( dev-libs/libgit2:= )
+"
+RDEPEND="${DEPEND}"
+
+RESTRICT+=" test"
+
+PATCHES=( "${FILESDIR}/${P}-crashfix.patch" )
+
+src_configure() {
+       local mycmakeargs=(
+               $(cmake-utils_use_find_package editorconfig EditorConfig)
+               $(cmake-utils_use_find_package git LibGit2)
+       )
+
+       kde5_src_configure
+}