dev-libs/opencl-icd-loader: new package
authorMarek Szuba <marecki@gentoo.org>
Wed, 1 Apr 2020 23:49:11 +0000 (00:49 +0100)
committerMarek Szuba <marecki@gentoo.org>
Thu, 2 Apr 2020 00:20:17 +0000 (01:20 +0100)
The Khronos Group has finally released the first tagged version of their
official ICD loader!

Signed-off-by: Marek Szuba <marecki@gentoo.org>
dev-libs/opencl-icd-loader/Manifest [new file with mode: 0644]
dev-libs/opencl-icd-loader/metadata.xml [new file with mode: 0644]
dev-libs/opencl-icd-loader/opencl-icd-loader-2020.03.13.ebuild [new file with mode: 0644]

diff --git a/dev-libs/opencl-icd-loader/Manifest b/dev-libs/opencl-icd-loader/Manifest
new file mode 100644 (file)
index 0000000..e4390ff
--- /dev/null
@@ -0,0 +1 @@
+DIST opencl-icd-loader-2020.03.13.tar.gz 57833 BLAKE2B 7d74ce808f446554c92fea1e431f2026ed33b6c19a6dd6bf832184f8e4fb34a362464e5b844e99b1866afe55b7a521fa669388f868549882a4fde5c4c3c9313b SHA512 56dadf660d4add8cf779e389be1b4d60742b293c5452d7b114b79fe0d96591e56f338303ea991f1b77a40d321a23d53cb1ad9cc95bec502594ee18335641f060
diff --git a/dev-libs/opencl-icd-loader/metadata.xml b/dev-libs/opencl-icd-loader/metadata.xml
new file mode 100644 (file)
index 0000000..e74450e
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+       <maintainer type="person">
+               <email>marecki@gentoo.org</email>
+               <name>Marek Szuba</name>
+       </maintainer>
+       <upstream>
+               <remote-id type="github">KhronosGroup/OpenCL-ICD-Loader</remote-id>
+       </upstream>
+</pkgmetadata>
+
diff --git a/dev-libs/opencl-icd-loader/opencl-icd-loader-2020.03.13.ebuild b/dev-libs/opencl-icd-loader/opencl-icd-loader-2020.03.13.ebuild
new file mode 100644 (file)
index 0000000..354e602
--- /dev/null
@@ -0,0 +1,48 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+CMAKE_ECLASS=cmake
+inherit cmake-multilib
+
+MY_PN="OpenCL-ICD-Loader"
+MY_P="${MY_PN}-${PV}"
+
+DESCRIPTION="Official Khronos OpenCL ICD Loader"
+HOMEPAGE="https://github.com/KhronosGroup/OpenCL-ICD-Loader"
+SRC_URI="https://github.com/KhronosGroup/${MY_PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="test"
+
+RESTRICT="!test? ( test )"
+
+DEPEND="dev-util/opencl-headers"
+RDEPEND="${DEPEND}
+       app-eselect/eselect-opencl"
+
+S="${WORKDIR}/${MY_P}"
+
+multilib_src_configure() {
+       local ocl_dir="/usr/$(get_libdir)/OpenCL/vendors/${PN}"
+
+       local mycmakeargs=(
+               -DCMAKE_INSTALL_PREFIX="${ocl_dir}"
+               -DCMAKE_INSTALL_LIBDIR="${ocl_dir}"
+               -DBUILD_TESTING=$(usex test)
+               -DOPENCL_ICD_LOADER_HEADERS_DIR="${ocl_dir}/include"
+       )
+       cmake_src_configure
+}
+
+multilib_src_test() {
+       OCL_ICD_FILENAMES="${BUILD_DIR}/test/driver_stub/libOpenCLDriverStub.so" \
+       cmake_src_test
+}
+
+pkg_postinst() {
+       eselect opencl set --use-old "${PN}"
+}