1 |
commit: c72485db9bdcbc6f9a5f9be892af752633a0e900 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Mar 20 13:09:03 2023 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Mar 20 13:10:51 2023 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c72485db |
7 |
|
8 |
sys-devel/clang: Remove old |
9 |
|
10 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
11 |
|
12 |
sys-devel/clang/Manifest | 5 - |
13 |
sys-devel/clang/clang-16.0.0_rc3.ebuild | 477 ----------------------- |
14 |
sys-devel/clang/clang-16.0.0_rc4.ebuild | 481 ------------------------ |
15 |
sys-devel/clang/clang-17.0.0_pre20230304.ebuild | 481 ------------------------ |
16 |
4 files changed, 1444 deletions(-) |
17 |
|
18 |
diff --git a/sys-devel/clang/Manifest b/sys-devel/clang/Manifest |
19 |
index f364115a69b2..1a180b504684 100644 |
20 |
--- a/sys-devel/clang/Manifest |
21 |
+++ b/sys-devel/clang/Manifest |
22 |
@@ -9,9 +9,4 @@ DIST llvm-project-15.0.7.src.tar.xz 110936452 BLAKE2B f3d277e2029157329e5be78b78 |
23 |
DIST llvm-project-15.0.7.src.tar.xz.sig 566 BLAKE2B 47dc8c82d86237b80c6d85f83a6c9a6e9e174cf8e7f367b071e0cd9481d7cd408e991337c5624e07f3f370f26387c814f212808575ed1c1b58404d3e3836b7df SHA512 fc6891b440dd1175eb8df3790590af8d36bc92301660f84744ae15123475aeb900a151e6a8e7998ded27ec4d86871903ad0b89cd61164943054c2e3bc8d8beb2 |
24 |
DIST llvm-project-16.0.0.src.tar.xz 117933476 BLAKE2B fa09cd8f647ce0daf5a7eae9ac03b99594a9b3193b12065f43f9a6731875243f2f5b354136bcadcb31622b246054e94f880eec3dab0bcd6ae89973fa9dca845c SHA512 3f040abc1b03205693824aeff2ee6efb0cff25fe04bd5265141c093f294655a1f3fcda73cab9c57cbed7523c8f186a7e2484afce0792c55e90e3fb80450fabb7 |
25 |
DIST llvm-project-16.0.0.src.tar.xz.sig 566 BLAKE2B daba130aa5662fbf7cc2e7aa8fa6b64f9cb355a72330f7a01a21b86389c6f2f85ae93de19ff08ba3f1cfe2834d9a2b7648bdf659caba3afdb2a0d13984774a54 SHA512 38e2449dce20cfbf813d1a9a68b36807722ac8ebb5ee07360fa215b2de8534d2329d3e41cfc3ed33e59e36714b94a6683a6d8077950bcf0037973492e0820fb3 |
26 |
-DIST llvm-project-16.0.0rc3.src.tar.xz 117914548 BLAKE2B 18ffa35eb73c7cc4626d7b6b7b30aade7171ee2e17fb8d72e79a67185e809f611fefa4cfef17e5cd16822a5a70de2222534dc9f146fc53987eb49ff6a9d98c18 SHA512 d14e5e5ec984a0dc0292a2d27440398b3e32f120c1579517054dcb1a05dbc4ac5f1c6d078a3d6ef8597a71af6f22863868680a972a571839dcd573418b4a4697 |
27 |
-DIST llvm-project-16.0.0rc3.src.tar.xz.sig 566 BLAKE2B 43683d2d7b266a847516f71412bf6236a355462430330fc0da1d624fb8dfbc98bfc982d367baee74d5b4964a9e82e7a4a6ea84bdcff3996d246932f516cced1a SHA512 61adc4dc3eb5a4c11a7f96f9267ff37895e5845a08d48a609a03a2696c1b6bca5af5861a6f28de936c48e6d621bf282170589187f2cb593a912b9078300cf47c |
28 |
-DIST llvm-project-16.0.0rc4.src.tar.xz 117930024 BLAKE2B 55cf032ad3ba52d2af0942fe1c627319ae95b466122d04b24a917c33e29139fae546d92c375715600190c02426b798803ead0ab7a97d86960cf98fca80e8815c SHA512 8d628205c5b93fe6683b67b97b5c7f98bae945bd87cccebcdac00ddd4362108bd171f077a5196242be0fb909c795592b34bfa1c96c50a744fb68f287fd9781cc |
29 |
-DIST llvm-project-16.0.0rc4.src.tar.xz.sig 566 BLAKE2B bfcf39070f32e16cfeae699d95d06f184b1331c3af403340c31cc5a973a3bb1faec0b6342445176cebed5819ddf68e4abfdaa8542ec425b1c822fc8c03c03349 SHA512 2af72e3d771e2361873007a944dcccfe81fbdbc3025a2101e03cbc15f1a173d39ceb94c4ae8966b1d7564bf004ee9a5ffa032e2334c0cf7154aea1090d04b00f |
30 |
-DIST llvm-project-2708869801ae00f4681f6b2d9d69b25b3fce26b6.tar.gz 180523586 BLAKE2B cf918d1e23f922d201a44531c9765b7d8ec2b3b8499ea7954845abcd5fa2687e85b3a34819a583c4f4a6d6e1baa49dbac0b4450cd6b9b322b0f13c88cd7da93c SHA512 18cb00e93d819993a925ae0467d382bc952d82c1eb92dbbb5bb3cdf87043269948670713734ddc3ea4ec50544e54dd11b6747496f7eaa02479374ab9ad075aa5 |
31 |
DIST llvm-project-4bf004e07e2b9d6e04e3f33e1b02628c679de664.tar.gz 180304467 BLAKE2B 6750855453b575eb8fcc861d5b24b144497bba62df9b9292ac586cf340e04b2b58290fe9df6d89142f29b56aa37ddeb3bd11cc3337e4dc985a4487954d1e2ffa SHA512 d8a87064ba0f92967df019e9345222b87cda81852a9599902cedc4a49ec7d9e2175c972b7fa6d19920489c1d309822f9c31c23bdce0376a8d40c71d57bcd5068 |
32 |
|
33 |
diff --git a/sys-devel/clang/clang-16.0.0_rc3.ebuild b/sys-devel/clang/clang-16.0.0_rc3.ebuild |
34 |
deleted file mode 100644 |
35 |
index 9c7caefc9f46..000000000000 |
36 |
--- a/sys-devel/clang/clang-16.0.0_rc3.ebuild |
37 |
+++ /dev/null |
38 |
@@ -1,477 +0,0 @@ |
39 |
-# Copyright 1999-2023 Gentoo Authors |
40 |
-# Distributed under the terms of the GNU General Public License v2 |
41 |
- |
42 |
-EAPI=8 |
43 |
- |
44 |
-PYTHON_COMPAT=( python3_{9..11} ) |
45 |
-inherit cmake llvm llvm.org multilib multilib-minimal \ |
46 |
- prefix python-single-r1 toolchain-funcs flag-o-matic |
47 |
- |
48 |
-DESCRIPTION="C language family frontend for LLVM" |
49 |
-HOMEPAGE="https://llvm.org/" |
50 |
- |
51 |
-# MSVCSetupApi.h: MIT |
52 |
-# sorttable.js: MIT |
53 |
- |
54 |
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA MIT" |
55 |
-SLOT="${LLVM_MAJOR}/${LLVM_SOABI}" |
56 |
-KEYWORDS="~loong" |
57 |
-IUSE="debug doc +extra ieee-long-double +pie +static-analyzer test xml" |
58 |
-REQUIRED_USE="${PYTHON_REQUIRED_USE}" |
59 |
-RESTRICT="!test? ( test )" |
60 |
- |
61 |
-DEPEND=" |
62 |
- ~sys-devel/llvm-${PV}:${LLVM_MAJOR}=[debug=,${MULTILIB_USEDEP}] |
63 |
- static-analyzer? ( dev-lang/perl:* ) |
64 |
- xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] ) |
65 |
-" |
66 |
- |
67 |
-RDEPEND=" |
68 |
- ${PYTHON_DEPS} |
69 |
- ${DEPEND} |
70 |
- >=sys-devel/clang-common-${PV} |
71 |
-" |
72 |
-BDEPEND=" |
73 |
- ${PYTHON_DEPS} |
74 |
- >=dev-util/cmake-3.16 |
75 |
- doc? ( $(python_gen_cond_dep ' |
76 |
- dev-python/recommonmark[${PYTHON_USEDEP}] |
77 |
- dev-python/sphinx[${PYTHON_USEDEP}] |
78 |
- ') ) |
79 |
- xml? ( virtual/pkgconfig ) |
80 |
-" |
81 |
-PDEPEND=" |
82 |
- ~sys-devel/clang-runtime-${PV} |
83 |
- sys-devel/clang-toolchain-symlinks:${LLVM_MAJOR} |
84 |
-" |
85 |
- |
86 |
-LLVM_COMPONENTS=( |
87 |
- clang clang-tools-extra cmake |
88 |
- llvm/lib/Transforms/Hello |
89 |
-) |
90 |
-LLVM_MANPAGES=1 |
91 |
-LLVM_TEST_COMPONENTS=( |
92 |
- llvm/lib/Testing |
93 |
- llvm/utils |
94 |
- third-party |
95 |
-) |
96 |
-LLVM_USE_TARGETS=llvm |
97 |
-llvm.org_set_globals |
98 |
- |
99 |
-# Multilib notes: |
100 |
-# 1. ABI_* flags control ABIs libclang* is built for only. |
101 |
-# 2. clang is always capable of compiling code for all ABIs for enabled |
102 |
-# target. However, you will need appropriate crt* files (installed |
103 |
-# e.g. by sys-devel/gcc and sys-libs/glibc). |
104 |
-# 3. ${CHOST}-clang wrappers are always installed for all ABIs included |
105 |
-# in the current profile (i.e. alike supported by sys-devel/gcc). |
106 |
-# |
107 |
-# Therefore: use sys-devel/clang[${MULTILIB_USEDEP}] only if you need |
108 |
-# multilib clang* libraries (not runtime, not wrappers). |
109 |
- |
110 |
-pkg_setup() { |
111 |
- LLVM_MAX_SLOT=${LLVM_MAJOR} llvm_pkg_setup |
112 |
- python-single-r1_pkg_setup |
113 |
-} |
114 |
- |
115 |
-src_prepare() { |
116 |
- # create extra parent dir for relative CLANG_RESOURCE_DIR access |
117 |
- mkdir -p x/y || die |
118 |
- BUILD_DIR=${WORKDIR}/x/y/clang |
119 |
- |
120 |
- llvm.org_src_prepare |
121 |
- |
122 |
- # add Gentoo Portage Prefix for Darwin (see prefix-dirs.patch) |
123 |
- eprefixify \ |
124 |
- lib/Lex/InitHeaderSearch.cpp \ |
125 |
- lib/Driver/ToolChains/Darwin.cpp || die |
126 |
- |
127 |
- if ! use prefix-guest && [[ -n ${EPREFIX} ]]; then |
128 |
- sed -i "/LibDir.*Loader/s@return \"\/\"@return \"${EPREFIX}/\"@" lib/Driver/ToolChains/Linux.cpp || die |
129 |
- fi |
130 |
-} |
131 |
- |
132 |
-check_distribution_components() { |
133 |
- if [[ ${CMAKE_MAKEFILE_GENERATOR} == ninja ]]; then |
134 |
- local all_targets=() my_targets=() l |
135 |
- cd "${BUILD_DIR}" || die |
136 |
- |
137 |
- while read -r l; do |
138 |
- if [[ ${l} == install-*-stripped:* ]]; then |
139 |
- l=${l#install-} |
140 |
- l=${l%%-stripped*} |
141 |
- |
142 |
- case ${l} in |
143 |
- # meta-targets |
144 |
- clang-libraries|distribution) |
145 |
- continue |
146 |
- ;; |
147 |
- # tools |
148 |
- clang|clangd|clang-*) |
149 |
- ;; |
150 |
- # static libraries |
151 |
- clang*|findAllSymbols) |
152 |
- continue |
153 |
- ;; |
154 |
- # conditional to USE=doc |
155 |
- docs-clang-html|docs-clang-tools-html) |
156 |
- use doc || continue |
157 |
- ;; |
158 |
- esac |
159 |
- |
160 |
- all_targets+=( "${l}" ) |
161 |
- fi |
162 |
- done < <(${NINJA} -t targets all) |
163 |
- |
164 |
- while read -r l; do |
165 |
- my_targets+=( "${l}" ) |
166 |
- done < <(get_distribution_components $"\n") |
167 |
- |
168 |
- local add=() remove=() |
169 |
- for l in "${all_targets[@]}"; do |
170 |
- if ! has "${l}" "${my_targets[@]}"; then |
171 |
- add+=( "${l}" ) |
172 |
- fi |
173 |
- done |
174 |
- for l in "${my_targets[@]}"; do |
175 |
- if ! has "${l}" "${all_targets[@]}"; then |
176 |
- remove+=( "${l}" ) |
177 |
- fi |
178 |
- done |
179 |
- |
180 |
- if [[ ${#add[@]} -gt 0 || ${#remove[@]} -gt 0 ]]; then |
181 |
- eqawarn "get_distribution_components() is outdated!" |
182 |
- eqawarn " Add: ${add[*]}" |
183 |
- eqawarn "Remove: ${remove[*]}" |
184 |
- fi |
185 |
- cd - >/dev/null || die |
186 |
- fi |
187 |
-} |
188 |
- |
189 |
-get_distribution_components() { |
190 |
- local sep=${1-;} |
191 |
- |
192 |
- local out=( |
193 |
- # common stuff |
194 |
- clang-cmake-exports |
195 |
- clang-headers |
196 |
- clang-resource-headers |
197 |
- libclang-headers |
198 |
- |
199 |
- aarch64-resource-headers |
200 |
- arm-common-resource-headers |
201 |
- arm-resource-headers |
202 |
- core-resource-headers |
203 |
- cuda-resource-headers |
204 |
- hexagon-resource-headers |
205 |
- hip-resource-headers |
206 |
- hlsl-resource-headers |
207 |
- mips-resource-headers |
208 |
- opencl-resource-headers |
209 |
- openmp-resource-headers |
210 |
- ppc-htm-resource-headers |
211 |
- ppc-resource-headers |
212 |
- riscv-resource-headers |
213 |
- systemz-resource-headers |
214 |
- utility-resource-headers |
215 |
- ve-resource-headers |
216 |
- webassembly-resource-headers |
217 |
- windows-resource-headers |
218 |
- x86-resource-headers |
219 |
- |
220 |
- # libs |
221 |
- clang-cpp |
222 |
- libclang |
223 |
- ) |
224 |
- |
225 |
- if multilib_is_native_abi; then |
226 |
- out+=( |
227 |
- # common stuff |
228 |
- bash-autocomplete |
229 |
- libclang-python-bindings |
230 |
- |
231 |
- # tools |
232 |
- amdgpu-arch |
233 |
- c-index-test |
234 |
- clang |
235 |
- clang-format |
236 |
- clang-offload-bundler |
237 |
- clang-offload-packager |
238 |
- clang-refactor |
239 |
- clang-repl |
240 |
- clang-rename |
241 |
- clang-scan-deps |
242 |
- diagtool |
243 |
- hmaptool |
244 |
- nvptx-arch |
245 |
- |
246 |
- # needed for cross-compiling Clang |
247 |
- clang-tblgen |
248 |
- ) |
249 |
- |
250 |
- if use extra; then |
251 |
- out+=( |
252 |
- # extra tools |
253 |
- clang-apply-replacements |
254 |
- clang-change-namespace |
255 |
- clang-doc |
256 |
- clang-include-cleaner |
257 |
- clang-include-fixer |
258 |
- clang-move |
259 |
- clang-pseudo |
260 |
- clang-query |
261 |
- clang-reorder-fields |
262 |
- clang-tidy |
263 |
- clang-tidy-headers |
264 |
- clangd |
265 |
- find-all-symbols |
266 |
- modularize |
267 |
- pp-trace |
268 |
- ) |
269 |
- fi |
270 |
- |
271 |
- if llvm_are_manpages_built; then |
272 |
- out+=( docs-clang-man ) |
273 |
- use extra && out+=( docs-clang-tools-man ) |
274 |
- fi |
275 |
- |
276 |
- if use doc; then |
277 |
- out+=( docs-clang-html ) |
278 |
- use extra && out+=( docs-clang-tools-html ) |
279 |
- fi |
280 |
- |
281 |
- use static-analyzer && out+=( |
282 |
- clang-check |
283 |
- clang-extdef-mapping |
284 |
- scan-build |
285 |
- scan-build-py |
286 |
- scan-view |
287 |
- ) |
288 |
- fi |
289 |
- |
290 |
- printf "%s${sep}" "${out[@]}" |
291 |
-} |
292 |
- |
293 |
-multilib_src_configure() { |
294 |
- tc-is-gcc && filter-lto # GCC miscompiles LLVM, bug #873670 |
295 |
- |
296 |
- local mycmakeargs=( |
297 |
- -DDEFAULT_SYSROOT=$(usex prefix-guest "" "${EPREFIX}") |
298 |
- -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}" |
299 |
- -DCMAKE_INSTALL_MANDIR="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/share/man" |
300 |
- -DCLANG_CONFIG_FILE_SYSTEM_DIR="${EPREFIX}/etc/clang" |
301 |
- # relative to bindir |
302 |
- -DCLANG_RESOURCE_DIR="../../../../lib/clang/${LLVM_MAJOR}" |
303 |
- |
304 |
- -DBUILD_SHARED_LIBS=OFF |
305 |
- -DCLANG_LINK_CLANG_DYLIB=ON |
306 |
- -DLLVM_DISTRIBUTION_COMPONENTS=$(get_distribution_components) |
307 |
- -DCLANG_INCLUDE_TESTS=$(usex test) |
308 |
- |
309 |
- -DLLVM_TARGETS_TO_BUILD="${LLVM_TARGETS// /;}" |
310 |
- |
311 |
- -DCMAKE_DISABLE_FIND_PACKAGE_LibXml2=$(usex !xml) |
312 |
- # libgomp support fails to find headers without explicit -I |
313 |
- # furthermore, it provides only syntax checking |
314 |
- -DCLANG_DEFAULT_OPENMP_RUNTIME=libomp |
315 |
- |
316 |
- # disable using CUDA to autodetect GPU, just build for all |
317 |
- -DCMAKE_DISABLE_FIND_PACKAGE_CUDA=ON |
318 |
- # disable linking to HSA to avoid automagic dep, |
319 |
- # load it dynamically instead |
320 |
- -DCMAKE_DISABLE_FIND_PACKAGE_hsa-runtime64=ON |
321 |
- |
322 |
- -DCLANG_DEFAULT_PIE_ON_LINUX=$(usex pie) |
323 |
- |
324 |
- -DCLANG_ENABLE_ARCMT=$(usex static-analyzer) |
325 |
- -DCLANG_ENABLE_STATIC_ANALYZER=$(usex static-analyzer) |
326 |
- |
327 |
- -DPython3_EXECUTABLE="${PYTHON}" |
328 |
- ) |
329 |
- |
330 |
- if ! use elibc_musl; then |
331 |
- mycmakeargs+=( |
332 |
- -DPPC_LINUX_DEFAULT_IEEELONGDOUBLE=$(usex ieee-long-double) |
333 |
- ) |
334 |
- fi |
335 |
- |
336 |
- use test && mycmakeargs+=( |
337 |
- -DLLVM_BUILD_TESTS=ON |
338 |
- -DLLVM_LIT_ARGS="$(get_lit_flags)" |
339 |
- ) |
340 |
- |
341 |
- if multilib_is_native_abi; then |
342 |
- local build_docs=OFF |
343 |
- if llvm_are_manpages_built; then |
344 |
- build_docs=ON |
345 |
- mycmakeargs+=( |
346 |
- -DLLVM_BUILD_DOCS=ON |
347 |
- -DLLVM_ENABLE_SPHINX=ON |
348 |
- -DCLANG_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/html" |
349 |
- -DSPHINX_WARNINGS_AS_ERRORS=OFF |
350 |
- ) |
351 |
- if use extra; then |
352 |
- mycmakeargs+=( |
353 |
- -DCLANG-TOOLS_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/tools-extra" |
354 |
- ) |
355 |
- fi |
356 |
- fi |
357 |
- mycmakeargs+=( |
358 |
- -DCLANG_INCLUDE_DOCS=${build_docs} |
359 |
- ) |
360 |
- fi |
361 |
- if multilib_native_use extra; then |
362 |
- mycmakeargs+=( |
363 |
- -DLLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR="${WORKDIR}"/clang-tools-extra |
364 |
- -DCLANG_TOOLS_EXTRA_INCLUDE_DOCS=${build_docs} |
365 |
- ) |
366 |
- else |
367 |
- mycmakeargs+=( |
368 |
- -DLLVM_TOOL_CLANG_TOOLS_EXTRA_BUILD=OFF |
369 |
- ) |
370 |
- fi |
371 |
- |
372 |
- if [[ -n ${EPREFIX} ]]; then |
373 |
- mycmakeargs+=( |
374 |
- -DGCC_INSTALL_PREFIX="${EPREFIX}/usr" |
375 |
- ) |
376 |
- fi |
377 |
- |
378 |
- if tc-is-cross-compiler; then |
379 |
- has_version -b sys-devel/clang:${LLVM_MAJOR} || |
380 |
- die "sys-devel/clang:${LLVM_MAJOR} is required on the build host." |
381 |
- local tools_bin=${BROOT}/usr/lib/llvm/${LLVM_MAJOR}/bin |
382 |
- mycmakeargs+=( |
383 |
- -DLLVM_TOOLS_BINARY_DIR="${tools_bin}" |
384 |
- -DCLANG_TABLEGEN="${tools_bin}"/clang-tblgen |
385 |
- ) |
386 |
- fi |
387 |
- |
388 |
- # LLVM can have very high memory consumption while linking, |
389 |
- # exhausting the limit on 32-bit linker executable |
390 |
- use x86 && local -x LDFLAGS="${LDFLAGS} -Wl,--no-keep-memory" |
391 |
- |
392 |
- # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844 |
393 |
- use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG" |
394 |
- cmake_src_configure |
395 |
- |
396 |
- multilib_is_native_abi && check_distribution_components |
397 |
-} |
398 |
- |
399 |
-multilib_src_compile() { |
400 |
- cmake_build distribution |
401 |
- |
402 |
- # provide a symlink for tests |
403 |
- if [[ ! -L ${WORKDIR}/lib/clang ]]; then |
404 |
- mkdir -p "${WORKDIR}"/lib || die |
405 |
- ln -s "${BUILD_DIR}/$(get_libdir)/clang" "${WORKDIR}"/lib/clang || die |
406 |
- fi |
407 |
-} |
408 |
- |
409 |
-multilib_src_test() { |
410 |
- # respect TMPDIR! |
411 |
- local -x LIT_PRESERVES_TMP=1 |
412 |
- local test_targets=( check-clang ) |
413 |
- if multilib_native_use extra; then |
414 |
- test_targets+=( |
415 |
- check-clang-tools |
416 |
- check-clangd |
417 |
- ) |
418 |
- fi |
419 |
- cmake_build "${test_targets[@]}" |
420 |
-} |
421 |
- |
422 |
-src_install() { |
423 |
- MULTILIB_WRAPPED_HEADERS=( |
424 |
- /usr/include/clang/Config/config.h |
425 |
- ) |
426 |
- |
427 |
- multilib-minimal_src_install |
428 |
- |
429 |
- # Move runtime headers to /usr/lib/clang, where they belong |
430 |
- mv "${ED}"/usr/include/clangrt "${ED}"/usr/lib/clang || die |
431 |
- # move (remaining) wrapped headers back |
432 |
- if use extra; then |
433 |
- mv "${T}"/clang-tidy "${ED}"/usr/include/ || die |
434 |
- fi |
435 |
- mv "${ED}"/usr/include "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/include || die |
436 |
- |
437 |
- # Apply CHOST and version suffix to clang tools |
438 |
- local clang_tools=( clang clang++ clang-cl clang-cpp ) |
439 |
- local abi i |
440 |
- |
441 |
- # cmake gives us: |
442 |
- # - clang-X |
443 |
- # - clang -> clang-X |
444 |
- # - clang++, clang-cl, clang-cpp -> clang |
445 |
- # we want to have: |
446 |
- # - clang-X |
447 |
- # - clang++-X, clang-cl-X, clang-cpp-X -> clang-X |
448 |
- # - clang, clang++, clang-cl, clang-cpp -> clang*-X |
449 |
- # also in CHOST variant |
450 |
- for i in "${clang_tools[@]:1}"; do |
451 |
- rm "${ED}/usr/lib/llvm/${LLVM_MAJOR}/bin/${i}" || die |
452 |
- dosym "clang-${LLVM_MAJOR}" "/usr/lib/llvm/${LLVM_MAJOR}/bin/${i}-${LLVM_MAJOR}" |
453 |
- dosym "${i}-${LLVM_MAJOR}" "/usr/lib/llvm/${LLVM_MAJOR}/bin/${i}" |
454 |
- done |
455 |
- |
456 |
- # now create target symlinks for all supported ABIs |
457 |
- for abi in $(get_all_abis); do |
458 |
- local abi_chost=$(get_abi_CHOST "${abi}") |
459 |
- for i in "${clang_tools[@]}"; do |
460 |
- dosym "${i}-${LLVM_MAJOR}" \ |
461 |
- "/usr/lib/llvm/${LLVM_MAJOR}/bin/${abi_chost}-${i}-${LLVM_MAJOR}" |
462 |
- dosym "${abi_chost}-${i}-${LLVM_MAJOR}" \ |
463 |
- "/usr/lib/llvm/${LLVM_MAJOR}/bin/${abi_chost}-${i}" |
464 |
- done |
465 |
- done |
466 |
-} |
467 |
- |
468 |
-multilib_src_install() { |
469 |
- DESTDIR=${D} cmake_build install-distribution |
470 |
- |
471 |
- # move headers to /usr/include for wrapping & ABI mismatch checks |
472 |
- # (also drop the version suffix from runtime headers) |
473 |
- rm -rf "${ED}"/usr/include || die |
474 |
- mv "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/include "${ED}"/usr/include || die |
475 |
- mv "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/$(get_libdir)/clang "${ED}"/usr/include/clangrt || die |
476 |
- if multilib_native_use extra; then |
477 |
- # don't wrap clang-tidy headers, the list is too long |
478 |
- # (they're fine for non-native ABI but enabling the targets is problematic) |
479 |
- mv "${ED}"/usr/include/clang-tidy "${T}/" || die |
480 |
- fi |
481 |
-} |
482 |
- |
483 |
-multilib_src_install_all() { |
484 |
- python_fix_shebang "${ED}" |
485 |
- if use static-analyzer; then |
486 |
- python_optimize "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/share/scan-view |
487 |
- fi |
488 |
- |
489 |
- docompress "/usr/lib/llvm/${LLVM_MAJOR}/share/man" |
490 |
- llvm_install_manpages |
491 |
- # match 'html' non-compression |
492 |
- use doc && docompress -x "/usr/share/doc/${PF}/tools-extra" |
493 |
- # +x for some reason; TODO: investigate |
494 |
- use static-analyzer && fperms a-x "/usr/lib/llvm/${LLVM_MAJOR}/share/man/man1/scan-build.1" |
495 |
-} |
496 |
- |
497 |
-pkg_postinst() { |
498 |
- if [[ -z ${ROOT} && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then |
499 |
- eselect compiler-shadow update all |
500 |
- fi |
501 |
- |
502 |
- elog "You can find additional utility scripts in:" |
503 |
- elog " ${EROOT}/usr/lib/llvm/${LLVM_MAJOR}/share/clang" |
504 |
- if use extra; then |
505 |
- elog "Some of them are vim integration scripts (with instructions inside)." |
506 |
- elog "The run-clang-tidy.py script requires the following additional package:" |
507 |
- elog " dev-python/pyyaml" |
508 |
- fi |
509 |
-} |
510 |
- |
511 |
-pkg_postrm() { |
512 |
- if [[ -z ${ROOT} && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then |
513 |
- eselect compiler-shadow clean all |
514 |
- fi |
515 |
-} |
516 |
|
517 |
diff --git a/sys-devel/clang/clang-16.0.0_rc4.ebuild b/sys-devel/clang/clang-16.0.0_rc4.ebuild |
518 |
deleted file mode 100644 |
519 |
index 93bdd2ab61a8..000000000000 |
520 |
--- a/sys-devel/clang/clang-16.0.0_rc4.ebuild |
521 |
+++ /dev/null |
522 |
@@ -1,481 +0,0 @@ |
523 |
-# Copyright 1999-2023 Gentoo Authors |
524 |
-# Distributed under the terms of the GNU General Public License v2 |
525 |
- |
526 |
-EAPI=8 |
527 |
- |
528 |
-PYTHON_COMPAT=( python3_{9..11} ) |
529 |
-inherit cmake llvm llvm.org multilib multilib-minimal \ |
530 |
- prefix python-single-r1 toolchain-funcs flag-o-matic |
531 |
- |
532 |
-DESCRIPTION="C language family frontend for LLVM" |
533 |
-HOMEPAGE="https://llvm.org/" |
534 |
- |
535 |
-# MSVCSetupApi.h: MIT |
536 |
-# sorttable.js: MIT |
537 |
- |
538 |
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA MIT" |
539 |
-SLOT="${LLVM_MAJOR}/${LLVM_SOABI}" |
540 |
-KEYWORDS="~loong" |
541 |
-IUSE="debug doc +extra ieee-long-double +pie +static-analyzer test xml" |
542 |
-REQUIRED_USE="${PYTHON_REQUIRED_USE}" |
543 |
-RESTRICT="!test? ( test )" |
544 |
- |
545 |
-DEPEND=" |
546 |
- ~sys-devel/llvm-${PV}:${LLVM_MAJOR}=[debug=,${MULTILIB_USEDEP}] |
547 |
- static-analyzer? ( dev-lang/perl:* ) |
548 |
- xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] ) |
549 |
-" |
550 |
- |
551 |
-RDEPEND=" |
552 |
- ${PYTHON_DEPS} |
553 |
- ${DEPEND} |
554 |
- >=sys-devel/clang-common-${PV} |
555 |
-" |
556 |
-BDEPEND=" |
557 |
- ${PYTHON_DEPS} |
558 |
- >=dev-util/cmake-3.16 |
559 |
- doc? ( $(python_gen_cond_dep ' |
560 |
- dev-python/recommonmark[${PYTHON_USEDEP}] |
561 |
- dev-python/sphinx[${PYTHON_USEDEP}] |
562 |
- ') ) |
563 |
- xml? ( virtual/pkgconfig ) |
564 |
-" |
565 |
-PDEPEND=" |
566 |
- ~sys-devel/clang-runtime-${PV} |
567 |
- sys-devel/clang-toolchain-symlinks:${LLVM_MAJOR} |
568 |
-" |
569 |
- |
570 |
-LLVM_COMPONENTS=( |
571 |
- clang clang-tools-extra cmake |
572 |
- llvm/lib/Transforms/Hello |
573 |
-) |
574 |
-LLVM_MANPAGES=1 |
575 |
-LLVM_TEST_COMPONENTS=( |
576 |
- llvm/lib/Testing |
577 |
- llvm/utils |
578 |
- third-party |
579 |
-) |
580 |
-LLVM_USE_TARGETS=llvm |
581 |
-llvm.org_set_globals |
582 |
- |
583 |
-# Multilib notes: |
584 |
-# 1. ABI_* flags control ABIs libclang* is built for only. |
585 |
-# 2. clang is always capable of compiling code for all ABIs for enabled |
586 |
-# target. However, you will need appropriate crt* files (installed |
587 |
-# e.g. by sys-devel/gcc and sys-libs/glibc). |
588 |
-# 3. ${CHOST}-clang wrappers are always installed for all ABIs included |
589 |
-# in the current profile (i.e. alike supported by sys-devel/gcc). |
590 |
-# |
591 |
-# Therefore: use sys-devel/clang[${MULTILIB_USEDEP}] only if you need |
592 |
-# multilib clang* libraries (not runtime, not wrappers). |
593 |
- |
594 |
-pkg_setup() { |
595 |
- LLVM_MAX_SLOT=${LLVM_MAJOR} llvm_pkg_setup |
596 |
- python-single-r1_pkg_setup |
597 |
-} |
598 |
- |
599 |
-src_prepare() { |
600 |
- # create extra parent dir for relative CLANG_RESOURCE_DIR access |
601 |
- mkdir -p x/y || die |
602 |
- BUILD_DIR=${WORKDIR}/x/y/clang |
603 |
- |
604 |
- llvm.org_src_prepare |
605 |
- |
606 |
- # add Gentoo Portage Prefix for Darwin (see prefix-dirs.patch) |
607 |
- eprefixify \ |
608 |
- lib/Lex/InitHeaderSearch.cpp \ |
609 |
- lib/Driver/ToolChains/Darwin.cpp || die |
610 |
- |
611 |
- if ! use prefix-guest && [[ -n ${EPREFIX} ]]; then |
612 |
- sed -i "/LibDir.*Loader/s@return \"\/\"@return \"${EPREFIX}/\"@" lib/Driver/ToolChains/Linux.cpp || die |
613 |
- fi |
614 |
-} |
615 |
- |
616 |
-check_distribution_components() { |
617 |
- if [[ ${CMAKE_MAKEFILE_GENERATOR} == ninja ]]; then |
618 |
- local all_targets=() my_targets=() l |
619 |
- cd "${BUILD_DIR}" || die |
620 |
- |
621 |
- while read -r l; do |
622 |
- if [[ ${l} == install-*-stripped:* ]]; then |
623 |
- l=${l#install-} |
624 |
- l=${l%%-stripped*} |
625 |
- |
626 |
- case ${l} in |
627 |
- # meta-targets |
628 |
- clang-libraries|distribution) |
629 |
- continue |
630 |
- ;; |
631 |
- # tools |
632 |
- clang|clangd|clang-*) |
633 |
- ;; |
634 |
- # static libraries |
635 |
- clang*|findAllSymbols) |
636 |
- continue |
637 |
- ;; |
638 |
- # conditional to USE=doc |
639 |
- docs-clang-html|docs-clang-tools-html) |
640 |
- use doc || continue |
641 |
- ;; |
642 |
- esac |
643 |
- |
644 |
- all_targets+=( "${l}" ) |
645 |
- fi |
646 |
- done < <(${NINJA} -t targets all) |
647 |
- |
648 |
- while read -r l; do |
649 |
- my_targets+=( "${l}" ) |
650 |
- done < <(get_distribution_components $"\n") |
651 |
- |
652 |
- local add=() remove=() |
653 |
- for l in "${all_targets[@]}"; do |
654 |
- if ! has "${l}" "${my_targets[@]}"; then |
655 |
- add+=( "${l}" ) |
656 |
- fi |
657 |
- done |
658 |
- for l in "${my_targets[@]}"; do |
659 |
- if ! has "${l}" "${all_targets[@]}"; then |
660 |
- remove+=( "${l}" ) |
661 |
- fi |
662 |
- done |
663 |
- |
664 |
- if [[ ${#add[@]} -gt 0 || ${#remove[@]} -gt 0 ]]; then |
665 |
- eqawarn "get_distribution_components() is outdated!" |
666 |
- eqawarn " Add: ${add[*]}" |
667 |
- eqawarn "Remove: ${remove[*]}" |
668 |
- fi |
669 |
- cd - >/dev/null || die |
670 |
- fi |
671 |
-} |
672 |
- |
673 |
-get_distribution_components() { |
674 |
- local sep=${1-;} |
675 |
- |
676 |
- local out=( |
677 |
- # common stuff |
678 |
- clang-cmake-exports |
679 |
- clang-headers |
680 |
- clang-resource-headers |
681 |
- libclang-headers |
682 |
- |
683 |
- aarch64-resource-headers |
684 |
- arm-common-resource-headers |
685 |
- arm-resource-headers |
686 |
- core-resource-headers |
687 |
- cuda-resource-headers |
688 |
- hexagon-resource-headers |
689 |
- hip-resource-headers |
690 |
- hlsl-resource-headers |
691 |
- mips-resource-headers |
692 |
- opencl-resource-headers |
693 |
- openmp-resource-headers |
694 |
- ppc-htm-resource-headers |
695 |
- ppc-resource-headers |
696 |
- riscv-resource-headers |
697 |
- systemz-resource-headers |
698 |
- utility-resource-headers |
699 |
- ve-resource-headers |
700 |
- webassembly-resource-headers |
701 |
- windows-resource-headers |
702 |
- x86-resource-headers |
703 |
- |
704 |
- # libs |
705 |
- clang-cpp |
706 |
- libclang |
707 |
- ) |
708 |
- |
709 |
- if multilib_is_native_abi; then |
710 |
- out+=( |
711 |
- # common stuff |
712 |
- bash-autocomplete |
713 |
- libclang-python-bindings |
714 |
- |
715 |
- # tools |
716 |
- amdgpu-arch |
717 |
- c-index-test |
718 |
- clang |
719 |
- clang-format |
720 |
- clang-offload-bundler |
721 |
- clang-offload-packager |
722 |
- clang-refactor |
723 |
- clang-repl |
724 |
- clang-rename |
725 |
- clang-scan-deps |
726 |
- diagtool |
727 |
- hmaptool |
728 |
- nvptx-arch |
729 |
- |
730 |
- # needed for cross-compiling Clang |
731 |
- clang-tblgen |
732 |
- ) |
733 |
- |
734 |
- if use extra; then |
735 |
- out+=( |
736 |
- # extra tools |
737 |
- clang-apply-replacements |
738 |
- clang-change-namespace |
739 |
- clang-doc |
740 |
- clang-include-cleaner |
741 |
- clang-include-fixer |
742 |
- clang-move |
743 |
- clang-pseudo |
744 |
- clang-query |
745 |
- clang-reorder-fields |
746 |
- clang-tidy |
747 |
- clang-tidy-headers |
748 |
- clangd |
749 |
- find-all-symbols |
750 |
- modularize |
751 |
- pp-trace |
752 |
- ) |
753 |
- fi |
754 |
- |
755 |
- if llvm_are_manpages_built; then |
756 |
- out+=( docs-clang-man ) |
757 |
- use extra && out+=( docs-clang-tools-man ) |
758 |
- fi |
759 |
- |
760 |
- if use doc; then |
761 |
- out+=( docs-clang-html ) |
762 |
- use extra && out+=( docs-clang-tools-html ) |
763 |
- fi |
764 |
- |
765 |
- use static-analyzer && out+=( |
766 |
- clang-check |
767 |
- clang-extdef-mapping |
768 |
- scan-build |
769 |
- scan-build-py |
770 |
- scan-view |
771 |
- ) |
772 |
- fi |
773 |
- |
774 |
- printf "%s${sep}" "${out[@]}" |
775 |
-} |
776 |
- |
777 |
-multilib_src_configure() { |
778 |
- tc-is-gcc && filter-lto # GCC miscompiles LLVM, bug #873670 |
779 |
- |
780 |
- local mycmakeargs=( |
781 |
- -DDEFAULT_SYSROOT=$(usex prefix-guest "" "${EPREFIX}") |
782 |
- -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}" |
783 |
- -DCMAKE_INSTALL_MANDIR="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/share/man" |
784 |
- -DCLANG_CONFIG_FILE_SYSTEM_DIR="${EPREFIX}/etc/clang" |
785 |
- # relative to bindir |
786 |
- -DCLANG_RESOURCE_DIR="../../../../lib/clang/${LLVM_MAJOR}" |
787 |
- |
788 |
- -DBUILD_SHARED_LIBS=OFF |
789 |
- -DCLANG_LINK_CLANG_DYLIB=ON |
790 |
- -DLLVM_DISTRIBUTION_COMPONENTS=$(get_distribution_components) |
791 |
- -DCLANG_INCLUDE_TESTS=$(usex test) |
792 |
- |
793 |
- -DLLVM_TARGETS_TO_BUILD="${LLVM_TARGETS// /;}" |
794 |
- |
795 |
- # these are not propagated reliably, so redefine them |
796 |
- -DLLVM_ENABLE_EH=ON |
797 |
- -DLLVM_ENABLE_RTTI=ON |
798 |
- |
799 |
- -DCMAKE_DISABLE_FIND_PACKAGE_LibXml2=$(usex !xml) |
800 |
- # libgomp support fails to find headers without explicit -I |
801 |
- # furthermore, it provides only syntax checking |
802 |
- -DCLANG_DEFAULT_OPENMP_RUNTIME=libomp |
803 |
- |
804 |
- # disable using CUDA to autodetect GPU, just build for all |
805 |
- -DCMAKE_DISABLE_FIND_PACKAGE_CUDA=ON |
806 |
- # disable linking to HSA to avoid automagic dep, |
807 |
- # load it dynamically instead |
808 |
- -DCMAKE_DISABLE_FIND_PACKAGE_hsa-runtime64=ON |
809 |
- |
810 |
- -DCLANG_DEFAULT_PIE_ON_LINUX=$(usex pie) |
811 |
- |
812 |
- -DCLANG_ENABLE_ARCMT=$(usex static-analyzer) |
813 |
- -DCLANG_ENABLE_STATIC_ANALYZER=$(usex static-analyzer) |
814 |
- |
815 |
- -DPython3_EXECUTABLE="${PYTHON}" |
816 |
- ) |
817 |
- |
818 |
- if ! use elibc_musl; then |
819 |
- mycmakeargs+=( |
820 |
- -DPPC_LINUX_DEFAULT_IEEELONGDOUBLE=$(usex ieee-long-double) |
821 |
- ) |
822 |
- fi |
823 |
- |
824 |
- use test && mycmakeargs+=( |
825 |
- -DLLVM_BUILD_TESTS=ON |
826 |
- -DLLVM_LIT_ARGS="$(get_lit_flags)" |
827 |
- ) |
828 |
- |
829 |
- if multilib_is_native_abi; then |
830 |
- local build_docs=OFF |
831 |
- if llvm_are_manpages_built; then |
832 |
- build_docs=ON |
833 |
- mycmakeargs+=( |
834 |
- -DLLVM_BUILD_DOCS=ON |
835 |
- -DLLVM_ENABLE_SPHINX=ON |
836 |
- -DCLANG_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/html" |
837 |
- -DSPHINX_WARNINGS_AS_ERRORS=OFF |
838 |
- ) |
839 |
- if use extra; then |
840 |
- mycmakeargs+=( |
841 |
- -DCLANG-TOOLS_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/tools-extra" |
842 |
- ) |
843 |
- fi |
844 |
- fi |
845 |
- mycmakeargs+=( |
846 |
- -DCLANG_INCLUDE_DOCS=${build_docs} |
847 |
- ) |
848 |
- fi |
849 |
- if multilib_native_use extra; then |
850 |
- mycmakeargs+=( |
851 |
- -DLLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR="${WORKDIR}"/clang-tools-extra |
852 |
- -DCLANG_TOOLS_EXTRA_INCLUDE_DOCS=${build_docs} |
853 |
- ) |
854 |
- else |
855 |
- mycmakeargs+=( |
856 |
- -DLLVM_TOOL_CLANG_TOOLS_EXTRA_BUILD=OFF |
857 |
- ) |
858 |
- fi |
859 |
- |
860 |
- if [[ -n ${EPREFIX} ]]; then |
861 |
- mycmakeargs+=( |
862 |
- -DGCC_INSTALL_PREFIX="${EPREFIX}/usr" |
863 |
- ) |
864 |
- fi |
865 |
- |
866 |
- if tc-is-cross-compiler; then |
867 |
- has_version -b sys-devel/clang:${LLVM_MAJOR} || |
868 |
- die "sys-devel/clang:${LLVM_MAJOR} is required on the build host." |
869 |
- local tools_bin=${BROOT}/usr/lib/llvm/${LLVM_MAJOR}/bin |
870 |
- mycmakeargs+=( |
871 |
- -DLLVM_TOOLS_BINARY_DIR="${tools_bin}" |
872 |
- -DCLANG_TABLEGEN="${tools_bin}"/clang-tblgen |
873 |
- ) |
874 |
- fi |
875 |
- |
876 |
- # LLVM can have very high memory consumption while linking, |
877 |
- # exhausting the limit on 32-bit linker executable |
878 |
- use x86 && local -x LDFLAGS="${LDFLAGS} -Wl,--no-keep-memory" |
879 |
- |
880 |
- # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844 |
881 |
- use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG" |
882 |
- cmake_src_configure |
883 |
- |
884 |
- multilib_is_native_abi && check_distribution_components |
885 |
-} |
886 |
- |
887 |
-multilib_src_compile() { |
888 |
- cmake_build distribution |
889 |
- |
890 |
- # provide a symlink for tests |
891 |
- if [[ ! -L ${WORKDIR}/lib/clang ]]; then |
892 |
- mkdir -p "${WORKDIR}"/lib || die |
893 |
- ln -s "${BUILD_DIR}/$(get_libdir)/clang" "${WORKDIR}"/lib/clang || die |
894 |
- fi |
895 |
-} |
896 |
- |
897 |
-multilib_src_test() { |
898 |
- # respect TMPDIR! |
899 |
- local -x LIT_PRESERVES_TMP=1 |
900 |
- local test_targets=( check-clang ) |
901 |
- if multilib_native_use extra; then |
902 |
- test_targets+=( |
903 |
- check-clang-tools |
904 |
- check-clangd |
905 |
- ) |
906 |
- fi |
907 |
- cmake_build "${test_targets[@]}" |
908 |
-} |
909 |
- |
910 |
-src_install() { |
911 |
- MULTILIB_WRAPPED_HEADERS=( |
912 |
- /usr/include/clang/Config/config.h |
913 |
- ) |
914 |
- |
915 |
- multilib-minimal_src_install |
916 |
- |
917 |
- # Move runtime headers to /usr/lib/clang, where they belong |
918 |
- mv "${ED}"/usr/include/clangrt "${ED}"/usr/lib/clang || die |
919 |
- # move (remaining) wrapped headers back |
920 |
- if use extra; then |
921 |
- mv "${T}"/clang-tidy "${ED}"/usr/include/ || die |
922 |
- fi |
923 |
- mv "${ED}"/usr/include "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/include || die |
924 |
- |
925 |
- # Apply CHOST and version suffix to clang tools |
926 |
- local clang_tools=( clang clang++ clang-cl clang-cpp ) |
927 |
- local abi i |
928 |
- |
929 |
- # cmake gives us: |
930 |
- # - clang-X |
931 |
- # - clang -> clang-X |
932 |
- # - clang++, clang-cl, clang-cpp -> clang |
933 |
- # we want to have: |
934 |
- # - clang-X |
935 |
- # - clang++-X, clang-cl-X, clang-cpp-X -> clang-X |
936 |
- # - clang, clang++, clang-cl, clang-cpp -> clang*-X |
937 |
- # also in CHOST variant |
938 |
- for i in "${clang_tools[@]:1}"; do |
939 |
- rm "${ED}/usr/lib/llvm/${LLVM_MAJOR}/bin/${i}" || die |
940 |
- dosym "clang-${LLVM_MAJOR}" "/usr/lib/llvm/${LLVM_MAJOR}/bin/${i}-${LLVM_MAJOR}" |
941 |
- dosym "${i}-${LLVM_MAJOR}" "/usr/lib/llvm/${LLVM_MAJOR}/bin/${i}" |
942 |
- done |
943 |
- |
944 |
- # now create target symlinks for all supported ABIs |
945 |
- for abi in $(get_all_abis); do |
946 |
- local abi_chost=$(get_abi_CHOST "${abi}") |
947 |
- for i in "${clang_tools[@]}"; do |
948 |
- dosym "${i}-${LLVM_MAJOR}" \ |
949 |
- "/usr/lib/llvm/${LLVM_MAJOR}/bin/${abi_chost}-${i}-${LLVM_MAJOR}" |
950 |
- dosym "${abi_chost}-${i}-${LLVM_MAJOR}" \ |
951 |
- "/usr/lib/llvm/${LLVM_MAJOR}/bin/${abi_chost}-${i}" |
952 |
- done |
953 |
- done |
954 |
-} |
955 |
- |
956 |
-multilib_src_install() { |
957 |
- DESTDIR=${D} cmake_build install-distribution |
958 |
- |
959 |
- # move headers to /usr/include for wrapping & ABI mismatch checks |
960 |
- # (also drop the version suffix from runtime headers) |
961 |
- rm -rf "${ED}"/usr/include || die |
962 |
- mv "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/include "${ED}"/usr/include || die |
963 |
- mv "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/$(get_libdir)/clang "${ED}"/usr/include/clangrt || die |
964 |
- if multilib_native_use extra; then |
965 |
- # don't wrap clang-tidy headers, the list is too long |
966 |
- # (they're fine for non-native ABI but enabling the targets is problematic) |
967 |
- mv "${ED}"/usr/include/clang-tidy "${T}/" || die |
968 |
- fi |
969 |
-} |
970 |
- |
971 |
-multilib_src_install_all() { |
972 |
- python_fix_shebang "${ED}" |
973 |
- if use static-analyzer; then |
974 |
- python_optimize "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/share/scan-view |
975 |
- fi |
976 |
- |
977 |
- docompress "/usr/lib/llvm/${LLVM_MAJOR}/share/man" |
978 |
- llvm_install_manpages |
979 |
- # match 'html' non-compression |
980 |
- use doc && docompress -x "/usr/share/doc/${PF}/tools-extra" |
981 |
- # +x for some reason; TODO: investigate |
982 |
- use static-analyzer && fperms a-x "/usr/lib/llvm/${LLVM_MAJOR}/share/man/man1/scan-build.1" |
983 |
-} |
984 |
- |
985 |
-pkg_postinst() { |
986 |
- if [[ -z ${ROOT} && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then |
987 |
- eselect compiler-shadow update all |
988 |
- fi |
989 |
- |
990 |
- elog "You can find additional utility scripts in:" |
991 |
- elog " ${EROOT}/usr/lib/llvm/${LLVM_MAJOR}/share/clang" |
992 |
- if use extra; then |
993 |
- elog "Some of them are vim integration scripts (with instructions inside)." |
994 |
- elog "The run-clang-tidy.py script requires the following additional package:" |
995 |
- elog " dev-python/pyyaml" |
996 |
- fi |
997 |
-} |
998 |
- |
999 |
-pkg_postrm() { |
1000 |
- if [[ -z ${ROOT} && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then |
1001 |
- eselect compiler-shadow clean all |
1002 |
- fi |
1003 |
-} |
1004 |
|
1005 |
diff --git a/sys-devel/clang/clang-17.0.0_pre20230304.ebuild b/sys-devel/clang/clang-17.0.0_pre20230304.ebuild |
1006 |
deleted file mode 100644 |
1007 |
index 4c59778e088a..000000000000 |
1008 |
--- a/sys-devel/clang/clang-17.0.0_pre20230304.ebuild |
1009 |
+++ /dev/null |
1010 |
@@ -1,481 +0,0 @@ |
1011 |
-# Copyright 1999-2023 Gentoo Authors |
1012 |
-# Distributed under the terms of the GNU General Public License v2 |
1013 |
- |
1014 |
-EAPI=8 |
1015 |
- |
1016 |
-PYTHON_COMPAT=( python3_{9..11} ) |
1017 |
-inherit cmake llvm llvm.org multilib multilib-minimal \ |
1018 |
- prefix python-single-r1 toolchain-funcs flag-o-matic |
1019 |
- |
1020 |
-DESCRIPTION="C language family frontend for LLVM" |
1021 |
-HOMEPAGE="https://llvm.org/" |
1022 |
- |
1023 |
-# MSVCSetupApi.h: MIT |
1024 |
-# sorttable.js: MIT |
1025 |
- |
1026 |
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA MIT" |
1027 |
-SLOT="${LLVM_MAJOR}/${LLVM_SOABI}" |
1028 |
-KEYWORDS="" |
1029 |
-IUSE="debug doc +extra ieee-long-double +pie +static-analyzer test xml" |
1030 |
-REQUIRED_USE="${PYTHON_REQUIRED_USE}" |
1031 |
-RESTRICT="!test? ( test )" |
1032 |
- |
1033 |
-DEPEND=" |
1034 |
- ~sys-devel/llvm-${PV}:${LLVM_MAJOR}=[debug=,${MULTILIB_USEDEP}] |
1035 |
- static-analyzer? ( dev-lang/perl:* ) |
1036 |
- xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] ) |
1037 |
-" |
1038 |
- |
1039 |
-RDEPEND=" |
1040 |
- ${PYTHON_DEPS} |
1041 |
- ${DEPEND} |
1042 |
- >=sys-devel/clang-common-${PV} |
1043 |
-" |
1044 |
-BDEPEND=" |
1045 |
- ${PYTHON_DEPS} |
1046 |
- >=dev-util/cmake-3.16 |
1047 |
- doc? ( $(python_gen_cond_dep ' |
1048 |
- dev-python/recommonmark[${PYTHON_USEDEP}] |
1049 |
- dev-python/sphinx[${PYTHON_USEDEP}] |
1050 |
- ') ) |
1051 |
- xml? ( virtual/pkgconfig ) |
1052 |
-" |
1053 |
-PDEPEND=" |
1054 |
- ~sys-devel/clang-runtime-${PV} |
1055 |
- sys-devel/clang-toolchain-symlinks:${LLVM_MAJOR} |
1056 |
-" |
1057 |
- |
1058 |
-LLVM_COMPONENTS=( |
1059 |
- clang clang-tools-extra cmake |
1060 |
- llvm/lib/Transforms/Hello |
1061 |
-) |
1062 |
-LLVM_MANPAGES=1 |
1063 |
-LLVM_TEST_COMPONENTS=( |
1064 |
- llvm/lib/Testing |
1065 |
- llvm/utils |
1066 |
- third-party |
1067 |
-) |
1068 |
-LLVM_USE_TARGETS=llvm |
1069 |
-llvm.org_set_globals |
1070 |
- |
1071 |
-# Multilib notes: |
1072 |
-# 1. ABI_* flags control ABIs libclang* is built for only. |
1073 |
-# 2. clang is always capable of compiling code for all ABIs for enabled |
1074 |
-# target. However, you will need appropriate crt* files (installed |
1075 |
-# e.g. by sys-devel/gcc and sys-libs/glibc). |
1076 |
-# 3. ${CHOST}-clang wrappers are always installed for all ABIs included |
1077 |
-# in the current profile (i.e. alike supported by sys-devel/gcc). |
1078 |
-# |
1079 |
-# Therefore: use sys-devel/clang[${MULTILIB_USEDEP}] only if you need |
1080 |
-# multilib clang* libraries (not runtime, not wrappers). |
1081 |
- |
1082 |
-pkg_setup() { |
1083 |
- LLVM_MAX_SLOT=${LLVM_MAJOR} llvm_pkg_setup |
1084 |
- python-single-r1_pkg_setup |
1085 |
-} |
1086 |
- |
1087 |
-src_prepare() { |
1088 |
- # create extra parent dir for relative CLANG_RESOURCE_DIR access |
1089 |
- mkdir -p x/y || die |
1090 |
- BUILD_DIR=${WORKDIR}/x/y/clang |
1091 |
- |
1092 |
- llvm.org_src_prepare |
1093 |
- |
1094 |
- # add Gentoo Portage Prefix for Darwin (see prefix-dirs.patch) |
1095 |
- eprefixify \ |
1096 |
- lib/Lex/InitHeaderSearch.cpp \ |
1097 |
- lib/Driver/ToolChains/Darwin.cpp || die |
1098 |
- |
1099 |
- if ! use prefix-guest && [[ -n ${EPREFIX} ]]; then |
1100 |
- sed -i "/LibDir.*Loader/s@return \"\/\"@return \"${EPREFIX}/\"@" lib/Driver/ToolChains/Linux.cpp || die |
1101 |
- fi |
1102 |
-} |
1103 |
- |
1104 |
-check_distribution_components() { |
1105 |
- if [[ ${CMAKE_MAKEFILE_GENERATOR} == ninja ]]; then |
1106 |
- local all_targets=() my_targets=() l |
1107 |
- cd "${BUILD_DIR}" || die |
1108 |
- |
1109 |
- while read -r l; do |
1110 |
- if [[ ${l} == install-*-stripped:* ]]; then |
1111 |
- l=${l#install-} |
1112 |
- l=${l%%-stripped*} |
1113 |
- |
1114 |
- case ${l} in |
1115 |
- # meta-targets |
1116 |
- clang-libraries|distribution) |
1117 |
- continue |
1118 |
- ;; |
1119 |
- # tools |
1120 |
- clang|clangd|clang-*) |
1121 |
- ;; |
1122 |
- # static libraries |
1123 |
- clang*|findAllSymbols) |
1124 |
- continue |
1125 |
- ;; |
1126 |
- # conditional to USE=doc |
1127 |
- docs-clang-html|docs-clang-tools-html) |
1128 |
- use doc || continue |
1129 |
- ;; |
1130 |
- esac |
1131 |
- |
1132 |
- all_targets+=( "${l}" ) |
1133 |
- fi |
1134 |
- done < <(${NINJA} -t targets all) |
1135 |
- |
1136 |
- while read -r l; do |
1137 |
- my_targets+=( "${l}" ) |
1138 |
- done < <(get_distribution_components $"\n") |
1139 |
- |
1140 |
- local add=() remove=() |
1141 |
- for l in "${all_targets[@]}"; do |
1142 |
- if ! has "${l}" "${my_targets[@]}"; then |
1143 |
- add+=( "${l}" ) |
1144 |
- fi |
1145 |
- done |
1146 |
- for l in "${my_targets[@]}"; do |
1147 |
- if ! has "${l}" "${all_targets[@]}"; then |
1148 |
- remove+=( "${l}" ) |
1149 |
- fi |
1150 |
- done |
1151 |
- |
1152 |
- if [[ ${#add[@]} -gt 0 || ${#remove[@]} -gt 0 ]]; then |
1153 |
- eqawarn "get_distribution_components() is outdated!" |
1154 |
- eqawarn " Add: ${add[*]}" |
1155 |
- eqawarn "Remove: ${remove[*]}" |
1156 |
- fi |
1157 |
- cd - >/dev/null || die |
1158 |
- fi |
1159 |
-} |
1160 |
- |
1161 |
-get_distribution_components() { |
1162 |
- local sep=${1-;} |
1163 |
- |
1164 |
- local out=( |
1165 |
- # common stuff |
1166 |
- clang-cmake-exports |
1167 |
- clang-headers |
1168 |
- clang-resource-headers |
1169 |
- libclang-headers |
1170 |
- |
1171 |
- aarch64-resource-headers |
1172 |
- arm-common-resource-headers |
1173 |
- arm-resource-headers |
1174 |
- core-resource-headers |
1175 |
- cuda-resource-headers |
1176 |
- hexagon-resource-headers |
1177 |
- hip-resource-headers |
1178 |
- hlsl-resource-headers |
1179 |
- mips-resource-headers |
1180 |
- opencl-resource-headers |
1181 |
- openmp-resource-headers |
1182 |
- ppc-htm-resource-headers |
1183 |
- ppc-resource-headers |
1184 |
- riscv-resource-headers |
1185 |
- systemz-resource-headers |
1186 |
- utility-resource-headers |
1187 |
- ve-resource-headers |
1188 |
- webassembly-resource-headers |
1189 |
- windows-resource-headers |
1190 |
- x86-resource-headers |
1191 |
- |
1192 |
- # libs |
1193 |
- clang-cpp |
1194 |
- libclang |
1195 |
- ) |
1196 |
- |
1197 |
- if multilib_is_native_abi; then |
1198 |
- out+=( |
1199 |
- # common stuff |
1200 |
- bash-autocomplete |
1201 |
- libclang-python-bindings |
1202 |
- |
1203 |
- # tools |
1204 |
- amdgpu-arch |
1205 |
- c-index-test |
1206 |
- clang |
1207 |
- clang-format |
1208 |
- clang-offload-bundler |
1209 |
- clang-offload-packager |
1210 |
- clang-refactor |
1211 |
- clang-repl |
1212 |
- clang-rename |
1213 |
- clang-scan-deps |
1214 |
- diagtool |
1215 |
- hmaptool |
1216 |
- nvptx-arch |
1217 |
- |
1218 |
- # needed for cross-compiling Clang |
1219 |
- clang-tblgen |
1220 |
- ) |
1221 |
- |
1222 |
- if use extra; then |
1223 |
- out+=( |
1224 |
- # extra tools |
1225 |
- clang-apply-replacements |
1226 |
- clang-change-namespace |
1227 |
- clang-doc |
1228 |
- clang-include-cleaner |
1229 |
- clang-include-fixer |
1230 |
- clang-move |
1231 |
- clang-pseudo |
1232 |
- clang-query |
1233 |
- clang-reorder-fields |
1234 |
- clang-tidy |
1235 |
- clang-tidy-headers |
1236 |
- clangd |
1237 |
- find-all-symbols |
1238 |
- modularize |
1239 |
- pp-trace |
1240 |
- ) |
1241 |
- fi |
1242 |
- |
1243 |
- if llvm_are_manpages_built; then |
1244 |
- out+=( docs-clang-man ) |
1245 |
- use extra && out+=( docs-clang-tools-man ) |
1246 |
- fi |
1247 |
- |
1248 |
- if use doc; then |
1249 |
- out+=( docs-clang-html ) |
1250 |
- use extra && out+=( docs-clang-tools-html ) |
1251 |
- fi |
1252 |
- |
1253 |
- use static-analyzer && out+=( |
1254 |
- clang-check |
1255 |
- clang-extdef-mapping |
1256 |
- scan-build |
1257 |
- scan-build-py |
1258 |
- scan-view |
1259 |
- ) |
1260 |
- fi |
1261 |
- |
1262 |
- printf "%s${sep}" "${out[@]}" |
1263 |
-} |
1264 |
- |
1265 |
-multilib_src_configure() { |
1266 |
- tc-is-gcc && filter-lto # GCC miscompiles LLVM, bug #873670 |
1267 |
- |
1268 |
- local mycmakeargs=( |
1269 |
- -DDEFAULT_SYSROOT=$(usex prefix-guest "" "${EPREFIX}") |
1270 |
- -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}" |
1271 |
- -DCMAKE_INSTALL_MANDIR="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/share/man" |
1272 |
- -DCLANG_CONFIG_FILE_SYSTEM_DIR="${EPREFIX}/etc/clang" |
1273 |
- # relative to bindir |
1274 |
- -DCLANG_RESOURCE_DIR="../../../../lib/clang/${LLVM_MAJOR}" |
1275 |
- |
1276 |
- -DBUILD_SHARED_LIBS=OFF |
1277 |
- -DCLANG_LINK_CLANG_DYLIB=ON |
1278 |
- -DLLVM_DISTRIBUTION_COMPONENTS=$(get_distribution_components) |
1279 |
- -DCLANG_INCLUDE_TESTS=$(usex test) |
1280 |
- |
1281 |
- -DLLVM_TARGETS_TO_BUILD="${LLVM_TARGETS// /;}" |
1282 |
- |
1283 |
- # these are not propagated reliably, so redefine them |
1284 |
- -DLLVM_ENABLE_EH=ON |
1285 |
- -DLLVM_ENABLE_RTTI=ON |
1286 |
- |
1287 |
- -DCMAKE_DISABLE_FIND_PACKAGE_LibXml2=$(usex !xml) |
1288 |
- # libgomp support fails to find headers without explicit -I |
1289 |
- # furthermore, it provides only syntax checking |
1290 |
- -DCLANG_DEFAULT_OPENMP_RUNTIME=libomp |
1291 |
- |
1292 |
- # disable using CUDA to autodetect GPU, just build for all |
1293 |
- -DCMAKE_DISABLE_FIND_PACKAGE_CUDA=ON |
1294 |
- # disable linking to HSA to avoid automagic dep, |
1295 |
- # load it dynamically instead |
1296 |
- -DCMAKE_DISABLE_FIND_PACKAGE_hsa-runtime64=ON |
1297 |
- |
1298 |
- -DCLANG_DEFAULT_PIE_ON_LINUX=$(usex pie) |
1299 |
- |
1300 |
- -DCLANG_ENABLE_ARCMT=$(usex static-analyzer) |
1301 |
- -DCLANG_ENABLE_STATIC_ANALYZER=$(usex static-analyzer) |
1302 |
- |
1303 |
- -DPython3_EXECUTABLE="${PYTHON}" |
1304 |
- ) |
1305 |
- |
1306 |
- if ! use elibc_musl; then |
1307 |
- mycmakeargs+=( |
1308 |
- -DPPC_LINUX_DEFAULT_IEEELONGDOUBLE=$(usex ieee-long-double) |
1309 |
- ) |
1310 |
- fi |
1311 |
- |
1312 |
- use test && mycmakeargs+=( |
1313 |
- -DLLVM_BUILD_TESTS=ON |
1314 |
- -DLLVM_LIT_ARGS="$(get_lit_flags)" |
1315 |
- ) |
1316 |
- |
1317 |
- if multilib_is_native_abi; then |
1318 |
- local build_docs=OFF |
1319 |
- if llvm_are_manpages_built; then |
1320 |
- build_docs=ON |
1321 |
- mycmakeargs+=( |
1322 |
- -DLLVM_BUILD_DOCS=ON |
1323 |
- -DLLVM_ENABLE_SPHINX=ON |
1324 |
- -DCLANG_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/html" |
1325 |
- -DSPHINX_WARNINGS_AS_ERRORS=OFF |
1326 |
- ) |
1327 |
- if use extra; then |
1328 |
- mycmakeargs+=( |
1329 |
- -DCLANG-TOOLS_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/tools-extra" |
1330 |
- ) |
1331 |
- fi |
1332 |
- fi |
1333 |
- mycmakeargs+=( |
1334 |
- -DCLANG_INCLUDE_DOCS=${build_docs} |
1335 |
- ) |
1336 |
- fi |
1337 |
- if multilib_native_use extra; then |
1338 |
- mycmakeargs+=( |
1339 |
- -DLLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR="${WORKDIR}"/clang-tools-extra |
1340 |
- -DCLANG_TOOLS_EXTRA_INCLUDE_DOCS=${build_docs} |
1341 |
- ) |
1342 |
- else |
1343 |
- mycmakeargs+=( |
1344 |
- -DLLVM_TOOL_CLANG_TOOLS_EXTRA_BUILD=OFF |
1345 |
- ) |
1346 |
- fi |
1347 |
- |
1348 |
- if [[ -n ${EPREFIX} ]]; then |
1349 |
- mycmakeargs+=( |
1350 |
- -DGCC_INSTALL_PREFIX="${EPREFIX}/usr" |
1351 |
- ) |
1352 |
- fi |
1353 |
- |
1354 |
- if tc-is-cross-compiler; then |
1355 |
- has_version -b sys-devel/clang:${LLVM_MAJOR} || |
1356 |
- die "sys-devel/clang:${LLVM_MAJOR} is required on the build host." |
1357 |
- local tools_bin=${BROOT}/usr/lib/llvm/${LLVM_MAJOR}/bin |
1358 |
- mycmakeargs+=( |
1359 |
- -DLLVM_TOOLS_BINARY_DIR="${tools_bin}" |
1360 |
- -DCLANG_TABLEGEN="${tools_bin}"/clang-tblgen |
1361 |
- ) |
1362 |
- fi |
1363 |
- |
1364 |
- # LLVM can have very high memory consumption while linking, |
1365 |
- # exhausting the limit on 32-bit linker executable |
1366 |
- use x86 && local -x LDFLAGS="${LDFLAGS} -Wl,--no-keep-memory" |
1367 |
- |
1368 |
- # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844 |
1369 |
- use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG" |
1370 |
- cmake_src_configure |
1371 |
- |
1372 |
- multilib_is_native_abi && check_distribution_components |
1373 |
-} |
1374 |
- |
1375 |
-multilib_src_compile() { |
1376 |
- cmake_build distribution |
1377 |
- |
1378 |
- # provide a symlink for tests |
1379 |
- if [[ ! -L ${WORKDIR}/lib/clang ]]; then |
1380 |
- mkdir -p "${WORKDIR}"/lib || die |
1381 |
- ln -s "${BUILD_DIR}/$(get_libdir)/clang" "${WORKDIR}"/lib/clang || die |
1382 |
- fi |
1383 |
-} |
1384 |
- |
1385 |
-multilib_src_test() { |
1386 |
- # respect TMPDIR! |
1387 |
- local -x LIT_PRESERVES_TMP=1 |
1388 |
- local test_targets=( check-clang ) |
1389 |
- if multilib_native_use extra; then |
1390 |
- test_targets+=( |
1391 |
- check-clang-tools |
1392 |
- check-clangd |
1393 |
- ) |
1394 |
- fi |
1395 |
- cmake_build "${test_targets[@]}" |
1396 |
-} |
1397 |
- |
1398 |
-src_install() { |
1399 |
- MULTILIB_WRAPPED_HEADERS=( |
1400 |
- /usr/include/clang/Config/config.h |
1401 |
- ) |
1402 |
- |
1403 |
- multilib-minimal_src_install |
1404 |
- |
1405 |
- # Move runtime headers to /usr/lib/clang, where they belong |
1406 |
- mv "${ED}"/usr/include/clangrt "${ED}"/usr/lib/clang || die |
1407 |
- # move (remaining) wrapped headers back |
1408 |
- if use extra; then |
1409 |
- mv "${T}"/clang-tidy "${ED}"/usr/include/ || die |
1410 |
- fi |
1411 |
- mv "${ED}"/usr/include "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/include || die |
1412 |
- |
1413 |
- # Apply CHOST and version suffix to clang tools |
1414 |
- local clang_tools=( clang clang++ clang-cl clang-cpp ) |
1415 |
- local abi i |
1416 |
- |
1417 |
- # cmake gives us: |
1418 |
- # - clang-X |
1419 |
- # - clang -> clang-X |
1420 |
- # - clang++, clang-cl, clang-cpp -> clang |
1421 |
- # we want to have: |
1422 |
- # - clang-X |
1423 |
- # - clang++-X, clang-cl-X, clang-cpp-X -> clang-X |
1424 |
- # - clang, clang++, clang-cl, clang-cpp -> clang*-X |
1425 |
- # also in CHOST variant |
1426 |
- for i in "${clang_tools[@]:1}"; do |
1427 |
- rm "${ED}/usr/lib/llvm/${LLVM_MAJOR}/bin/${i}" || die |
1428 |
- dosym "clang-${LLVM_MAJOR}" "/usr/lib/llvm/${LLVM_MAJOR}/bin/${i}-${LLVM_MAJOR}" |
1429 |
- dosym "${i}-${LLVM_MAJOR}" "/usr/lib/llvm/${LLVM_MAJOR}/bin/${i}" |
1430 |
- done |
1431 |
- |
1432 |
- # now create target symlinks for all supported ABIs |
1433 |
- for abi in $(get_all_abis); do |
1434 |
- local abi_chost=$(get_abi_CHOST "${abi}") |
1435 |
- for i in "${clang_tools[@]}"; do |
1436 |
- dosym "${i}-${LLVM_MAJOR}" \ |
1437 |
- "/usr/lib/llvm/${LLVM_MAJOR}/bin/${abi_chost}-${i}-${LLVM_MAJOR}" |
1438 |
- dosym "${abi_chost}-${i}-${LLVM_MAJOR}" \ |
1439 |
- "/usr/lib/llvm/${LLVM_MAJOR}/bin/${abi_chost}-${i}" |
1440 |
- done |
1441 |
- done |
1442 |
-} |
1443 |
- |
1444 |
-multilib_src_install() { |
1445 |
- DESTDIR=${D} cmake_build install-distribution |
1446 |
- |
1447 |
- # move headers to /usr/include for wrapping & ABI mismatch checks |
1448 |
- # (also drop the version suffix from runtime headers) |
1449 |
- rm -rf "${ED}"/usr/include || die |
1450 |
- mv "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/include "${ED}"/usr/include || die |
1451 |
- mv "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/$(get_libdir)/clang "${ED}"/usr/include/clangrt || die |
1452 |
- if multilib_native_use extra; then |
1453 |
- # don't wrap clang-tidy headers, the list is too long |
1454 |
- # (they're fine for non-native ABI but enabling the targets is problematic) |
1455 |
- mv "${ED}"/usr/include/clang-tidy "${T}/" || die |
1456 |
- fi |
1457 |
-} |
1458 |
- |
1459 |
-multilib_src_install_all() { |
1460 |
- python_fix_shebang "${ED}" |
1461 |
- if use static-analyzer; then |
1462 |
- python_optimize "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/share/scan-view |
1463 |
- fi |
1464 |
- |
1465 |
- docompress "/usr/lib/llvm/${LLVM_MAJOR}/share/man" |
1466 |
- llvm_install_manpages |
1467 |
- # match 'html' non-compression |
1468 |
- use doc && docompress -x "/usr/share/doc/${PF}/tools-extra" |
1469 |
- # +x for some reason; TODO: investigate |
1470 |
- use static-analyzer && fperms a-x "/usr/lib/llvm/${LLVM_MAJOR}/share/man/man1/scan-build.1" |
1471 |
-} |
1472 |
- |
1473 |
-pkg_postinst() { |
1474 |
- if [[ -z ${ROOT} && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then |
1475 |
- eselect compiler-shadow update all |
1476 |
- fi |
1477 |
- |
1478 |
- elog "You can find additional utility scripts in:" |
1479 |
- elog " ${EROOT}/usr/lib/llvm/${LLVM_MAJOR}/share/clang" |
1480 |
- if use extra; then |
1481 |
- elog "Some of them are vim integration scripts (with instructions inside)." |
1482 |
- elog "The run-clang-tidy.py script requires the following additional package:" |
1483 |
- elog " dev-python/pyyaml" |
1484 |
- fi |
1485 |
-} |
1486 |
- |
1487 |
-pkg_postrm() { |
1488 |
- if [[ -z ${ROOT} && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then |
1489 |
- eselect compiler-shadow clean all |
1490 |
- fi |
1491 |
-} |