1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
8 DESCRIPTION="Utility to change the OpenCL implementation being used"
9 HOMEPAGE="https://www.gentoo.org/"
12 # http://www.khronos.org/registry/cl/api/${CL_ABI}/opencl.h
13 # http://www.khronos.org/registry/cl/api/${CL_ABI}/cl_platform.h
14 # http://www.khronos.org/registry/cl/api/${CL_ABI}/cl.h
15 # http://www.khronos.org/registry/cl/api/${CL_ABI}/cl_ext.h
16 # http://www.khronos.org/registry/cl/api/${CL_ABI}/cl_gl.h
17 # http://www.khronos.org/registry/cl/api/${CL_ABI}/cl_gl_ext.h
18 # http://www.khronos.org/registry/cl/api/${CL_ABI}/cl.hpp
20 # Using copy by Mario Kicherer #496418
23 https://dev.gentoo.org/~xarthisius/distfiles/${P}-r1.tar.xz
24 https://github.com/KhronosGroup/OpenCL-Headers/archive/opencl10.zip
25 https://github.com/KhronosGroup/OpenCL-Headers/archive/opencl11.zip
26 https://github.com/KhronosGroup/OpenCL-Headers/archive/opencl12.zip
27 https://github.com/KhronosGroup/OpenCL-Headers/archive/opencl20.zip
28 https://github.com/KhronosGroup/OpenCL-Headers/archive/opencl21.zip
29 http://packages.gentooexperimental.org/opencl-cpp-headers.tar
33 KEYWORDS="amd64 ~arm64 x86 ~amd64-fbsd ~x86-fbsd"
36 DEPEND="app-arch/xz-utils"
37 RDEPEND=">=app-admin/eselect-1.2.4"
40 local impl="$(eselect opencl show)"
41 if [[ -n "${impl}" && "${impl}" != '(none)' ]] ; then
42 eselect opencl set "${impl}"
47 insinto /usr/share/eselect/modules
49 #doman opencl.eselect.5
51 local headers=( opencl.h cl_platform.h cl.h cl_ext.h cl_gl.h cl_gl_ext.h cl_egl.h )
53 # We install all versions of OpenCL headers
54 for CL_ABI in 1.0 1.1 1.2 2.0 2.1; do
55 mkdir -p "${ED}/usr/$(get_libdir)/OpenCL/global/include/CL-${CL_ABI}"
56 for f in ${headers[@]}; do
57 cp "${WORKDIR}"/OpenCL-Headers-opencl${CL_ABI/./}/${f} "${ED}/usr/$(get_libdir)/OpenCL/global/include/CL-${CL_ABI}/${f}" > /dev/null
61 for i in 1.1 1.2 2.1; do
62 cp "${WORKDIR}"/$i/cl.hpp "${ED}/usr/$(get_libdir)/OpenCL/global/include/CL-${CL_ABI}/"
64 # Create symlinks to newest. Maybe this should be switchable?
65 for f in ${headers[@]}; do
66 dosym "${ED}/usr/$(get_libdir)/OpenCL/global/include/CL-1.2/${f}" "/usr/include/CL/${f}"