1 # Copyright 1999-2019 Gentoo Authors
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://wiki.gentoo.org/wiki/No_homepage"
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"
39 RDEPEND=">=app-admin/eselect-1.2.4"
42 local impl="$(eselect opencl show)"
43 if [[ -n "${impl}" && "${impl}" != '(none)' ]] ; then
44 eselect opencl set "${impl}"
49 insinto /usr/share/eselect/modules
51 #doman opencl.eselect.5
53 local headers=( opencl.h cl_platform.h cl.h cl_ext.h cl_gl.h cl_gl_ext.h cl_egl.h )
55 # We install all versions of OpenCL headers
56 for CL_ABI in 1.0 1.1 1.2 2.0 2.1; do
57 mkdir -p "${ED}/usr/$(get_libdir)/OpenCL/global/include/CL-${CL_ABI}"
58 for f in ${headers[@]}; do
59 cp "${WORKDIR}"/OpenCL-Headers-opencl${CL_ABI/./}/${f} "${ED}/usr/$(get_libdir)/OpenCL/global/include/CL-${CL_ABI}/${f}" > /dev/null
63 for i in 1.1 1.2 2.1; do
64 cp "${WORKDIR}"/$i/cl.hpp "${ED}/usr/$(get_libdir)/OpenCL/global/include/CL-${CL_ABI}/"
66 # Create symlinks to newest. Maybe this should be switchable?
67 for f in ${headers[@]}; do
68 dosym "../../$(get_libdir)/OpenCL/global/include/CL-1.2/${f}" "/usr/include/CL/${f}"