From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1400975-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 075BF158090
	for <garchives@archives.gentoo.org>; Thu, 26 May 2022 05:48:20 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 52950E08AD;
	Thu, 26 May 2022 05:48:19 +0000 (UTC)
Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183])
	(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 38A23E08AD
	for <gentoo-commits@lists.gentoo.org>; Thu, 26 May 2022 05:48:19 +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 592B934158C
	for <gentoo-commits@lists.gentoo.org>; Thu, 26 May 2022 05:48:18 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 6E3A64D3
	for <gentoo-commits@lists.gentoo.org>; Thu, 26 May 2022 05:48:15 +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: <1653544086.9c13495c430ca3e64bc09682c8a646fdaed843b0.sam@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-devel/gdb/
X-VCS-Repository: repo/gentoo
X-VCS-Files: sys-devel/gdb/gdb-12.1.ebuild
X-VCS-Directories: sys-devel/gdb/
X-VCS-Committer: sam
X-VCS-Committer-Name: Sam James
X-VCS-Revision: 9c13495c430ca3e64bc09682c8a646fdaed843b0
X-VCS-Branch: master
Date: Thu, 26 May 2022 05:48:15 +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: f9975d4e-d503-401a-aecf-0a0c076963f4
X-Archives-Hash: d6cb83592348b35e91ccbe69ab2bf257

commit:     9c13495c430ca3e64bc09682c8a646fdaed843b0
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu May 26 05:47:46 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu May 26 05:48:06 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9c13495c

sys-devel/gdb: build tests in src_compile when enabled

Signed-off-by: Sam James <sam <AT> gentoo.org>

 sys-devel/gdb/gdb-12.1.ebuild | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/sys-devel/gdb/gdb-12.1.ebuild b/sys-devel/gdb/gdb-12.1.ebuild
index b7ca1edd1937..4c59318f5d81 100644
--- a/sys-devel/gdb/gdb-12.1.ebuild
+++ b/sys-devel/gdb/gdb-12.1.ebuild
@@ -53,6 +53,9 @@ fi
 IUSE="cet guile lzma multitarget nls +python +server source-highlight test vanilla xml xxhash"
 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
 
+# In fact, gdb's test suite needs some work to get passing.
+# See e.g. https://sourceware.org/gdb/wiki/TestingGDB.
+# As of 11.2, on amd64: "# of unexpected failures    8600"
 # ia64 kernel crashes when gdb testsuite is running
 # in fact, gdb's test suite needs some work to get passing.
 # See e.g. https://sourceware.org/gdb/wiki/TestingGDB.
@@ -104,9 +107,8 @@ src_prepare() {
 	default
 
 	strip-linguas -u bfd/po opcodes/po
-	export CC_FOR_BUILD="$(tc-getBUILD_CC)"
 
-	# avoid using ancient termcap from host on Prefix systems
+	# Avoid using ancient termcap from host on Prefix systems
 	sed -i -e 's/termcap tinfow/tinfow/g' \
 		gdb/configure{.ac,} || die
 }
@@ -135,13 +137,15 @@ src_configure() {
 		--with-pkgversion="$(gdb_branding)"
 		--with-bugurl='https://bugs.gentoo.org/'
 		--disable-werror
-		# Disable modules that are in a combined binutils/gdb tree. #490566
+		# Disable modules that are in a combined binutils/gdb tree. bug #490566
 		--disable-{binutils,etc,gas,gold,gprof,ld}
 
 		# avoid automagic dependency on (currently prefix) systems
 		# systems with debuginfod library, bug #754753
 		--without-debuginfod
 
+		$(use_enable test unit-tests)
+
 		# Allow user to opt into CET for host libraries.
 		# Ideally we would like automagic-or-disabled here.
 		# But the check does not quite work on i686: bug #760926.
@@ -198,6 +202,8 @@ src_configure() {
 	# source-highlight is detected with pkg-config: bug #716558
 	export ac_cv_path_pkg_config_prog_path="$(tc-getPKG_CONFIG)"
 
+	export CC_FOR_BUILD="$(tc-getBUILD_CC)"
+
 	# ensure proper compiler is detected for Clang builds: bug #831202
 	export GCC_FOR_TARGET="${CC_FOR_TARGET:-$(tc-getCC)}"
 
@@ -209,7 +215,7 @@ src_install() {
 
 	find "${ED}"/usr -name libiberty.a -delete || die
 
-	# Delete translations that conflict with binutils-libs. #528088
+	# Delete translations that conflict with binutils-libs. bug #528088
 	# Note: Should figure out how to store these in an internal gdb dir.
 	if use nls ; then
 		find "${ED}" \
@@ -253,7 +259,7 @@ src_install() {
 	# Remove shared info pages
 	rm -f "${ED}"/usr/share/info/{annotate,bfd,configure,ctf-spec,standards}.info*
 
-	if use python; then
+	if use python ; then
 		python_optimize "${ED}"/usr/share/gdb/python/gdb
 	fi
 }