1 |
commit: 3ba2afcc77d13823ee5b9e935619b8be08b11790 |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue May 17 04:51:06 2022 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue May 17 05:33:58 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3ba2afcc |
7 |
|
8 |
app-crypt/gpgme: conditionally build tests; die if tests can't be run |
9 |
|
10 |
1. Conditionally build tests which gives us a neat speedup for build time; |
11 |
|
12 |
2. If tests are explicitly requested and we can't run them b/c of WORKDIR length, |
13 |
let's bail out. It's important that we don't get a false positive that |
14 |
the package is okay (especially given its importance). |
15 |
|
16 |
(Noticed when poking at the slibtool bug, although I don't think this will |
17 |
actually fix anything there.) |
18 |
|
19 |
Bug: https://bugs.gentoo.org/844226 |
20 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
21 |
|
22 |
app-crypt/gpgme/gpgme-1.17.1.ebuild | 25 +++++++++++++++---------- |
23 |
1 file changed, 15 insertions(+), 10 deletions(-) |
24 |
|
25 |
diff --git a/app-crypt/gpgme/gpgme-1.17.1.ebuild b/app-crypt/gpgme/gpgme-1.17.1.ebuild |
26 |
index 1865282c490a..c70a73811293 100644 |
27 |
--- a/app-crypt/gpgme/gpgme-1.17.1.ebuild |
28 |
+++ b/app-crypt/gpgme/gpgme-1.17.1.ebuild |
29 |
@@ -20,7 +20,8 @@ LICENSE="GPL-2 LGPL-2.1" |
30 |
# Subslot: SONAME of each: <libgpgme.libgpgmepp.libqgpgme> |
31 |
SLOT="1/11.6.15" |
32 |
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" |
33 |
-IUSE="common-lisp static-libs +cxx python qt5" |
34 |
+IUSE="common-lisp static-libs +cxx python qt5 test" |
35 |
+RESTRICT="!test? ( test )" |
36 |
|
37 |
# Note: On each bump, update dep bounds on each version from configure.ac! |
38 |
RDEPEND=">=app-crypt/gnupg-2 |
39 |
@@ -30,7 +31,9 @@ RDEPEND=">=app-crypt/gnupg-2 |
40 |
qt5? ( dev-qt/qtcore:5 )" |
41 |
#doc? ( app-doc/doxygen[dot] ) |
42 |
DEPEND="${RDEPEND} |
43 |
- qt5? ( dev-qt/qttest:5 )" |
44 |
+ test? ( |
45 |
+ qt5? ( dev-qt/qttest:5 ) |
46 |
+ )" |
47 |
BDEPEND="python? ( dev-lang/swig ) |
48 |
verify-sig? ( sec-keys/openpgp-keys-gnupg )" |
49 |
|
50 |
@@ -53,9 +56,9 @@ src_prepare() { |
51 |
addpredict /run/user/$(id -u)/gnupg |
52 |
|
53 |
local MAX_WORKDIR=66 |
54 |
- if [[ "${#WORKDIR}" -gt "${MAX_WORKDIR}" ]]; then |
55 |
- ewarn "Disabling tests as WORKDIR '${WORKDIR}' is longer than ${MAX_WORKDIR} which will fail tests" |
56 |
- SKIP_TESTS=1 |
57 |
+ if use test && [[ "${#WORKDIR}" -gt "${MAX_WORKDIR}" ]]; then |
58 |
+ eerror "Unable to run tests as WORKDIR='${WORKDIR}' is longer than ${MAX_WORKDIR} which causes failure!" |
59 |
+ die "Could not run tests as requested with too-long WORKDIR." |
60 |
fi |
61 |
|
62 |
# Make best effort to allow longer PORTAGE_TMPDIR |
63 |
@@ -66,6 +69,7 @@ src_prepare() { |
64 |
|
65 |
src_configure() { |
66 |
local languages=() |
67 |
+ |
68 |
use common-lisp && languages+=( "cl" ) |
69 |
use cxx && languages+=( "cpp" ) |
70 |
if use qt5; then |
71 |
@@ -77,7 +81,7 @@ src_configure() { |
72 |
|
73 |
# bug #811933 for libassuan prefix |
74 |
econf \ |
75 |
- $([[ -n "${SKIP_TESTS}" ]] && echo "--disable-gpg-test --disable-gpgsm-test") \ |
76 |
+ $(use test || echo "--disable-gpgconf-test --disable-gpg-test --disable-gpgsm-test --disable-g13-test") \ |
77 |
--enable-languages="${languages[*]}" \ |
78 |
--with-libassuan-prefix="${ESYSROOT}"/usr \ |
79 |
$(use_enable static-libs static) |
80 |
@@ -93,9 +97,8 @@ src_compile() { |
81 |
} |
82 |
|
83 |
src_test() { |
84 |
- [[ -z "${SKIP_TESTS}" ]] || return |
85 |
- |
86 |
default |
87 |
+ |
88 |
if use python; then |
89 |
test_python() { |
90 |
emake -C lang/python/tests check \ |
91 |
@@ -109,11 +112,13 @@ src_test() { |
92 |
|
93 |
src_install() { |
94 |
default |
95 |
+ |
96 |
do_python |
97 |
+ |
98 |
find "${ED}" -type f -name '*.la' -delete || die |
99 |
|
100 |
- # backward compatibility for gentoo |
101 |
- # in the past we had slots |
102 |
+ # Backward compatibility for gentoo |
103 |
+ # (in the past, we had slots) |
104 |
dodir /usr/include/gpgme |
105 |
dosym ../gpgme.h /usr/include/gpgme/gpgme.h |
106 |
} |