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