1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
5 PYTHON_COMPAT=( python3_{6,7,8} )
7 inherit llvm prefix python-any-r1 toolchain-funcs
9 DESCRIPTION="OpenCL C library"
10 HOMEPAGE="https://libclc.llvm.org/"
11 # libclc subdir of https://github.com/llvm/llvm-project.git
12 SRC_URI="https://dev.gentoo.org/~mgorny/dist/${P}.tar.xz"
14 LICENSE="Apache-2.0-with-LLVM-exceptions || ( MIT BSD )"
17 IUSE_VIDEO_CARDS="video_cards_nvidia video_cards_r600 video_cards_radeonsi"
18 IUSE="${IUSE_VIDEO_CARDS}"
19 REQUIRED_USE="|| ( ${IUSE_VIDEO_CARDS} )"
31 has_version -b "sys-devel/clang:${LLVM_SLOT}"
37 hprefixify configure.py
42 # we do not need llvm_pkg_setup
43 python-any-r1_pkg_setup
47 local libclc_targets=()
49 use video_cards_nvidia && libclc_targets+=("nvptx--" "nvptx64--" "nvptx--nvidiacl" "nvptx64--nvidiacl")
50 use video_cards_r600 && libclc_targets+=("r600--")
51 use video_cards_radeonsi && libclc_targets+=("amdgcn--" "amdgcn-mesa-mesa3d" "amdgcn--amdhsa")
53 [[ ${#libclc_targets[@]} ]] || die "libclc target missing!"
56 --with-cxx-compiler="$(tc-getCXX)" \
57 --with-llvm-config="$(get_llvm_prefix "${LLVM_MAX_SLOT}")/bin/llvm-config" \
58 --prefix="${EPREFIX}/usr" \
59 "${libclc_targets[@]}" || die