From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1651025-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 274DC1581C1
	for <garchives@archives.gentoo.org>; Mon,  8 Jul 2024 11:39:10 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 45D4CE2A19;
	Mon,  8 Jul 2024 11:39:09 +0000 (UTC)
Received: from smtp.gentoo.org (mail.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) server-digest SHA256)
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 24DD4E2A1C
	for <gentoo-commits@lists.gentoo.org>; Mon,  8 Jul 2024 11:39:09 +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 5932A34300D
	for <gentoo-commits@lists.gentoo.org>; Mon,  8 Jul 2024 11:39:08 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 8F35A1DF0
	for <gentoo-commits@lists.gentoo.org>; Mon,  8 Jul 2024 11:39:06 +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: <1720438737.a4f69f95bd8d46aba0f4eefa44d84dca70d2a8fe.sam@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/pocl/
X-VCS-Repository: repo/gentoo
X-VCS-Files: dev-libs/pocl/Manifest dev-libs/pocl/pocl-6.0.ebuild
X-VCS-Directories: dev-libs/pocl/
X-VCS-Committer: sam
X-VCS-Committer-Name: Sam James
X-VCS-Revision: a4f69f95bd8d46aba0f4eefa44d84dca70d2a8fe
X-VCS-Branch: master
Date: Mon,  8 Jul 2024 11:39:06 +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: df72d4c9-3fac-4f6f-9332-174ceb07b1cb
X-Archives-Hash: 99b1b4d01af6a26b97c49bea9dd0f6cf

commit:     a4f69f95bd8d46aba0f4eefa44d84dca70d2a8fe
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Jul  8 11:37:58 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Jul  8 11:38:57 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a4f69f95

dev-libs/pocl: add 6.0

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

 dev-libs/pocl/Manifest        |   1 +
 dev-libs/pocl/pocl-6.0.ebuild | 109 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 110 insertions(+)

diff --git a/dev-libs/pocl/Manifest b/dev-libs/pocl/Manifest
index 336dcf9d0f22..3d8203f4e5c7 100644
--- a/dev-libs/pocl/Manifest
+++ b/dev-libs/pocl/Manifest
@@ -1,2 +1,3 @@
 DIST pocl-4.0.tar.gz 2140919 BLAKE2B 1e9dd4de4824dd4a9e2b0d053d1786062c135d3bf7ca99dc884657b89c651fca6c0f3dedb568439802a58b0bfabc10939ca344b0110ae5fdb31be06f596d2a48 SHA512 3835a9e8fc8562d50a91a11b807cf87a096891f5c27675127b66412eacff2e541b6143b49b4155f43a09f4e53faa062ec20f3b20badeca206ece9f45ad50f26a
 DIST pocl-5.0.tar.gz 2361502 BLAKE2B eca07953ff56e7e4ca10f71db12819547bc8ff28da26e569c3544edd802f9ded0a8bd0d9cb260069cfe3788f9bc6c84d6ae96c1148c4e92fe6268a95a60ee5b6 SHA512 c2d6c80cbcba7af1c31dfa794c2aa7be6d1ce2cc9900fbf6e0a1536747440602cdc0f1a84f81f85737818a7ea60b490558ef328b3b156e52c63db3fe4ce490b0
+DIST pocl-6.0.tar.gz 2466652 BLAKE2B e074f35bfe8ccd70038fe05ca01da033849bed83075330f1149597455a5892281d4d09b8db5b4731e7e0c248d1ffdc8e8707c1ebe53d50624294ad92aa886be6 SHA512 a24efadbbb81c810cd5c4bbb8abfa75b9bbdfeca786e8471dd75d40a78024d04c1b5c5a7114e75e1eb70a1b6a3756bb47ba741de0f1c4d1416fbce4688d62cc0

diff --git a/dev-libs/pocl/pocl-6.0.ebuild b/dev-libs/pocl/pocl-6.0.ebuild
new file mode 100644
index 000000000000..f88860b92181
--- /dev/null
+++ b/dev-libs/pocl/pocl-6.0.ebuild
@@ -0,0 +1,109 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+LLVM_COMPAT=( {15..18} )
+inherit cmake llvm-r1
+
+DESCRIPTION="Portable Computing Language (an implementation of OpenCL)"
+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"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc64"
+# TODO: hsa tce
+IUSE="accel +conformance cuda debug examples float-conversion hardening +hwloc memmanager test"
+# Tests not yet passing, fragile in Portage environment(?)
+RESTRICT="!test? ( test ) test"
+
+CLANG_DEPS="
+	$(llvm_gen_dep '
+		!cuda? (
+			sys-devel/clang:${LLVM_SLOT}=
+			sys-devel/llvm:${LLVM_SLOT}=
+		)
+		cuda? (
+			sys-devel/clang:${LLVM_SLOT}=[llvm_targets_NVPTX]
+			sys-devel/llvm:${LLVM_SLOT}=[llvm_targets_NVPTX]
+		)
+	')
+"
+RDEPEND="
+	${CLANG_DEPS}
+	dev-libs/libltdl
+	virtual/opencl
+	debug? ( dev-util/lttng-ust:= )
+	hwloc? ( sys-apps/hwloc:=[cuda?] )
+"
+DEPEND="${RDEPEND}"
+BDEPEND="
+	${CLANG_DEPS}
+	virtual/pkgconfig
+"
+
+src_configure() {
+	local host_cpu_variants="generic"
+
+	if use amd64 ; then
+		# Use pocl's curated list of CPU variants which should contain a good match for any given amd64 CPU
+		host_cpu_variants="distro"
+	elif use ppc64 ; then
+		# A selection of architectures in which new Altivec / VSX features were added
+		# This attempts to recreate the amd64 "distro" option for ppc64
+		# See discussion in bug #831859
+		host_cpu_variants="pwr10;pwr9;pwr8;pwr7;pwr6;g5;a2;generic"
+	elif use riscv; then
+		host_cpu_variants="generic-rv64"
+	fi
+
+	local mycmakeargs=(
+		-DENABLE_HSA=OFF
+
+		-DENABLE_ICD=ON
+		-DPOCL_ICD_ABSOLUTE_PATH=ON
+		-DPOCL_INSTALL_PUBLIC_LIBDIR="${EPREFIX}/usr/$(get_libdir)/OpenCL/vendors/pocl"
+
+		# only appends -flto
+		-DENABLE_IPO=OFF
+
+		-DENABLE_POCL_BUILDING=ON
+		-DKERNELLIB_HOST_CPU_VARIANTS="${host_cpu_variants}"
+
+		-DSTATIC_LLVM=OFF
+		-DWITH_LLVM_CONFIG=$(get_llvm_prefix -d)/bin/llvm-config
+
+		-DENABLE_ALMAIF_DEVICE=$(usex accel)
+		-DENABLE_CONFORMANCE=$(usex conformance)
+		-DENABLE_CUDA=$(usex cuda)
+		-DENABLE_HWLOC=$(usex hwloc)
+		-DENABLE_POCL_FLOAT_CONVERSION=$(usex float-conversion)
+		-DHARDENING_ENABLE=$(usex hardening)
+		-DPOCL_DEBUG_MESSAGES=$(usex debug)
+		-DUSE_POCL_MEMMANAGER=$(usex memmanager)
+		-DENABLE_TESTS=$(usex test)
+	)
+
+	cmake_src_configure
+}
+
+src_test() {
+	export POCL_BUILDING=1
+	export POCL_DEVICES=basic
+	export CTEST_OUTPUT_ON_FAILURE=1
+	export TEST_VERBOSE=1
+
+	# Referenced https://github.com/pocl/pocl/blob/master/.drone.yml
+	# But couldn't seem to get tests working yet
+	cmake_src_test
+}
+
+src_install() {
+	cmake_src_install
+
+	if use examples; then
+		dodoc -r examples
+		docompress -x /usr/share/doc/${P}/examples
+	fi
+}