1 |
commit: d32508327cc34a061fc2294cc0a438b91ff63b2e |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Nov 4 14:19:46 2022 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Nov 4 17:14:43 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d3250832 |
7 |
|
8 |
sys-devel/clang: Add 16.0.0_pre20221104 |
9 |
|
10 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
11 |
|
12 |
sys-devel/clang/Manifest | 1 + |
13 |
sys-devel/clang/clang-16.0.0_pre20221104.ebuild | 457 ++++++++++++++++++++++++ |
14 |
2 files changed, 458 insertions(+) |
15 |
|
16 |
diff --git a/sys-devel/clang/Manifest b/sys-devel/clang/Manifest |
17 |
index fc4a86bfefdd..27dcf2a6b65a 100644 |
18 |
--- a/sys-devel/clang/Manifest |
19 |
+++ b/sys-devel/clang/Manifest |
20 |
@@ -15,5 +15,6 @@ DIST llvm-project-15.0.3.src.tar.xz 112069972 BLAKE2B 3d29bab890467ba87fedcc4e76 |
21 |
DIST llvm-project-15.0.3.src.tar.xz.sig 438 BLAKE2B e7e0614e144eb878f694c12e97cf42ff8476e47cb55e8f259eb2ec52e303463ad753771271512e89baf0137c1382b11cfa028c85324174ebcd054a124000f537 SHA512 41229bebdb0c2df9a5e3a4d6f02d39fac7dc91f21895a659523beab4fa3ef99ff06eff5e4386221369b6e2b6f8fe974d67b7d8496d5911ce484d09ae0db8b916 |
22 |
DIST llvm-project-15.0.4.src.tar.xz 110936424 BLAKE2B a02b76ad161e352b4d3d84baffdada9c6a0e704de7a2c4017df4d4d05a9e9d02113791cd7d91c3edfa1f5bcb7ab95e1772d60f7061514928c6828600f41a8322 SHA512 9d5b664dd77c08130601636f9d6c006b257f369470ce823aa56d06698a9f0edfec42f2c90da934b9ad52c4d7960d9a024ea46dc9640275be6d191b1ba9869459 |
23 |
DIST llvm-project-15.0.4.src.tar.xz.sig 566 BLAKE2B f1a7be65fcce932dc125ae2b498f68a14e68dad0d7a1e031343c52c5dafb7b123e346f3efa50a7693584361abf01efe9401b1b5781dee6b92dc1045e538e9b7b SHA512 35899ffbd13fc44cade54246a423450571cb4b62b8d706864daa3eef2377c48e24ef3113218e39e29de995b7f7fa307f9187552766576c9050fd924beb517f6e |
24 |
+DIST llvm-project-1fb186198af5f183dde053c1396f899567755d64.tar.gz 170328817 BLAKE2B c79199044e8d636127d1d163ceea856c1bcb1d59c892e9c72869ab788b4feb23f8c28585ac761764b4e29b883c61e43be9341610a523d8b64471200bb3aecfaa SHA512 8b366dc70506ceb70a5584ad051e100fa1cc620388fc757536ef775d102b4baaac016d4f62dbc8b1d9dd00b587622a25d9da735196d336faf35d611145cf5fdc |
25 |
DIST llvm-project-b34ea582774c057d9bf5591174d683fd3d8aa02b.tar.gz 169735900 BLAKE2B d3a82a07f855b038071fc8eb3f41a88b4c220a577219985ecddeb9a535ea8b159dbad575699997d90a49db74c074b5f4354ad707e91d6934daaa7319e0d8ee9b SHA512 3f5525c7d893bdac701cff4cf82dafc31608920d788d9b7401654f320b2432528cf4ae8ef013182807b3dc0c5b758c71f1efeedb672dd47fdb8aa6f434dfb583 |
26 |
DIST llvmorg-13.0.1.tar.gz 147290251 BLAKE2B 2a44b012a672501761d0c27c6b3a315b69bfef0cd13b078a7e7d2fccc4a9c8c0f2bee0f164c4271c9106b0a99cb06e8b64986f66253b613336719fb86b82541b SHA512 9a8cb5d11964ba88b7624f19ec861fb28701f23956ea3c92f6ac644332d5f41fde97bd8933dd3ee70ed378058c252fa3a3887c8d1af90d219970c2b27691166f |
27 |
|
28 |
diff --git a/sys-devel/clang/clang-16.0.0_pre20221104.ebuild b/sys-devel/clang/clang-16.0.0_pre20221104.ebuild |
29 |
new file mode 100644 |
30 |
index 000000000000..4540835f97a0 |
31 |
--- /dev/null |
32 |
+++ b/sys-devel/clang/clang-16.0.0_pre20221104.ebuild |
33 |
@@ -0,0 +1,457 @@ |
34 |
+# Copyright 1999-2022 Gentoo Authors |
35 |
+# Distributed under the terms of the GNU General Public License v2 |
36 |
+ |
37 |
+EAPI=8 |
38 |
+ |
39 |
+PYTHON_COMPAT=( python3_{8..11} ) |
40 |
+inherit cmake llvm llvm.org multilib multilib-minimal \ |
41 |
+ prefix python-single-r1 toolchain-funcs |
42 |
+ |
43 |
+DESCRIPTION="C language family frontend for LLVM" |
44 |
+HOMEPAGE="https://llvm.org/" |
45 |
+ |
46 |
+# MSVCSetupApi.h: MIT |
47 |
+# sorttable.js: MIT |
48 |
+ |
49 |
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA MIT" |
50 |
+SLOT="${LLVM_MAJOR}/${LLVM_SOABI}" |
51 |
+KEYWORDS="" |
52 |
+IUSE="debug doc +extra +pie +static-analyzer test xml" |
53 |
+REQUIRED_USE="${PYTHON_REQUIRED_USE}" |
54 |
+RESTRICT="!test? ( test )" |
55 |
+ |
56 |
+DEPEND=" |
57 |
+ ~sys-devel/llvm-${PV}:${LLVM_MAJOR}=[debug=,${MULTILIB_USEDEP}] |
58 |
+ static-analyzer? ( dev-lang/perl:* ) |
59 |
+ xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] ) |
60 |
+" |
61 |
+ |
62 |
+RDEPEND=" |
63 |
+ ${PYTHON_DEPS} |
64 |
+ ${DEPEND} |
65 |
+ >=sys-devel/clang-common-${PV} |
66 |
+ ~sys-devel/clang-runtime-${PV} |
67 |
+" |
68 |
+BDEPEND=" |
69 |
+ ${PYTHON_DEPS} |
70 |
+ >=dev-util/cmake-3.16 |
71 |
+ doc? ( $(python_gen_cond_dep ' |
72 |
+ dev-python/recommonmark[${PYTHON_USEDEP}] |
73 |
+ dev-python/sphinx[${PYTHON_USEDEP}] |
74 |
+ ') ) |
75 |
+ xml? ( virtual/pkgconfig ) |
76 |
+" |
77 |
+PDEPEND=" |
78 |
+ sys-devel/clang-toolchain-symlinks:${LLVM_MAJOR} |
79 |
+" |
80 |
+ |
81 |
+LLVM_COMPONENTS=( |
82 |
+ clang clang-tools-extra cmake |
83 |
+ llvm/lib/Transforms/Hello |
84 |
+) |
85 |
+LLVM_MANPAGES=1 |
86 |
+LLVM_TEST_COMPONENTS=( |
87 |
+ llvm/lib/Testing/Support |
88 |
+ llvm/utils |
89 |
+) |
90 |
+LLVM_PATCHSET=9999-r4 |
91 |
+LLVM_USE_TARGETS=llvm |
92 |
+llvm.org_set_globals |
93 |
+ |
94 |
+# Multilib notes: |
95 |
+# 1. ABI_* flags control ABIs libclang* is built for only. |
96 |
+# 2. clang is always capable of compiling code for all ABIs for enabled |
97 |
+# target. However, you will need appropriate crt* files (installed |
98 |
+# e.g. by sys-devel/gcc and sys-libs/glibc). |
99 |
+# 3. ${CHOST}-clang wrappers are always installed for all ABIs included |
100 |
+# in the current profile (i.e. alike supported by sys-devel/gcc). |
101 |
+# |
102 |
+# Therefore: use sys-devel/clang[${MULTILIB_USEDEP}] only if you need |
103 |
+# multilib clang* libraries (not runtime, not wrappers). |
104 |
+ |
105 |
+pkg_setup() { |
106 |
+ LLVM_MAX_SLOT=${LLVM_MAJOR} llvm_pkg_setup |
107 |
+ python-single-r1_pkg_setup |
108 |
+} |
109 |
+ |
110 |
+src_prepare() { |
111 |
+ # create extra parent dir for relative CLANG_RESOURCE_DIR access |
112 |
+ mkdir -p x/y || die |
113 |
+ BUILD_DIR=${WORKDIR}/x/y/clang |
114 |
+ |
115 |
+ llvm.org_src_prepare |
116 |
+ |
117 |
+ # add Gentoo Portage Prefix for Darwin (see prefix-dirs.patch) |
118 |
+ eprefixify \ |
119 |
+ lib/Lex/InitHeaderSearch.cpp \ |
120 |
+ lib/Driver/ToolChains/Darwin.cpp || die |
121 |
+} |
122 |
+ |
123 |
+check_distribution_components() { |
124 |
+ if [[ ${CMAKE_MAKEFILE_GENERATOR} == ninja ]]; then |
125 |
+ local all_targets=() my_targets=() l |
126 |
+ cd "${BUILD_DIR}" || die |
127 |
+ |
128 |
+ while read -r l; do |
129 |
+ if [[ ${l} == install-*-stripped:* ]]; then |
130 |
+ l=${l#install-} |
131 |
+ l=${l%%-stripped*} |
132 |
+ |
133 |
+ case ${l} in |
134 |
+ # meta-targets |
135 |
+ clang-libraries|distribution) |
136 |
+ continue |
137 |
+ ;; |
138 |
+ # tools |
139 |
+ clang|clangd|clang-*) |
140 |
+ ;; |
141 |
+ # static libraries |
142 |
+ clang*|findAllSymbols) |
143 |
+ continue |
144 |
+ ;; |
145 |
+ # conditional to USE=doc |
146 |
+ docs-clang-html|docs-clang-tools-html) |
147 |
+ use doc || continue |
148 |
+ ;; |
149 |
+ esac |
150 |
+ |
151 |
+ all_targets+=( "${l}" ) |
152 |
+ fi |
153 |
+ done < <(${NINJA} -t targets all) |
154 |
+ |
155 |
+ while read -r l; do |
156 |
+ my_targets+=( "${l}" ) |
157 |
+ done < <(get_distribution_components $"\n") |
158 |
+ |
159 |
+ local add=() remove=() |
160 |
+ for l in "${all_targets[@]}"; do |
161 |
+ if ! has "${l}" "${my_targets[@]}"; then |
162 |
+ add+=( "${l}" ) |
163 |
+ fi |
164 |
+ done |
165 |
+ for l in "${my_targets[@]}"; do |
166 |
+ if ! has "${l}" "${all_targets[@]}"; then |
167 |
+ remove+=( "${l}" ) |
168 |
+ fi |
169 |
+ done |
170 |
+ |
171 |
+ if [[ ${#add[@]} -gt 0 || ${#remove[@]} -gt 0 ]]; then |
172 |
+ eqawarn "get_distribution_components() is outdated!" |
173 |
+ eqawarn " Add: ${add[*]}" |
174 |
+ eqawarn "Remove: ${remove[*]}" |
175 |
+ fi |
176 |
+ cd - >/dev/null || die |
177 |
+ fi |
178 |
+} |
179 |
+ |
180 |
+get_distribution_components() { |
181 |
+ local sep=${1-;} |
182 |
+ |
183 |
+ local out=( |
184 |
+ # common stuff |
185 |
+ clang-cmake-exports |
186 |
+ clang-headers |
187 |
+ clang-resource-headers |
188 |
+ libclang-headers |
189 |
+ |
190 |
+ aarch64-resource-headers |
191 |
+ arm-common-resource-headers |
192 |
+ arm-resource-headers |
193 |
+ core-resource-headers |
194 |
+ cuda-resource-headers |
195 |
+ hexagon-resource-headers |
196 |
+ hip-resource-headers |
197 |
+ hlsl-resource-headers |
198 |
+ mips-resource-headers |
199 |
+ opencl-resource-headers |
200 |
+ openmp-resource-headers |
201 |
+ ppc-htm-resource-headers |
202 |
+ ppc-resource-headers |
203 |
+ riscv-resource-headers |
204 |
+ systemz-resource-headers |
205 |
+ utility-resource-headers |
206 |
+ ve-resource-headers |
207 |
+ webassembly-resource-headers |
208 |
+ windows-resource-headers |
209 |
+ x86-resource-headers |
210 |
+ |
211 |
+ # libs |
212 |
+ clang-cpp |
213 |
+ libclang |
214 |
+ ) |
215 |
+ |
216 |
+ if multilib_is_native_abi; then |
217 |
+ out+=( |
218 |
+ # common stuff |
219 |
+ bash-autocomplete |
220 |
+ libclang-python-bindings |
221 |
+ |
222 |
+ # tools |
223 |
+ c-index-test |
224 |
+ clang |
225 |
+ clang-format |
226 |
+ clang-offload-bundler |
227 |
+ clang-offload-packager |
228 |
+ clang-refactor |
229 |
+ clang-repl |
230 |
+ clang-rename |
231 |
+ clang-scan-deps |
232 |
+ diagtool |
233 |
+ hmaptool |
234 |
+ ) |
235 |
+ |
236 |
+ if use extra; then |
237 |
+ out+=( |
238 |
+ # extra tools |
239 |
+ clang-apply-replacements |
240 |
+ clang-change-namespace |
241 |
+ clang-doc |
242 |
+ clang-include-cleaner |
243 |
+ clang-include-fixer |
244 |
+ clang-move |
245 |
+ clang-pseudo |
246 |
+ clang-query |
247 |
+ clang-reorder-fields |
248 |
+ clang-tidy |
249 |
+ clang-tidy-headers |
250 |
+ clangd |
251 |
+ find-all-symbols |
252 |
+ modularize |
253 |
+ pp-trace |
254 |
+ ) |
255 |
+ fi |
256 |
+ |
257 |
+ if llvm_are_manpages_built; then |
258 |
+ out+=( docs-clang-man ) |
259 |
+ use extra && out+=( docs-clang-tools-man ) |
260 |
+ fi |
261 |
+ |
262 |
+ if use doc; then |
263 |
+ out+=( docs-clang-html ) |
264 |
+ use extra && out+=( docs-clang-tools-html ) |
265 |
+ fi |
266 |
+ |
267 |
+ use static-analyzer && out+=( |
268 |
+ clang-check |
269 |
+ clang-extdef-mapping |
270 |
+ scan-build |
271 |
+ scan-build-py |
272 |
+ scan-view |
273 |
+ ) |
274 |
+ fi |
275 |
+ |
276 |
+ printf "%s${sep}" "${out[@]}" |
277 |
+} |
278 |
+ |
279 |
+multilib_src_configure() { |
280 |
+ local mycmakeargs=( |
281 |
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}" |
282 |
+ -DCMAKE_INSTALL_MANDIR="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/share/man" |
283 |
+ -DCLANG_CONFIG_FILE_SYSTEM_DIR="${EPREFIX}/etc/clang" |
284 |
+ # relative to bindir |
285 |
+ -DCLANG_RESOURCE_DIR="../../../../lib/clang/${LLVM_VERSION}" |
286 |
+ |
287 |
+ -DBUILD_SHARED_LIBS=OFF |
288 |
+ -DCLANG_LINK_CLANG_DYLIB=ON |
289 |
+ -DLLVM_DISTRIBUTION_COMPONENTS=$(get_distribution_components) |
290 |
+ |
291 |
+ -DLLVM_TARGETS_TO_BUILD="${LLVM_TARGETS// /;}" |
292 |
+ |
293 |
+ # these are not propagated reliably, so redefine them |
294 |
+ -DLLVM_ENABLE_EH=ON |
295 |
+ -DLLVM_ENABLE_RTTI=ON |
296 |
+ |
297 |
+ -DCMAKE_DISABLE_FIND_PACKAGE_LibXml2=$(usex !xml) |
298 |
+ # libgomp support fails to find headers without explicit -I |
299 |
+ # furthermore, it provides only syntax checking |
300 |
+ -DCLANG_DEFAULT_OPENMP_RUNTIME=libomp |
301 |
+ |
302 |
+ # disable using CUDA to autodetect GPU, just build for all |
303 |
+ -DCMAKE_DISABLE_FIND_PACKAGE_CUDA=ON |
304 |
+ |
305 |
+ -DCLANG_DEFAULT_PIE_ON_LINUX=$(usex pie) |
306 |
+ |
307 |
+ -DCLANG_ENABLE_ARCMT=$(usex static-analyzer) |
308 |
+ -DCLANG_ENABLE_STATIC_ANALYZER=$(usex static-analyzer) |
309 |
+ |
310 |
+ -DPython3_EXECUTABLE="${PYTHON}" |
311 |
+ ) |
312 |
+ use test && mycmakeargs+=( |
313 |
+ -DLLVM_BUILD_TESTS=ON |
314 |
+ -DLLVM_LIT_ARGS="$(get_lit_flags)" |
315 |
+ ) |
316 |
+ |
317 |
+ if multilib_is_native_abi; then |
318 |
+ local build_docs=OFF |
319 |
+ if llvm_are_manpages_built; then |
320 |
+ build_docs=ON |
321 |
+ mycmakeargs+=( |
322 |
+ -DLLVM_BUILD_DOCS=ON |
323 |
+ -DLLVM_ENABLE_SPHINX=ON |
324 |
+ -DCLANG_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/html" |
325 |
+ -DSPHINX_WARNINGS_AS_ERRORS=OFF |
326 |
+ ) |
327 |
+ if use extra; then |
328 |
+ mycmakeargs+=( |
329 |
+ -DCLANG-TOOLS_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/tools-extra" |
330 |
+ ) |
331 |
+ fi |
332 |
+ fi |
333 |
+ mycmakeargs+=( |
334 |
+ -DCLANG_INCLUDE_DOCS=${build_docs} |
335 |
+ ) |
336 |
+ fi |
337 |
+ if multilib_native_use extra; then |
338 |
+ mycmakeargs+=( |
339 |
+ -DLLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR="${WORKDIR}"/clang-tools-extra |
340 |
+ -DCLANG_TOOLS_EXTRA_INCLUDE_DOCS=${build_docs} |
341 |
+ ) |
342 |
+ else |
343 |
+ mycmakeargs+=( |
344 |
+ -DLLVM_TOOL_CLANG_TOOLS_EXTRA_BUILD=OFF |
345 |
+ ) |
346 |
+ fi |
347 |
+ |
348 |
+ if [[ -n ${EPREFIX} ]]; then |
349 |
+ mycmakeargs+=( |
350 |
+ -DGCC_INSTALL_PREFIX="${EPREFIX}/usr" |
351 |
+ ) |
352 |
+ fi |
353 |
+ |
354 |
+ if tc-is-cross-compiler; then |
355 |
+ [[ -x "/usr/bin/clang-tblgen" ]] \ |
356 |
+ || die "/usr/bin/clang-tblgen not found or usable" |
357 |
+ mycmakeargs+=( |
358 |
+ -DCMAKE_CROSSCOMPILING=ON |
359 |
+ -DCLANG_TABLEGEN=/usr/bin/clang-tblgen |
360 |
+ ) |
361 |
+ fi |
362 |
+ |
363 |
+ # LLVM can have very high memory consumption while linking, |
364 |
+ # exhausting the limit on 32-bit linker executable |
365 |
+ use x86 && local -x LDFLAGS="${LDFLAGS} -Wl,--no-keep-memory" |
366 |
+ |
367 |
+ # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844 |
368 |
+ use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG" |
369 |
+ cmake_src_configure |
370 |
+ |
371 |
+ multilib_is_native_abi && check_distribution_components |
372 |
+} |
373 |
+ |
374 |
+multilib_src_compile() { |
375 |
+ cmake_build distribution |
376 |
+ |
377 |
+ # provide a symlink for tests |
378 |
+ if [[ ! -L ${WORKDIR}/lib/clang ]]; then |
379 |
+ mkdir -p "${WORKDIR}"/lib || die |
380 |
+ ln -s "${BUILD_DIR}/$(get_libdir)/clang" "${WORKDIR}"/lib/clang || die |
381 |
+ fi |
382 |
+} |
383 |
+ |
384 |
+multilib_src_test() { |
385 |
+ # respect TMPDIR! |
386 |
+ local -x LIT_PRESERVES_TMP=1 |
387 |
+ local test_targets=( check-clang ) |
388 |
+ if multilib_native_use extra; then |
389 |
+ test_targets+=( |
390 |
+ check-clang-tools |
391 |
+ check-clangd |
392 |
+ ) |
393 |
+ fi |
394 |
+ cmake_build "${test_targets[@]}" |
395 |
+} |
396 |
+ |
397 |
+src_install() { |
398 |
+ MULTILIB_WRAPPED_HEADERS=( |
399 |
+ /usr/include/clang/Config/config.h |
400 |
+ ) |
401 |
+ |
402 |
+ multilib-minimal_src_install |
403 |
+ |
404 |
+ # Move runtime headers to /usr/lib/clang, where they belong |
405 |
+ mv "${ED}"/usr/include/clangrt "${ED}"/usr/lib/clang || die |
406 |
+ # move (remaining) wrapped headers back |
407 |
+ if use extra; then |
408 |
+ mv "${T}"/clang-tidy "${ED}"/usr/include/ || die |
409 |
+ fi |
410 |
+ mv "${ED}"/usr/include "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/include || die |
411 |
+ |
412 |
+ # Apply CHOST and version suffix to clang tools |
413 |
+ local clang_tools=( clang clang++ clang-cl clang-cpp ) |
414 |
+ local abi i |
415 |
+ |
416 |
+ # cmake gives us: |
417 |
+ # - clang-X |
418 |
+ # - clang -> clang-X |
419 |
+ # - clang++, clang-cl, clang-cpp -> clang |
420 |
+ # we want to have: |
421 |
+ # - clang-X |
422 |
+ # - clang++-X, clang-cl-X, clang-cpp-X -> clang-X |
423 |
+ # - clang, clang++, clang-cl, clang-cpp -> clang*-X |
424 |
+ # also in CHOST variant |
425 |
+ for i in "${clang_tools[@]:1}"; do |
426 |
+ rm "${ED}/usr/lib/llvm/${LLVM_MAJOR}/bin/${i}" || die |
427 |
+ dosym "clang-${LLVM_MAJOR}" "/usr/lib/llvm/${LLVM_MAJOR}/bin/${i}-${LLVM_MAJOR}" |
428 |
+ dosym "${i}-${LLVM_MAJOR}" "/usr/lib/llvm/${LLVM_MAJOR}/bin/${i}" |
429 |
+ done |
430 |
+ |
431 |
+ # now create target symlinks for all supported ABIs |
432 |
+ for abi in $(get_all_abis); do |
433 |
+ local abi_chost=$(get_abi_CHOST "${abi}") |
434 |
+ for i in "${clang_tools[@]}"; do |
435 |
+ dosym "${i}-${LLVM_MAJOR}" \ |
436 |
+ "/usr/lib/llvm/${LLVM_MAJOR}/bin/${abi_chost}-${i}-${LLVM_MAJOR}" |
437 |
+ dosym "${abi_chost}-${i}-${LLVM_MAJOR}" \ |
438 |
+ "/usr/lib/llvm/${LLVM_MAJOR}/bin/${abi_chost}-${i}" |
439 |
+ done |
440 |
+ done |
441 |
+} |
442 |
+ |
443 |
+multilib_src_install() { |
444 |
+ DESTDIR=${D} cmake_build install-distribution |
445 |
+ |
446 |
+ # move headers to /usr/include for wrapping & ABI mismatch checks |
447 |
+ # (also drop the version suffix from runtime headers) |
448 |
+ rm -rf "${ED}"/usr/include || die |
449 |
+ mv "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/include "${ED}"/usr/include || die |
450 |
+ mv "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/$(get_libdir)/clang "${ED}"/usr/include/clangrt || die |
451 |
+ if multilib_native_use extra; then |
452 |
+ # don't wrap clang-tidy headers, the list is too long |
453 |
+ # (they're fine for non-native ABI but enabling the targets is problematic) |
454 |
+ mv "${ED}"/usr/include/clang-tidy "${T}/" || die |
455 |
+ fi |
456 |
+} |
457 |
+ |
458 |
+multilib_src_install_all() { |
459 |
+ python_fix_shebang "${ED}" |
460 |
+ if use static-analyzer; then |
461 |
+ python_optimize "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/share/scan-view |
462 |
+ fi |
463 |
+ |
464 |
+ docompress "/usr/lib/llvm/${LLVM_MAJOR}/share/man" |
465 |
+ llvm_install_manpages |
466 |
+ # match 'html' non-compression |
467 |
+ use doc && docompress -x "/usr/share/doc/${PF}/tools-extra" |
468 |
+ # +x for some reason; TODO: investigate |
469 |
+ use static-analyzer && fperms a-x "/usr/lib/llvm/${LLVM_MAJOR}/share/man/man1/scan-build.1" |
470 |
+} |
471 |
+ |
472 |
+pkg_postinst() { |
473 |
+ if [[ -z ${ROOT} && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then |
474 |
+ eselect compiler-shadow update all |
475 |
+ fi |
476 |
+ |
477 |
+ elog "You can find additional utility scripts in:" |
478 |
+ elog " ${EROOT}/usr/lib/llvm/${LLVM_MAJOR}/share/clang" |
479 |
+ if use extra; then |
480 |
+ elog "Some of them are vim integration scripts (with instructions inside)." |
481 |
+ elog "The run-clang-tidy.py script requires the following additional package:" |
482 |
+ elog " dev-python/pyyaml" |
483 |
+ fi |
484 |
+} |
485 |
+ |
486 |
+pkg_postrm() { |
487 |
+ if [[ -z ${ROOT} && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then |
488 |
+ eselect compiler-shadow clean all |
489 |
+ fi |
490 |
+} |