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