1 |
commit: f2db0691e4f7f26ba25603013e32fa1fb68dbf0f |
2 |
Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Jan 8 08:10:52 2020 +0000 |
4 |
Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Jan 8 08:11:17 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f2db0691 |
7 |
|
8 |
app-admin/keepassxc: Make ccache usage optional |
9 |
|
10 |
Closes: https://bugs.gentoo.org/704560 |
11 |
Package-Manager: Portage-2.3.84, Repoman-2.3.20 |
12 |
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org> |
13 |
|
14 |
.../files/keepassxc-2.5.2-ccache_switch.patch | 59 ++++++++++++++++++++++ |
15 |
app-admin/keepassxc/keepassxc-2.5.1.ebuild | 25 ++++----- |
16 |
app-admin/keepassxc/keepassxc-2.5.2.ebuild | 11 +++- |
17 |
app-admin/keepassxc/keepassxc-9999.ebuild | 7 ++- |
18 |
app-admin/keepassxc/metadata.xml | 1 + |
19 |
5 files changed, 84 insertions(+), 19 deletions(-) |
20 |
|
21 |
diff --git a/app-admin/keepassxc/files/keepassxc-2.5.2-ccache_switch.patch b/app-admin/keepassxc/files/keepassxc-2.5.2-ccache_switch.patch |
22 |
new file mode 100644 |
23 |
index 00000000000..57d8b3d714c |
24 |
--- /dev/null |
25 |
+++ b/app-admin/keepassxc/files/keepassxc-2.5.2-ccache_switch.patch |
26 |
@@ -0,0 +1,59 @@ |
27 |
+From ae471bea14c8e05bcf368168649399b116a69992 Mon Sep 17 00:00:00 2001 |
28 |
+From: Lars Wendler <polynomial-c@g.o> |
29 |
+Date: Tue, 7 Jan 2020 17:44:08 -0500 |
30 |
+Subject: [PATCH] CMakeLists.txt: Do not unconditionally use ccache |
31 |
+ |
32 |
+This causes build failures in Gentoo because we don't allow access to ccache files if ccache is not enabled for build. |
33 |
+ |
34 |
+Fix this by adding a WITH_CCACHE cmake option and change behavior so that cmake fails if WITH_CCACHE is enabled but ccache program cannot be found. |
35 |
+ |
36 |
+Gentoo-bug: https://bugs.gentoo.org/704560 |
37 |
+Signed-off-by: Lars Wendler <polynomial-c@g.o> |
38 |
+--- |
39 |
+ CMakeLists.txt | 19 ++++++++++++------- |
40 |
+ 1 file changed, 12 insertions(+), 7 deletions(-) |
41 |
+ |
42 |
+diff --git a/CMakeLists.txt b/CMakeLists.txt |
43 |
+index c2f9b5bfe..1c5746c59 100644 |
44 |
+--- a/CMakeLists.txt |
45 |
++++ b/CMakeLists.txt |
46 |
+@@ -27,13 +27,6 @@ string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_LOWER) |
47 |
+ |
48 |
+ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) |
49 |
+ |
50 |
+-# Use the Compiler Cache (ccache) if it is installed |
51 |
+-# (install with: sudo apt get ccache) |
52 |
+-find_program (CCACHE_FOUND ccache) |
53 |
+-if (CCACHE_FOUND) |
54 |
+- set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) |
55 |
+-endif (CCACHE_FOUND) |
56 |
+- |
57 |
+ # Support Visual Studio Code |
58 |
+ include(CMakeToolsHelpers OPTIONAL) |
59 |
+ include(FeatureSummary) |
60 |
+@@ -48,6 +41,7 @@ option(WITH_DEV_BUILD "Use only for development. Disables/warns about deprecated |
61 |
+ option(WITH_ASAN "Enable address sanitizer checks (Linux / macOS only)" OFF) |
62 |
+ option(WITH_COVERAGE "Use to build with coverage tests (GCC only)." OFF) |
63 |
+ option(WITH_APP_BUNDLE "Enable Application Bundle for macOS" ON) |
64 |
++option(WITH_CCACHE "Use ccache for build" OFF) |
65 |
+ |
66 |
+ set(WITH_XC_ALL OFF CACHE BOOL "Build in all available plugins") |
67 |
+ |
68 |
+@@ -65,6 +59,17 @@ if(APPLE) |
69 |
+ option(WITH_XC_TOUCHID "Include TouchID support for macOS." OFF) |
70 |
+ endif() |
71 |
+ |
72 |
++if(WITH_CCACHE) |
73 |
++ # Use the Compiler Cache (ccache) program |
74 |
++ # (install with: sudo apt get ccache) |
75 |
++ find_program (CCACHE_FOUND ccache) |
76 |
++ if(CCACHE_FOUND) |
77 |
++ set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) |
78 |
++ else() |
79 |
++ message(FATAL_ERROR "ccache requested but cannot be found.") |
80 |
++ endif() |
81 |
++endif() |
82 |
++ |
83 |
+ if(WITH_XC_ALL) |
84 |
+ # Enable all options (except update check) |
85 |
+ set(WITH_XC_AUTOTYPE ON) |
86 |
|
87 |
diff --git a/app-admin/keepassxc/keepassxc-2.5.1.ebuild b/app-admin/keepassxc/keepassxc-2.5.1.ebuild |
88 |
index 344be63f074..c3a08042f8f 100644 |
89 |
--- a/app-admin/keepassxc/keepassxc-2.5.1.ebuild |
90 |
+++ b/app-admin/keepassxc/keepassxc-2.5.1.ebuild |
91 |
@@ -1,4 +1,4 @@ |
92 |
-# Copyright 1999-2019 Gentoo Authors |
93 |
+# Copyright 1999-2020 Gentoo Authors |
94 |
# Distributed under the terms of the GNU General Public License v2 |
95 |
|
96 |
EAPI=7 |
97 |
@@ -24,7 +24,7 @@ fi |
98 |
|
99 |
LICENSE="LGPL-2.1 GPL-2 GPL-3" |
100 |
SLOT="0" |
101 |
-IUSE="autotype browser debug keeshare +network test yubikey" |
102 |
+IUSE="autotype browser ccache debug keeshare +network test yubikey" |
103 |
|
104 |
RDEPEND=" |
105 |
app-crypt/argon2:= |
106 |
@@ -55,7 +55,9 @@ DEPEND=" |
107 |
dev-qt/linguist-tools:5 |
108 |
dev-qt/qttest:5 |
109 |
" |
110 |
- |
111 |
+BDEPEND=" |
112 |
+ ccache? ( dev-util/ccache ) |
113 |
+" |
114 |
# Not a runtime dependency but still needed (see bug #667092) |
115 |
PDEPEND=" |
116 |
x11-misc/xsel |
117 |
@@ -63,6 +65,10 @@ PDEPEND=" |
118 |
|
119 |
RESTRICT="!test? ( test )" |
120 |
|
121 |
+PATCHES=( |
122 |
+ "${FILESDIR}/${PN}-2.5.2-ccache_switch.patch" |
123 |
+) |
124 |
+ |
125 |
src_prepare() { |
126 |
use test || \ |
127 |
sed -e "/^find_package(Qt5Test/d" -i CMakeLists.txt || die |
128 |
@@ -72,6 +78,7 @@ src_prepare() { |
129 |
|
130 |
src_configure() { |
131 |
local mycmakeargs=( |
132 |
+ -DWITH_CCACHE="$(usex ccache)" |
133 |
-DWITH_GUI_TESTS=OFF |
134 |
-DWITH_TESTS="$(usex test)" |
135 |
-DWITH_XC_AUTOTYPE="$(usex autotype)" |
136 |
@@ -88,15 +95,3 @@ src_configure() { |
137 |
fi |
138 |
cmake_src_configure |
139 |
} |
140 |
- |
141 |
-pkg_preinst() { |
142 |
- xdg_pkg_preinst |
143 |
-} |
144 |
- |
145 |
-pkg_postinst() { |
146 |
- xdg_pkg_postinst |
147 |
-} |
148 |
- |
149 |
-pkg_postrm() { |
150 |
- xdg_pkg_postrm |
151 |
-} |
152 |
|
153 |
diff --git a/app-admin/keepassxc/keepassxc-2.5.2.ebuild b/app-admin/keepassxc/keepassxc-2.5.2.ebuild |
154 |
index f4d70198a23..c3a08042f8f 100644 |
155 |
--- a/app-admin/keepassxc/keepassxc-2.5.2.ebuild |
156 |
+++ b/app-admin/keepassxc/keepassxc-2.5.2.ebuild |
157 |
@@ -24,7 +24,7 @@ fi |
158 |
|
159 |
LICENSE="LGPL-2.1 GPL-2 GPL-3" |
160 |
SLOT="0" |
161 |
-IUSE="autotype browser debug keeshare +network test yubikey" |
162 |
+IUSE="autotype browser ccache debug keeshare +network test yubikey" |
163 |
|
164 |
RDEPEND=" |
165 |
app-crypt/argon2:= |
166 |
@@ -55,7 +55,9 @@ DEPEND=" |
167 |
dev-qt/linguist-tools:5 |
168 |
dev-qt/qttest:5 |
169 |
" |
170 |
- |
171 |
+BDEPEND=" |
172 |
+ ccache? ( dev-util/ccache ) |
173 |
+" |
174 |
# Not a runtime dependency but still needed (see bug #667092) |
175 |
PDEPEND=" |
176 |
x11-misc/xsel |
177 |
@@ -63,6 +65,10 @@ PDEPEND=" |
178 |
|
179 |
RESTRICT="!test? ( test )" |
180 |
|
181 |
+PATCHES=( |
182 |
+ "${FILESDIR}/${PN}-2.5.2-ccache_switch.patch" |
183 |
+) |
184 |
+ |
185 |
src_prepare() { |
186 |
use test || \ |
187 |
sed -e "/^find_package(Qt5Test/d" -i CMakeLists.txt || die |
188 |
@@ -72,6 +78,7 @@ src_prepare() { |
189 |
|
190 |
src_configure() { |
191 |
local mycmakeargs=( |
192 |
+ -DWITH_CCACHE="$(usex ccache)" |
193 |
-DWITH_GUI_TESTS=OFF |
194 |
-DWITH_TESTS="$(usex test)" |
195 |
-DWITH_XC_AUTOTYPE="$(usex autotype)" |
196 |
|
197 |
diff --git a/app-admin/keepassxc/keepassxc-9999.ebuild b/app-admin/keepassxc/keepassxc-9999.ebuild |
198 |
index f4d70198a23..949cb61dc8a 100644 |
199 |
--- a/app-admin/keepassxc/keepassxc-9999.ebuild |
200 |
+++ b/app-admin/keepassxc/keepassxc-9999.ebuild |
201 |
@@ -24,7 +24,7 @@ fi |
202 |
|
203 |
LICENSE="LGPL-2.1 GPL-2 GPL-3" |
204 |
SLOT="0" |
205 |
-IUSE="autotype browser debug keeshare +network test yubikey" |
206 |
+IUSE="autotype browser ccache debug keeshare +network test yubikey" |
207 |
|
208 |
RDEPEND=" |
209 |
app-crypt/argon2:= |
210 |
@@ -55,7 +55,9 @@ DEPEND=" |
211 |
dev-qt/linguist-tools:5 |
212 |
dev-qt/qttest:5 |
213 |
" |
214 |
- |
215 |
+BDEPEND=" |
216 |
+ ccache? ( dev-util/ccache ) |
217 |
+" |
218 |
# Not a runtime dependency but still needed (see bug #667092) |
219 |
PDEPEND=" |
220 |
x11-misc/xsel |
221 |
@@ -72,6 +74,7 @@ src_prepare() { |
222 |
|
223 |
src_configure() { |
224 |
local mycmakeargs=( |
225 |
+ -DWITH_CCACHE="$(usex ccache)" |
226 |
-DWITH_GUI_TESTS=OFF |
227 |
-DWITH_TESTS="$(usex test)" |
228 |
-DWITH_XC_AUTOTYPE="$(usex autotype)" |
229 |
|
230 |
diff --git a/app-admin/keepassxc/metadata.xml b/app-admin/keepassxc/metadata.xml |
231 |
index d9b95402e41..0445305ebe5 100644 |
232 |
--- a/app-admin/keepassxc/metadata.xml |
233 |
+++ b/app-admin/keepassxc/metadata.xml |
234 |
@@ -8,6 +8,7 @@ |
235 |
<use> |
236 |
<flag name="autotype">Add support to autotype the passwords into other applications</flag> |
237 |
<flag name="browser">Enables browser plugin support</flag> |
238 |
+ <flag name="ccache">Use <pkg>dev-util/ccache</pkg> to build keepassxc</flag> |
239 |
<flag name="keeshare">Enable KeeShare sharing integration</flag> |
240 |
<flag name="network">Enable network support</flag> |
241 |
<flag name="yubikey">Enable database unlocking via YubiKey.</flag> |