Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/libclc/
Date: Fri, 05 Aug 2022 19:50:15
Message-Id: 1659729003.c4f3be45b8832941028aca5569a8512ce2009b10.mgorny@gentoo
1 commit: c4f3be45b8832941028aca5569a8512ce2009b10
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Fri Aug 5 19:48:49 2022 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Fri Aug 5 19:50:03 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c4f3be45
7
8 dev-libs/libclc: Add 16.* live ebuilds
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 dev-libs/libclc/libclc-16.0.0.9999.ebuild | 70 +++++++++++++++++++++++++++++++
13 1 file changed, 70 insertions(+)
14
15 diff --git a/dev-libs/libclc/libclc-16.0.0.9999.ebuild b/dev-libs/libclc/libclc-16.0.0.9999.ebuild
16 new file mode 100644
17 index 000000000000..4ec05a0a963c
18 --- /dev/null
19 +++ b/dev-libs/libclc/libclc-16.0.0.9999.ebuild
20 @@ -0,0 +1,70 @@
21 +# Copyright 1999-2022 Gentoo Authors
22 +# Distributed under the terms of the GNU General Public License v2
23 +
24 +EAPI=8
25 +
26 +PYTHON_COMPAT=( python3_{8..11} )
27 +inherit cmake llvm llvm.org python-any-r1
28 +
29 +DESCRIPTION="OpenCL C library"
30 +HOMEPAGE="https://libclc.llvm.org/"
31 +
32 +LICENSE="Apache-2.0-with-LLVM-exceptions || ( MIT BSD )"
33 +SLOT="0"
34 +KEYWORDS=""
35 +IUSE_VIDEO_CARDS="video_cards_nvidia video_cards_r600 video_cards_radeonsi"
36 +IUSE="${IUSE_VIDEO_CARDS}"
37 +REQUIRED_USE="|| ( ${IUSE_VIDEO_CARDS} )"
38 +
39 +LLVM_MAX_SLOT=15
40 +BDEPEND="
41 + ${PYTHON_DEPS}
42 + || (
43 + sys-devel/clang:15
44 + sys-devel/clang:14
45 + sys-devel/clang:13
46 + sys-devel/clang:12
47 + sys-devel/clang:11
48 + sys-devel/clang:10
49 + )
50 +"
51 +
52 +LLVM_COMPONENTS=( libclc )
53 +llvm.org_set_globals
54 +
55 +llvm_check_deps() {
56 + has_version -b "sys-devel/clang:${LLVM_SLOT}"
57 +}
58 +
59 +pkg_setup() {
60 + # we do not need llvm_pkg_setup
61 + python-any-r1_pkg_setup
62 +}
63 +
64 +src_configure() {
65 + local libclc_targets=()
66 +
67 + use video_cards_nvidia && libclc_targets+=(
68 + "nvptx--"
69 + "nvptx64--"
70 + "nvptx--nvidiacl"
71 + "nvptx64--nvidiacl"
72 + )
73 + use video_cards_r600 && libclc_targets+=(
74 + "r600--"
75 + )
76 + use video_cards_radeonsi && libclc_targets+=(
77 + "amdgcn--"
78 + "amdgcn-mesa-mesa3d"
79 + "amdgcn--amdhsa"
80 + )
81 + # TODO: spirv
82 + [[ ${#libclc_targets[@]} ]] || die "libclc target missing!"
83 +
84 + libclc_targets=${libclc_targets[*]}
85 + local mycmakeargs=(
86 + -DLIBCLC_TARGETS_TO_BUILD="${libclc_targets// /;}"
87 + -DLLVM_CONFIG="$(get_llvm_prefix "${LLVM_MAX_SLOT}")/bin/llvm-config"
88 + )
89 + cmake_src_configure
90 +}