public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/pocl/
Date: Thu, 23 Sep 2021 06:36:14 +0000 (UTC)	[thread overview]
Message-ID: <1632378962.a47d0fd7fd70bfdf59853f5ae4b34c9d36c9dbca.sam@gentoo> (raw)

commit:     a47d0fd7fd70bfdf59853f5ae4b34c9d36c9dbca
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 23 06:25:43 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Sep 23 06:36:02 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a47d0fd7

dev-libs/pocl: various fixups

Mostly fixups I missed when importing from GURU earlier:
- LLVM deps
- General tidying

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

 .../pocl/{pocl-1.7.ebuild => pocl-1.7-r1.ebuild}   | 47 +++++++++++++++-------
 1 file changed, 32 insertions(+), 15 deletions(-)

diff --git a/dev-libs/pocl/pocl-1.7.ebuild b/dev-libs/pocl/pocl-1.7-r1.ebuild
similarity index 66%
rename from dev-libs/pocl/pocl-1.7.ebuild
rename to dev-libs/pocl/pocl-1.7-r1.ebuild
index 74100b13bb3..d5f2724b962 100644
--- a/dev-libs/pocl/pocl-1.7.ebuild
+++ b/dev-libs/pocl/pocl-1.7-r1.ebuild
@@ -1,7 +1,7 @@
 # Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI="7"
+EAPI=7
 
 DOCS_AUTODOC=0
 DOCS_BUILDER="sphinx"
@@ -13,10 +13,7 @@ inherit cmake llvm python-any-r1 docs
 LLVM_MAX_SLOT=12
 
 DESCRIPTION="Portable Computing Language (an implementation of OpenCL)"
-HOMEPAGE="
-	http://portablecl.org
-	https://github.com/pocl/pocl
-"
+HOMEPAGE="http://portablecl.org https://github.com/pocl/pocl"
 SRC_URI="https://github.com/pocl/pocl/archive/v${PV}.tar.gz -> ${P}.tar.gz"
 
 LICENSE="GPL-2"
@@ -26,35 +23,51 @@ IUSE="accel cl20 +conformance cuda debug examples float-conversion hardening +hw
 
 RESTRICT="!test? ( test ) mirror"
 
-#TODO: add dependencies for cuda
+# TODO: add dependencies for cuda
+# Note: No := on LLVM because it pulls in Clang
+# see llvm.eclass for why
+CLANG_DEPS="!cuda? ( <sys-devel/clang-$((${LLVM_MAX_SLOT} + 1)):= )
+	cuda? ( <sys-devel/clang-$((${LLVM_MAX_SLOT} + 1)):=[llvm_targets_NVPTX] )"
 RDEPEND="
 	dev-libs/libltdl
-	sys-devel/llvm:${LLVM_MAX_SLOT}
+	<sys-devel/llvm-$((${LLVM_MAX_SLOT} + 1))
 	virtual/opencl
 
-	!cuda? ( sys-devel/clang:${LLVM_MAX_SLOT} )
-	cuda? ( sys-devel/clang:${LLVM_MAX_SLOT}[llvm_targets_NVPTX] )
+	${CLANG_DEPS}
 	debug? ( dev-util/lttng-ust )
 	hwloc? ( sys-apps/hwloc[cuda?] )
 "
 DEPEND="${RDEPEND}"
-BDEPEND="virtual/pkgconfig
+BDEPEND="${CLANG_DEPS}
+	virtual/pkgconfig
 	doc? (
 		$(python_gen_any_dep '<dev-python/markupsafe-2.0[${PYTHON_USEDEP}]')
 	)"
 
-PATCHES=( "${FILESDIR}/vendor_opencl_libs_location.patch" )
+PATCHES=(
+	"${FILESDIR}/vendor_opencl_libs_location.patch"
+)
 
 python_check_deps() {
 	has_version -b "<dev-python/markupsafe-2.0[${PYTHON_USEDEP}]"
 }
 
+llvm_check_deps() {
+	local usedep=$(usex cuda "[llvm_targets_NVPTX]" '')
+
+	# Clang is used at both build time (executed) and runtime
+	has_version -r "sys-devel/llvm:${LLVM_SLOT}${usedep}" && \
+		has_version -r "sys-devel/clang:${LLVM_SLOT}${usedep}" && \
+		has_version -b "sys-devel/clang:${LLVM_SLOT}${usedep}"
+}
+
 pkg_setup() {
 	use doc && python-any-r1_pkg_setup
+
+	llvm_pkg_setup
 }
 
 src_configure() {
-	llvm_pkg_setup
 	local mycmakeargs=(
 		-DBUILD_SHARED_LIBS=ON
 		-DENABLE_HSA=OFF
@@ -63,6 +76,7 @@ src_configure() {
 		-DKERNELLIB_HOST_CPU_VARIANTS=native
 		-DPOCL_ICD_ABSOLUTE_PATH=ON
 		-DSTATIC_LLVM=OFF
+		-DWITH_LLVM_CONFIG=$(get_llvm_prefix -d "${LLVM_MAX_SLOT}")/bin/llvm-config
 
 		-DENABLE_ACCEL_DEVICE=$(usex accel)
 		-DENABLE_CONFORMANCE=$(usex conformance)
@@ -73,8 +87,8 @@ src_configure() {
 		-DHARDENING_ENABLE=$(usex hardening)
 		-DPOCL_DEBUG_MESSAGES=$(usex debug)
 		-DUSE_POCL_MEMMANAGER=$(usex memmanager)
-		-DWITH_LLVM_CONFIG=$(get_llvm_prefix "${LLVM_MAX_SLOT}")/bin/llvm-config
 	)
+
 	cmake_src_configure
 }
 
@@ -91,13 +105,16 @@ src_test() {
 
 src_install() {
 	cmake_src_install
+
 	dodoc CREDITS README CHANGES
+
 	if use doc; then
 		dodoc -r _build/html
-		docompress -x "/usr/share/doc/${P}/html"
+		docompress -x /usr/share/doc/${P}/html
 	fi
+
 	if use examples; then
 		dodoc -r examples
-		docompress -x "/usr/share/doc/${P}/examples"
+		docompress -x /usr/share/doc/${P}/examples
 	fi
 }


             reply	other threads:[~2021-09-23  6:36 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-23  6:36 Sam James [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-09-23  6:38 [gentoo-commits] repo/gentoo:master commit in: dev-libs/pocl/ Sam James
2021-10-13  1:12 Sam James
2021-10-29 22:44 Sam James
2022-01-03  7:41 Sam James
2022-01-03  8:02 Sam James
2022-04-17 16:44 Sam James
2022-07-20  5:10 Sam James
2022-07-24  1:07 Sam James
2022-07-26  4:49 Sam James
2022-07-26  4:49 Sam James
2022-08-08  6:08 Sam James
2022-12-10  4:48 Sam James
2023-01-21  6:53 Sam James
2023-02-23 20:14 Arthur Zamarin
2023-02-27  0:20 Sam James
2023-08-26  3:51 Sam James
2023-09-27  7:21 Sam James
2023-09-27 13:29 Arthur Zamarin
2024-01-07 11:38 Michał Górny
2024-07-08 11:39 Sam James
2024-07-08 11:43 Sam James
2024-07-15  0:20 Sam James
2024-07-15  1:39 Sam James
2025-02-20 17:21 Patrick Lauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1632378962.a47d0fd7fd70bfdf59853f5ae4b34c9d36c9dbca.sam@gentoo \
    --to=sam@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox