Gentoo Archives: gentoo-commits

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: mail-client/trojita/, mail-client/trojita/files/
Date: Sun, 28 Jun 2020 21:55:46
Message-Id: 1593381322.79f45c1d2526dd37f1bc7a25b8f7feb13ad4575c.asturm@gentoo
1 commit: 79f45c1d2526dd37f1bc7a25b8f7feb13ad4575c
2 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jun 28 20:55:39 2020 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Sun Jun 28 21:55:22 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=79f45c1d
7
8 mail-client/trojita: Fix build with IUSE=test and >=Qt-5.13
9
10 Closes: https://bugs.gentoo.org/730058
11 Package-Manager: Portage-2.3.103, Repoman-2.3.23
12 Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
13
14 .../trojita/files/trojita-0.7-cmake-cxx11.patch | 66 ++++++++++++++++++++++
15 .../trojita/files/trojita-0.7-qt-5.13.patch | 37 ++++++++++++
16 mail-client/trojita/trojita-0.7-r4.ebuild | 2 +
17 3 files changed, 105 insertions(+)
18
19 diff --git a/mail-client/trojita/files/trojita-0.7-cmake-cxx11.patch b/mail-client/trojita/files/trojita-0.7-cmake-cxx11.patch
20 new file mode 100644
21 index 00000000000..71ab15950b8
22 --- /dev/null
23 +++ b/mail-client/trojita/files/trojita-0.7-cmake-cxx11.patch
24 @@ -0,0 +1,66 @@
25 +From e2e35bfda75a2f4950408c93ede72fabfe86360e Mon Sep 17 00:00:00 2001
26 +From: =?UTF-8?q?Jan=20Kundr=C3=A1t?= <jkt@×××.org>
27 +Date: Wed, 19 Oct 2016 22:15:16 +0200
28 +Subject: [PATCH] cmake: Speed up cmake by using native features for enforcing
29 + C++11
30 +
31 +This saves about 8 seconds in my (limited) testing with a 2016-era
32 +laptop with plenty of RAM and a fast SSD.
33 +
34 +We still attempt to support ancient pre-3.1 CMake by adding that blurb
35 +into CXXFLAGS, maybe it even works.
36 +
37 +I should probably start tracking time I spend supporting old
38 +environments and evaluate whether this is worth the effort. Once we are
39 +ready to distribute flatpaks/appimages/whatevers, I suspect that my life
40 +will become much easier.
41 +
42 +Change-Id: Ibbbe3d8440a7d29ef27440a99938d313bfe9699f
43 +---
44 + CMakeLists.txt | 26 ++--
45 + 24 files changed, 8 insertions(+), 468 deletions(-)
46 +
47 +diff --git a/CMakeLists.txt b/CMakeLists.txt
48 +index 9393b19c..92a682f7 100644
49 +--- a/CMakeLists.txt
50 ++++ b/CMakeLists.txt
51 +@@ -18,6 +18,14 @@ if(POLICY CMP0043)
52 + cmake_policy(SET CMP0043 OLD)
53 + endif()
54 +
55 ++if(CMAKE_VERSION VERSION_LESS "3.1")
56 ++ # If you aren't using and old Linux with an old GCC and old CMake, please just upgrade.
57 ++ set(CMAKE_CXX_FLAGS "--std=c++11 ${CMAKE_CXX_FLAGS}")
58 ++else()
59 ++ set(CMAKE_CXX_STANDARD 11)
60 ++ set(CMAKE_CXX_STANDARD_REQUIRED ON)
61 ++endif()
62 ++
63 + # Set a default build type if none was specified. This was shamelessly stolen
64 + # from VTK's cmake setup because these guys produce both CMake and a project that
65 + # manipulates this variable, and the web is full of posts where people say that
66 +@@ -34,24 +42,6 @@ endif()
67 +
68 + set(CMAKE_POSITION_INDEPENDENT_CODE ON)
69 +
70 +-include(FindCXXFeatures)
71 +-if(NOT CXXFeatures_auto_FOUND)
72 +- message(SEND_ERROR "Your compiler doesn't support C++11's auto")
73 +-endif()
74 +-if(NOT CXXFeatures_static_assert_FOUND)
75 +- message(SEND_ERROR "Your compiler doesn't support C++11's static_assert")
76 +-endif()
77 +-if(NOT CXXFeatures_alignof_FOUND)
78 +- message(SEND_ERROR "Your compiler doesn't support C++11's alignof")
79 +-endif()
80 +-if(NOT CXXFeatures_nullptr_FOUND)
81 +- message(SEND_ERROR "Your compiler doesn't support C++11's nullptr")
82 +-endif()
83 +-if(NOT CXXFeatures_lambda_FOUND)
84 +- message(SEND_ERROR "Your compiler doesn't support C++11's lambda functions")
85 +-endif()
86 +-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX11_COMPILER_FLAGS}")
87 +-
88 + include(TrojitaOption)
89 +
90 + trojita_option(WITH_DESKTOP "Build desktop version" ON)
91
92 diff --git a/mail-client/trojita/files/trojita-0.7-qt-5.13.patch b/mail-client/trojita/files/trojita-0.7-qt-5.13.patch
93 new file mode 100644
94 index 00000000000..9f1ab3e7e88
95 --- /dev/null
96 +++ b/mail-client/trojita/files/trojita-0.7-qt-5.13.patch
97 @@ -0,0 +1,37 @@
98 +From 39772585033c1c0aff96f297e93de7be53f9b114 Mon Sep 17 00:00:00 2001
99 +From: Heiko Becker <heirecka@×××××××.org>
100 +Date: Sat, 23 Mar 2019 01:17:11 +0100
101 +Subject: [PATCH] tests: Fix build with Qt 5.13
102 +
103 +QTest::toString(QModelIndex) was added in
104 +7ef0b575b38d267bd3dc14ff46935d556562ff00 and thus causes a build
105 +error with Qt 5.13 because it's redefined here.
106 +
107 +Change-Id: I015800e49cf8d0e87f3541642406396f150d0eeb
108 +---
109 + tests/Imap/test_Imap_BodyParts.cpp | 2 ++
110 + 1 file changed, 2 insertions(+)
111 +
112 +diff --git a/tests/Imap/test_Imap_BodyParts.cpp b/tests/Imap/test_Imap_BodyParts.cpp
113 +index f1c577fa..b6e0421d 100644
114 +--- a/tests/Imap/test_Imap_BodyParts.cpp
115 ++++ b/tests/Imap/test_Imap_BodyParts.cpp
116 +@@ -51,6 +51,7 @@ struct Data {
117 +
118 + Q_DECLARE_METATYPE(QList<Data>)
119 +
120 ++#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
121 + namespace QTest {
122 + template <>
123 + char *toString(const QModelIndex &index)
124 +@@ -60,6 +61,7 @@ char *toString(const QModelIndex &index)
125 + return qstrdup(buf.toUtf8().constData());
126 + }
127 + }
128 ++#endif
129 +
130 + using namespace Imap::Mailbox;
131 +
132 +--
133 +GitLab
134 +
135
136 diff --git a/mail-client/trojita/trojita-0.7-r4.ebuild b/mail-client/trojita/trojita-0.7-r4.ebuild
137 index 8583ee49efd..e9b7c9e515a 100644
138 --- a/mail-client/trojita/trojita-0.7-r4.ebuild
139 +++ b/mail-client/trojita/trojita-0.7-r4.ebuild
140 @@ -52,9 +52,11 @@ PATCHES=(
141 "${FILESDIR}/${P}-gpgme.patch"
142 "${FILESDIR}/${P}-gpg-tests.patch"
143 "${FILESDIR}/${P}-qt-5.11b3.patch"
144 + "${FILESDIR}/${P}-qt-5.13.patch" # bug 730058
145 "${FILESDIR}/${P}-qt-5.15.patch"
146 "${FILESDIR}/${P}-CVE-2019-10734.patch" # KDE-bug 404697
147 "${FILESDIR}/${P}-CVE-2020-15047.patch" # bug 729596
148 + "${FILESDIR}/${P}-cmake-cxx11.patch"
149 )
150
151 src_prepare() {