Gentoo Archives: gentoo-commits

From: Michael Palimaka <kensington@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/kde:master commit in: kde-apps/libakonadi/, kde-apps/libakonadi/files/
Date: Fri, 18 Dec 2015 16:04:12
Message-Id: 1450454621.6d1d167125f1054c910ed578e16233273e8cc43d.kensington@gentoo
1 commit: 6d1d167125f1054c910ed578e16233273e8cc43d
2 Author: Andreas Sturmlechner <andreas.sturmlechner <AT> gmail <DOT> com>
3 AuthorDate: Thu Dec 17 22:45:31 2015 +0000
4 Commit: Michael Palimaka <kensington <AT> gentoo <DOT> org>
5 CommitDate: Fri Dec 18 16:03:41 2015 +0000
6 URL: https://gitweb.gentoo.org/proj/kde.git/commit/?id=6d1d1671
7
8 kde-apps/libakonadi: Fix possible crash on exit
9
10 Package-Manager: portage-2.2.24
11
12 .../libakonadi-15.12.0-fix-possible-crash.patch | 59 +++++++++++++++
13 kde-apps/libakonadi/libakonadi-15.12.0-r1.ebuild | 83 ++++++++++++++++++++++
14 2 files changed, 142 insertions(+)
15
16 diff --git a/kde-apps/libakonadi/files/libakonadi-15.12.0-fix-possible-crash.patch b/kde-apps/libakonadi/files/libakonadi-15.12.0-fix-possible-crash.patch
17 new file mode 100644
18 index 0000000..5c3144c
19 --- /dev/null
20 +++ b/kde-apps/libakonadi/files/libakonadi-15.12.0-fix-possible-crash.patch
21 @@ -0,0 +1,59 @@
22 +From: Weng Xuetian <wengxt@×××××.com>
23 +Date: Thu, 17 Dec 2015 16:19:36 +0000
24 +Subject: Fix possible crash upon application exits (e.g. kmail)
25 +X-Git-Url: http://quickgit.kde.org/?p=kdepimlibs.git&a=commitdiff&h=c6bf33a9018587e96a350bfd0b2bffde1859db27
26 +---
27 +Fix possible crash upon application exits (e.g. kmail)
28 +
29 +Qt lambda connection will not automatically disconnect if no context
30 +qobject is provided. Since SessionPrivate is not a qobject, disconnect
31 +the connection in the destructor to prevent accessing deleted object.
32 +
33 +REVIEW: 126395
34 +---
35 +
36 +
37 +--- a/src/core/session.cpp
38 ++++ b/src/core/session.cpp
39 +@@ -301,15 +301,16 @@
40 + // Shutdown the thread before QApplication event loop quits - the
41 + // thread()->wait() mechanism in ConnectionThread dtor crashes sometimes
42 + // when called from QApplication destructor
43 +- QObject::connect(qApp, &QCoreApplication::aboutToQuit,
44 +- [this]() {
45 +- delete connThread;
46 +- connThread = Q_NULLPTR;
47 +- });
48 ++ connThreadCleanUp = QObject::connect(qApp, &QCoreApplication::aboutToQuit,
49 ++ [this]() {
50 ++ delete connThread;
51 ++ connThread = Q_NULLPTR;
52 ++ });
53 + }
54 +
55 + SessionPrivate::~SessionPrivate()
56 + {
57 ++ QObject::disconnect(connThreadCleanUp);
58 + delete connThread;
59 + }
60 +
61 +
62 +--- a/src/core/session_p.h
63 ++++ b/src/core/session_p.h
64 +@@ -29,6 +29,7 @@
65 +
66 + #include <QtCore/QQueue>
67 + #include <QtCore/QThreadStorage>
68 ++#include <QtCore/QMetaObject>
69 + #include <QFile>
70 +
71 + class QIODevice;
72 +@@ -125,6 +126,7 @@
73 + Session *mParent;
74 + QThread *thread;
75 + ConnectionThread *connThread;
76 ++ QMetaObject::Connection connThreadCleanUp;
77 + QByteArray sessionId;
78 + bool connected;
79 + qint64 theNextTag;
80 +
81
82 diff --git a/kde-apps/libakonadi/libakonadi-15.12.0-r1.ebuild b/kde-apps/libakonadi/libakonadi-15.12.0-r1.ebuild
83 new file mode 100644
84 index 0000000..391ec29
85 --- /dev/null
86 +++ b/kde-apps/libakonadi/libakonadi-15.12.0-r1.ebuild
87 @@ -0,0 +1,83 @@
88 +# Copyright 1999-2015 Gentoo Foundation
89 +# Distributed under the terms of the GNU General Public License v2
90 +# $Id$
91 +
92 +EAPI=5
93 +
94 +KDE_DOXYGEN=true
95 +KDE_TEST=true
96 +KMNAME=kdepimlibs
97 +VIRTUALX_REQUIRED=test
98 +inherit kde5
99 +
100 +DESCRIPTION="Common akonadi libraries for PIM apps"
101 +KEYWORDS="~amd64 ~x86"
102 +LICENSE="LGPL-2.1"
103 +IUSE="designer tools"
104 +
105 +# some akonadi tests time out, that probably needs more work as it's ~700 tests
106 +RESTRICT="test"
107 +
108 +COMMON_DEPEND="
109 + $(add_frameworks_dep kcompletion)
110 + $(add_frameworks_dep kconfig)
111 + $(add_frameworks_dep kconfigwidgets)
112 + $(add_frameworks_dep kcoreaddons)
113 + $(add_frameworks_dep kdbusaddons)
114 + $(add_frameworks_dep kdesignerplugin)
115 + $(add_frameworks_dep kguiaddons)
116 + $(add_frameworks_dep ki18n)
117 + $(add_frameworks_dep kiconthemes)
118 + $(add_frameworks_dep kio)
119 + $(add_frameworks_dep kitemmodels)
120 + $(add_frameworks_dep kitemviews)
121 + $(add_frameworks_dep kwidgetsaddons)
122 + $(add_frameworks_dep kwindowsystem)
123 + $(add_frameworks_dep kxmlgui)
124 + $(add_kdeapps_dep akonadi)
125 + dev-qt/qtdbus:5
126 + dev-qt/qtgui:5
127 + dev-qt/qtnetwork:5
128 + dev-qt/qtsql:5
129 + dev-qt/qtxml:5
130 + dev-qt/qtwidgets:5
131 + designer? ( dev-qt/designer:5 )
132 + tools? ( dev-libs/libxml2 )
133 +"
134 +DEPEND="${COMMON_DEPEND}
135 + dev-libs/boost
136 + sys-devel/gettext
137 +"
138 +RDEPEND="${COMMON_DEPEND}
139 + !kde-apps/kdepimlibs
140 + !kde-base/kdepimlibs:4
141 +"
142 +
143 +REQUIRED_USE="test? ( tools )"
144 +
145 +if [[ ${KDE_BUILD_TYPE} = live ]] ; then
146 + S="${WORKDIR}/${P}/akonadi"
147 +else
148 + S="${WORKDIR}/${KMNAME}-${PV}/akonadi"
149 +fi
150 +
151 +src_prepare() {
152 + epatch "${FILESDIR}/${PN}-15.11.80-testtools-optional.patch" \
153 + "${FILESDIR}/${PN}-15.12.0-fix-possible-crash.patch"
154 +
155 + if ! use tools ; then
156 + sed -e "/add_subdirectory(xml)/ s/^/#DONT/" \
157 + -i src/CMakeLists.txt || die
158 + fi
159 +
160 + kde5_src_prepare
161 +}
162 +
163 +src_configure() {
164 + local mycmakeargs=(
165 + $(cmake-utils_use_find_package designer Qt5Designer)
166 + $(cmake-utils_use_build tools)
167 + $(cmake-utils_use_build test TESTING)
168 + )
169 + kde5_src_configure
170 +}