From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1397619-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id 5D9C1158090
	for <garchives@archives.gentoo.org>; Tue, 17 May 2022 05:34:56 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 36DEAE0973;
	Tue, 17 May 2022 05:34:55 +0000 (UTC)
Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 1FC4FE0973
	for <gentoo-commits@lists.gentoo.org>; Tue, 17 May 2022 05:34:55 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 47A5F341A85
	for <gentoo-commits@lists.gentoo.org>; Tue, 17 May 2022 05:34:54 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id CB5F04C8
	for <gentoo-commits@lists.gentoo.org>; Tue, 17 May 2022 05:34:50 +0000 (UTC)
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" <sam@gentoo.org>
Message-ID: <1652765638.3ba2afcc77d13823ee5b9e935619b8be08b11790.sam@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: app-crypt/gpgme/
X-VCS-Repository: repo/gentoo
X-VCS-Files: app-crypt/gpgme/gpgme-1.17.1.ebuild
X-VCS-Directories: app-crypt/gpgme/
X-VCS-Committer: sam
X-VCS-Committer-Name: Sam James
X-VCS-Revision: 3ba2afcc77d13823ee5b9e935619b8be08b11790
X-VCS-Branch: master
Date: Tue, 17 May 2022 05:34:50 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: 4dcda8f3-59d2-4bc1-b9a5-7301704cd888
X-Archives-Hash: d18b9ec622a79388e31c9d5f3da46ece

commit:     3ba2afcc77d13823ee5b9e935619b8be08b11790
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue May 17 04:51:06 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue May 17 05:33:58 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3ba2afcc

app-crypt/gpgme: conditionally build tests; die if tests can't be run

1. Conditionally build tests which gives us a neat speedup for build time;

2. If tests are explicitly requested and we can't run them b/c of WORKDIR length,
let's bail out. It's important that we don't get a false positive that
the package is okay (especially given its importance).

(Noticed when poking at the slibtool bug, although I don't think this will
actually fix anything there.)

Bug: https://bugs.gentoo.org/844226
Signed-off-by: Sam James <sam <AT> gentoo.org>

 app-crypt/gpgme/gpgme-1.17.1.ebuild | 25 +++++++++++++++----------
 1 file changed, 15 insertions(+), 10 deletions(-)

diff --git a/app-crypt/gpgme/gpgme-1.17.1.ebuild b/app-crypt/gpgme/gpgme-1.17.1.ebuild
index 1865282c490a..c70a73811293 100644
--- a/app-crypt/gpgme/gpgme-1.17.1.ebuild
+++ b/app-crypt/gpgme/gpgme-1.17.1.ebuild
@@ -20,7 +20,8 @@ LICENSE="GPL-2 LGPL-2.1"
 # Subslot: SONAME of each: <libgpgme.libgpgmepp.libqgpgme>
 SLOT="1/11.6.15"
 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"
-IUSE="common-lisp static-libs +cxx python qt5"
+IUSE="common-lisp static-libs +cxx python qt5 test"
+RESTRICT="!test? ( test )"
 
 # Note: On each bump, update dep bounds on each version from configure.ac!
 RDEPEND=">=app-crypt/gnupg-2
@@ -30,7 +31,9 @@ RDEPEND=">=app-crypt/gnupg-2
 	qt5? ( dev-qt/qtcore:5 )"
 	#doc? ( app-doc/doxygen[dot] )
 DEPEND="${RDEPEND}
-	qt5? ( dev-qt/qttest:5 )"
+	test? (
+		qt5? ( dev-qt/qttest:5 )
+	)"
 BDEPEND="python? ( dev-lang/swig )
 	verify-sig? ( sec-keys/openpgp-keys-gnupg )"
 
@@ -53,9 +56,9 @@ src_prepare() {
 	addpredict /run/user/$(id -u)/gnupg
 
 	local MAX_WORKDIR=66
-	if [[ "${#WORKDIR}" -gt "${MAX_WORKDIR}" ]]; then
-		ewarn "Disabling tests as WORKDIR '${WORKDIR}' is longer than ${MAX_WORKDIR} which will fail tests"
-		SKIP_TESTS=1
+	if use test && [[ "${#WORKDIR}" -gt "${MAX_WORKDIR}" ]]; then
+		eerror "Unable to run tests as WORKDIR='${WORKDIR}' is longer than ${MAX_WORKDIR} which causes failure!"
+		die "Could not run tests as requested with too-long WORKDIR."
 	fi
 
 	# Make best effort to allow longer PORTAGE_TMPDIR
@@ -66,6 +69,7 @@ src_prepare() {
 
 src_configure() {
 	local languages=()
+
 	use common-lisp && languages+=( "cl" )
 	use cxx && languages+=( "cpp" )
 	if use qt5; then
@@ -77,7 +81,7 @@ src_configure() {
 
 	# bug #811933 for libassuan prefix
 	econf \
-		$([[ -n "${SKIP_TESTS}" ]] && echo "--disable-gpg-test --disable-gpgsm-test") \
+		$(use test || echo "--disable-gpgconf-test --disable-gpg-test --disable-gpgsm-test --disable-g13-test") \
 		--enable-languages="${languages[*]}" \
 		--with-libassuan-prefix="${ESYSROOT}"/usr \
 		$(use_enable static-libs static)
@@ -93,9 +97,8 @@ src_compile() {
 }
 
 src_test() {
-	[[ -z "${SKIP_TESTS}" ]] || return
-
 	default
+
 	if use python; then
 		test_python() {
 			emake -C lang/python/tests check \
@@ -109,11 +112,13 @@ src_test() {
 
 src_install() {
 	default
+
 	do_python
+
 	find "${ED}" -type f -name '*.la' -delete || die
 
-	# backward compatibility for gentoo
-	# in the past we had slots
+	# Backward compatibility for gentoo
+	# (in the past, we had slots)
 	dodir /usr/include/gpgme
 	dosym ../gpgme.h /usr/include/gpgme/gpgme.h
 }