Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/pocl/
Date: Thu, 23 Sep 2021 06:36:18
Message-Id: 1632378962.a47d0fd7fd70bfdf59853f5ae4b34c9d36c9dbca.sam@gentoo
1 commit: a47d0fd7fd70bfdf59853f5ae4b34c9d36c9dbca
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Thu Sep 23 06:25:43 2021 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Thu Sep 23 06:36:02 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a47d0fd7
7
8 dev-libs/pocl: various fixups
9
10 Mostly fixups I missed when importing from GURU earlier:
11 - LLVM deps
12 - General tidying
13
14 Signed-off-by: Sam James <sam <AT> gentoo.org>
15
16 .../pocl/{pocl-1.7.ebuild => pocl-1.7-r1.ebuild} | 47 +++++++++++++++-------
17 1 file changed, 32 insertions(+), 15 deletions(-)
18
19 diff --git a/dev-libs/pocl/pocl-1.7.ebuild b/dev-libs/pocl/pocl-1.7-r1.ebuild
20 similarity index 66%
21 rename from dev-libs/pocl/pocl-1.7.ebuild
22 rename to dev-libs/pocl/pocl-1.7-r1.ebuild
23 index 74100b13bb3..d5f2724b962 100644
24 --- a/dev-libs/pocl/pocl-1.7.ebuild
25 +++ b/dev-libs/pocl/pocl-1.7-r1.ebuild
26 @@ -1,7 +1,7 @@
27 # Copyright 1999-2021 Gentoo Authors
28 # Distributed under the terms of the GNU General Public License v2
29
30 -EAPI="7"
31 +EAPI=7
32
33 DOCS_AUTODOC=0
34 DOCS_BUILDER="sphinx"
35 @@ -13,10 +13,7 @@ inherit cmake llvm python-any-r1 docs
36 LLVM_MAX_SLOT=12
37
38 DESCRIPTION="Portable Computing Language (an implementation of OpenCL)"
39 -HOMEPAGE="
40 - http://portablecl.org
41 - https://github.com/pocl/pocl
42 -"
43 +HOMEPAGE="http://portablecl.org https://github.com/pocl/pocl"
44 SRC_URI="https://github.com/pocl/pocl/archive/v${PV}.tar.gz -> ${P}.tar.gz"
45
46 LICENSE="GPL-2"
47 @@ -26,35 +23,51 @@ IUSE="accel cl20 +conformance cuda debug examples float-conversion hardening +hw
48
49 RESTRICT="!test? ( test ) mirror"
50
51 -#TODO: add dependencies for cuda
52 +# TODO: add dependencies for cuda
53 +# Note: No := on LLVM because it pulls in Clang
54 +# see llvm.eclass for why
55 +CLANG_DEPS="!cuda? ( <sys-devel/clang-$((${LLVM_MAX_SLOT} + 1)):= )
56 + cuda? ( <sys-devel/clang-$((${LLVM_MAX_SLOT} + 1)):=[llvm_targets_NVPTX] )"
57 RDEPEND="
58 dev-libs/libltdl
59 - sys-devel/llvm:${LLVM_MAX_SLOT}
60 + <sys-devel/llvm-$((${LLVM_MAX_SLOT} + 1))
61 virtual/opencl
62
63 - !cuda? ( sys-devel/clang:${LLVM_MAX_SLOT} )
64 - cuda? ( sys-devel/clang:${LLVM_MAX_SLOT}[llvm_targets_NVPTX] )
65 + ${CLANG_DEPS}
66 debug? ( dev-util/lttng-ust )
67 hwloc? ( sys-apps/hwloc[cuda?] )
68 "
69 DEPEND="${RDEPEND}"
70 -BDEPEND="virtual/pkgconfig
71 +BDEPEND="${CLANG_DEPS}
72 + virtual/pkgconfig
73 doc? (
74 $(python_gen_any_dep '<dev-python/markupsafe-2.0[${PYTHON_USEDEP}]')
75 )"
76
77 -PATCHES=( "${FILESDIR}/vendor_opencl_libs_location.patch" )
78 +PATCHES=(
79 + "${FILESDIR}/vendor_opencl_libs_location.patch"
80 +)
81
82 python_check_deps() {
83 has_version -b "<dev-python/markupsafe-2.0[${PYTHON_USEDEP}]"
84 }
85
86 +llvm_check_deps() {
87 + local usedep=$(usex cuda "[llvm_targets_NVPTX]" '')
88 +
89 + # Clang is used at both build time (executed) and runtime
90 + has_version -r "sys-devel/llvm:${LLVM_SLOT}${usedep}" && \
91 + has_version -r "sys-devel/clang:${LLVM_SLOT}${usedep}" && \
92 + has_version -b "sys-devel/clang:${LLVM_SLOT}${usedep}"
93 +}
94 +
95 pkg_setup() {
96 use doc && python-any-r1_pkg_setup
97 +
98 + llvm_pkg_setup
99 }
100
101 src_configure() {
102 - llvm_pkg_setup
103 local mycmakeargs=(
104 -DBUILD_SHARED_LIBS=ON
105 -DENABLE_HSA=OFF
106 @@ -63,6 +76,7 @@ src_configure() {
107 -DKERNELLIB_HOST_CPU_VARIANTS=native
108 -DPOCL_ICD_ABSOLUTE_PATH=ON
109 -DSTATIC_LLVM=OFF
110 + -DWITH_LLVM_CONFIG=$(get_llvm_prefix -d "${LLVM_MAX_SLOT}")/bin/llvm-config
111
112 -DENABLE_ACCEL_DEVICE=$(usex accel)
113 -DENABLE_CONFORMANCE=$(usex conformance)
114 @@ -73,8 +87,8 @@ src_configure() {
115 -DHARDENING_ENABLE=$(usex hardening)
116 -DPOCL_DEBUG_MESSAGES=$(usex debug)
117 -DUSE_POCL_MEMMANAGER=$(usex memmanager)
118 - -DWITH_LLVM_CONFIG=$(get_llvm_prefix "${LLVM_MAX_SLOT}")/bin/llvm-config
119 )
120 +
121 cmake_src_configure
122 }
123
124 @@ -91,13 +105,16 @@ src_test() {
125
126 src_install() {
127 cmake_src_install
128 +
129 dodoc CREDITS README CHANGES
130 +
131 if use doc; then
132 dodoc -r _build/html
133 - docompress -x "/usr/share/doc/${P}/html"
134 + docompress -x /usr/share/doc/${P}/html
135 fi
136 +
137 if use examples; then
138 dodoc -r examples
139 - docompress -x "/usr/share/doc/${P}/examples"
140 + docompress -x /usr/share/doc/${P}/examples
141 fi
142 }