From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1445777-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 B6BAD158094
	for <garchives@archives.gentoo.org>; Tue, 11 Oct 2022 07:27:49 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id D00E5E0837;
	Tue, 11 Oct 2022 07:27:48 +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) server-digest SHA256)
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id B6741E0837
	for <gentoo-commits@lists.gentoo.org>; Tue, 11 Oct 2022 07:27:48 +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) server-digest SHA256)
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 993A034124D
	for <gentoo-commits@lists.gentoo.org>; Tue, 11 Oct 2022 07:27:47 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id D8FE75B2
	for <gentoo-commits@lists.gentoo.org>; Tue, 11 Oct 2022 07:27:45 +0000 (UTC)
From: "Michał Górny" <mgorny@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, "Michał Górny" <mgorny@gentoo.org>
Message-ID: <1665472739.2d1c17885f08913368cdaf8f252ef8c66b3d2830.mgorny@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-libs/libomp/
X-VCS-Repository: repo/gentoo
X-VCS-Files: sys-libs/libomp/libomp-16.0.0.9999.ebuild sys-libs/libomp/libomp-16.0.0_pre20221010.ebuild sys-libs/libomp/metadata.xml
X-VCS-Directories: sys-libs/libomp/
X-VCS-Committer: mgorny
X-VCS-Committer-Name: Michał Górny
X-VCS-Revision: 2d1c17885f08913368cdaf8f252ef8c66b3d2830
X-VCS-Branch: master
Date: Tue, 11 Oct 2022 07:27:45 +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: 67b400a5-bd11-4b3c-b69d-192bc83bc031
X-Archives-Hash: cb7e39cb8b0135dda64f22386dcb8949

commit:     2d1c17885f08913368cdaf8f252ef8c66b3d2830
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Oct 11 07:18:50 2022 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Oct 11 07:18:59 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2d1c1788

sys-libs/libomp: Add a flag to control the gdb-plugin

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 sys-libs/libomp/libomp-16.0.0.9999.ebuild        | 24 ++++++++++++++----------
 sys-libs/libomp/libomp-16.0.0_pre20221010.ebuild | 24 ++++++++++++++----------
 sys-libs/libomp/metadata.xml                     |  1 +
 3 files changed, 29 insertions(+), 20 deletions(-)

diff --git a/sys-libs/libomp/libomp-16.0.0.9999.ebuild b/sys-libs/libomp/libomp-16.0.0.9999.ebuild
index dca2bf97647b..bc1e59029b71 100644
--- a/sys-libs/libomp/libomp-16.0.0.9999.ebuild
+++ b/sys-libs/libomp/libomp-16.0.0.9999.ebuild
@@ -4,7 +4,7 @@
 EAPI=8
 
 PYTHON_COMPAT=( python3_{8..11} )
-inherit flag-o-matic cmake-multilib linux-info llvm llvm.org python-any-r1
+inherit flag-o-matic cmake-multilib linux-info llvm llvm.org python-single-r1
 
 DESCRIPTION="OpenMP runtime library for LLVM/clang compiler"
 HOMEPAGE="https://openmp.llvm.org"
@@ -13,12 +13,16 @@ LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )"
 SLOT="0/${LLVM_SOABI}"
 KEYWORDS=""
 IUSE="
-	debug hwloc offload ompt test
+	debug gdb-plugin hwloc offload ompt test
 	llvm_targets_AMDGPU llvm_targets_NVPTX
 "
+REQUIRED_USE="
+	gdb-plugin? ( ${PYTHON_REQUIRED_USE} )
+"
 RESTRICT="!test? ( test )"
 
 RDEPEND="
+	gdb-plugin? ( ${PYTHON_DEPS} )
 	hwloc? ( >=sys-apps/hwloc-2.5:0=[${MULTILIB_USEDEP}] )
 	offload? (
 		virtual/libelf:=[${MULTILIB_USEDEP}]
@@ -41,7 +45,10 @@ BDEPEND="
 		virtual/pkgconfig
 	)
 	test? (
-		$(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]')
+		${PYTHON_DEPS}
+		$(python_gen_cond_dep '
+			dev-python/lit[${PYTHON_USEDEP}]
+		')
 		sys-devel/clang
 	)
 "
@@ -49,10 +56,6 @@ BDEPEND="
 LLVM_COMPONENTS=( openmp cmake llvm/include )
 llvm.org_set_globals
 
-python_check_deps() {
-	python_has_version "dev-python/lit[${PYTHON_USEDEP}]"
-}
-
 kernel_pds_check() {
 	if use kernel_linux && kernel_is -lt 4 15 && kernel_is -ge 4 13; then
 		local CONFIG_CHECK="~!SCHED_PDS"
@@ -72,7 +75,9 @@ pkg_pretend() {
 
 pkg_setup() {
 	use offload && LLVM_MAX_SLOT=${LLVM_MAJOR} llvm_pkg_setup
-	use test && python-any-r1_pkg_setup
+	if use gdb-plugin || use test; then
+		python-single-r1_pkg_setup
+	fi
 }
 
 multilib_src_configure() {
@@ -87,6 +92,7 @@ multilib_src_configure() {
 		-DOPENMP_LIBDIR_SUFFIX="${libdir#lib}"
 
 		-DLIBOMP_USE_HWLOC=$(usex hwloc)
+		-DLIBOMP_OMPD_GDB_SUPPORT=$(multilib_native_usex gdb-plugin)
 		-DLIBOMP_OMPT_SUPPORT=$(usex ompt)
 
 		-DOPENMP_ENABLE_LIBOMPTARGET=$(usex offload)
@@ -95,8 +101,6 @@ multilib_src_configure() {
 		-DLIBOMP_INSTALL_ALIASES=OFF
 		# disable unnecessary hack copying stuff back to srcdir
 		-DLIBOMP_COPY_EXPORTS=OFF
-		# disable until upstream fixes it to use positive logic
-		-DDISABLE_OMPD_GDB_PLUGIN=ON
 	)
 
 	if use offload; then

diff --git a/sys-libs/libomp/libomp-16.0.0_pre20221010.ebuild b/sys-libs/libomp/libomp-16.0.0_pre20221010.ebuild
index dca2bf97647b..bc1e59029b71 100644
--- a/sys-libs/libomp/libomp-16.0.0_pre20221010.ebuild
+++ b/sys-libs/libomp/libomp-16.0.0_pre20221010.ebuild
@@ -4,7 +4,7 @@
 EAPI=8
 
 PYTHON_COMPAT=( python3_{8..11} )
-inherit flag-o-matic cmake-multilib linux-info llvm llvm.org python-any-r1
+inherit flag-o-matic cmake-multilib linux-info llvm llvm.org python-single-r1
 
 DESCRIPTION="OpenMP runtime library for LLVM/clang compiler"
 HOMEPAGE="https://openmp.llvm.org"
@@ -13,12 +13,16 @@ LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )"
 SLOT="0/${LLVM_SOABI}"
 KEYWORDS=""
 IUSE="
-	debug hwloc offload ompt test
+	debug gdb-plugin hwloc offload ompt test
 	llvm_targets_AMDGPU llvm_targets_NVPTX
 "
+REQUIRED_USE="
+	gdb-plugin? ( ${PYTHON_REQUIRED_USE} )
+"
 RESTRICT="!test? ( test )"
 
 RDEPEND="
+	gdb-plugin? ( ${PYTHON_DEPS} )
 	hwloc? ( >=sys-apps/hwloc-2.5:0=[${MULTILIB_USEDEP}] )
 	offload? (
 		virtual/libelf:=[${MULTILIB_USEDEP}]
@@ -41,7 +45,10 @@ BDEPEND="
 		virtual/pkgconfig
 	)
 	test? (
-		$(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]')
+		${PYTHON_DEPS}
+		$(python_gen_cond_dep '
+			dev-python/lit[${PYTHON_USEDEP}]
+		')
 		sys-devel/clang
 	)
 "
@@ -49,10 +56,6 @@ BDEPEND="
 LLVM_COMPONENTS=( openmp cmake llvm/include )
 llvm.org_set_globals
 
-python_check_deps() {
-	python_has_version "dev-python/lit[${PYTHON_USEDEP}]"
-}
-
 kernel_pds_check() {
 	if use kernel_linux && kernel_is -lt 4 15 && kernel_is -ge 4 13; then
 		local CONFIG_CHECK="~!SCHED_PDS"
@@ -72,7 +75,9 @@ pkg_pretend() {
 
 pkg_setup() {
 	use offload && LLVM_MAX_SLOT=${LLVM_MAJOR} llvm_pkg_setup
-	use test && python-any-r1_pkg_setup
+	if use gdb-plugin || use test; then
+		python-single-r1_pkg_setup
+	fi
 }
 
 multilib_src_configure() {
@@ -87,6 +92,7 @@ multilib_src_configure() {
 		-DOPENMP_LIBDIR_SUFFIX="${libdir#lib}"
 
 		-DLIBOMP_USE_HWLOC=$(usex hwloc)
+		-DLIBOMP_OMPD_GDB_SUPPORT=$(multilib_native_usex gdb-plugin)
 		-DLIBOMP_OMPT_SUPPORT=$(usex ompt)
 
 		-DOPENMP_ENABLE_LIBOMPTARGET=$(usex offload)
@@ -95,8 +101,6 @@ multilib_src_configure() {
 		-DLIBOMP_INSTALL_ALIASES=OFF
 		# disable unnecessary hack copying stuff back to srcdir
 		-DLIBOMP_COPY_EXPORTS=OFF
-		# disable until upstream fixes it to use positive logic
-		-DDISABLE_OMPD_GDB_PLUGIN=ON
 	)
 
 	if use offload; then

diff --git a/sys-libs/libomp/metadata.xml b/sys-libs/libomp/metadata.xml
index 63801061d848..ec501a894a66 100644
--- a/sys-libs/libomp/metadata.xml
+++ b/sys-libs/libomp/metadata.xml
@@ -10,6 +10,7 @@
 	</maintainer>
 	<use>
 		<flag name="cuda">Build CUDA offloading plugin (only with USE=offload)</flag>
+		<flag name="gdb-plugin">Build OMPD GDB plugin</flag>
 		<flag name="hwloc">Enable CPU affinity support via hwloc</flag>
 		<flag name="offload">Support offloading OpenMP using libomptarget</flag>
 		<flag name="ompt">Enable OpenMP Tools Interface support</flag>