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