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: Sun, 06 Feb 2022 15:35:13
Message-Id: 1644161670.b34839c133f69c0f6f8f9f4beef3e1dea5dc1805.mgorny@gentoo
1 commit: b34839c133f69c0f6f8f9f4beef3e1dea5dc1805
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Sun Feb 6 15:16:52 2022 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Sun Feb 6 15:34:30 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b34839c1
7
8 dev-libs/libclc: Add 15.x live ebuild
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 dev-libs/libclc/libclc-15.0.0.9999.ebuild | 68 +++++++++++++++++++++++++++++++
13 1 file changed, 68 insertions(+)
14
15 diff --git a/dev-libs/libclc/libclc-15.0.0.9999.ebuild b/dev-libs/libclc/libclc-15.0.0.9999.ebuild
16 new file mode 100644
17 index 000000000000..36da442fa39d
18 --- /dev/null
19 +++ b/dev-libs/libclc/libclc-15.0.0.9999.ebuild
20 @@ -0,0 +1,68 @@
21 +# Copyright 1999-2022 Gentoo Authors
22 +# Distributed under the terms of the GNU General Public License v2
23 +
24 +EAPI=7
25 +
26 +PYTHON_COMPAT=( python3_{8..10} )
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=14
40 +BDEPEND="
41 + || (
42 + sys-devel/clang:14
43 + sys-devel/clang:13
44 + sys-devel/clang:12
45 + sys-devel/clang:11
46 + sys-devel/clang:10
47 + )
48 + ${PYTHON_DEPS}"
49 +
50 +LLVM_COMPONENTS=( libclc )
51 +llvm.org_set_globals
52 +
53 +llvm_check_deps() {
54 + has_version -b "sys-devel/clang:${LLVM_SLOT}"
55 +}
56 +
57 +pkg_setup() {
58 + # we do not need llvm_pkg_setup
59 + python-any-r1_pkg_setup
60 +}
61 +
62 +src_configure() {
63 + local libclc_targets=()
64 +
65 + use video_cards_nvidia && libclc_targets+=(
66 + "nvptx--"
67 + "nvptx64--"
68 + "nvptx--nvidiacl"
69 + "nvptx64--nvidiacl"
70 + )
71 + use video_cards_r600 && libclc_targets+=(
72 + "r600--"
73 + )
74 + use video_cards_radeonsi && libclc_targets+=(
75 + "amdgcn--"
76 + "amdgcn-mesa-mesa3d"
77 + "amdgcn--amdhsa"
78 + )
79 + # TODO: spirv
80 + [[ ${#libclc_targets[@]} ]] || die "libclc target missing!"
81 +
82 + libclc_targets=${libclc_targets[*]}
83 + local mycmakeargs=(
84 + -DLIBCLC_TARGETS_TO_BUILD="${libclc_targets// /;}"
85 + -DLLVM_CONFIG="$(get_llvm_prefix "${LLVM_MAX_SLOT}")/bin/llvm-config"
86 + )
87 + cmake_src_configure
88 +}