1 |
commit: c4ea50ca83bfb8f0a402b4f9217eeaa9cbc85c20 |
2 |
Author: Bernard Cafarelli <voyageur <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Oct 11 18:38:48 2015 +0000 |
4 |
Commit: Bernard Cafarelli <voyageur <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Oct 11 18:39:00 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c4ea50ca |
7 |
|
8 |
sys-devel/llvm: bump to fix lldb python install |
9 |
|
10 |
Bug: 562436 |
11 |
Bug: 562438 |
12 |
|
13 |
Package-Manager: portage-2.2.23 |
14 |
|
15 |
sys-devel/llvm/files/llvm-3.7-lldb_python.patch | 23 ++ |
16 |
sys-devel/llvm/llvm-3.7.0-r2.ebuild | 504 ++++++++++++++++++++++++ |
17 |
2 files changed, 527 insertions(+) |
18 |
|
19 |
diff --git a/sys-devel/llvm/files/llvm-3.7-lldb_python.patch b/sys-devel/llvm/files/llvm-3.7-lldb_python.patch |
20 |
new file mode 100644 |
21 |
index 0000000..1a95827 |
22 |
--- /dev/null |
23 |
+++ b/sys-devel/llvm/files/llvm-3.7-lldb_python.patch |
24 |
@@ -0,0 +1,23 @@ |
25 |
+diff -Naur llvm-3.7.0.src.orig/tools/lldb/scripts/Python/finishSwigPythonLLDB.py llvm-3.7.0.src/tools/lldb/scripts/Python/finishSwigPythonLLDB.py |
26 |
+--- llvm-3.7.0.src.orig/tools/lldb/scripts/Python/finishSwigPythonLLDB.py 2015-06-04 05:12:37.000000000 +0200 |
27 |
++++ llvm-3.7.0.src/tools/lldb/scripts/Python/finishSwigPythonLLDB.py 2015-10-11 19:19:54.074935710 +0200 |
28 |
+@@ -371,14 +371,14 @@ |
29 |
+ strLibFileExtn = ".dylib"; |
30 |
+ else: |
31 |
+ strLibFileExtn = ".so"; |
32 |
+- strSrc = os.path.join("lib", "liblldb" + strLibFileExtn); |
33 |
++ strSrc = os.path.join("GENTOO_LIBDIR", "liblldb" + strLibFileExtn); |
34 |
+ |
35 |
+- if eOSType != utilsOsType.EnumOsType.Windows: |
36 |
++# if eOSType != utilsOsType.EnumOsType.Windows: |
37 |
+ # Create a symlink to the "lib" directory, to ensure liblldb's RPATH is |
38 |
+ # effective. |
39 |
+- bOk, strErrMsg = make_symlink( vDictArgs, vstrFrameworkPythonDir, "lib", os.path.join("../lib") ); |
40 |
+- if not bOk: |
41 |
+- return (bOk, strErrMsg) |
42 |
++# bOk, strErrMsg = make_symlink( vDictArgs, vstrFrameworkPythonDir, "lib", os.path.join("../lib") ); |
43 |
++# if not bOk: |
44 |
++# return (bOk, strErrMsg) |
45 |
+ |
46 |
+ bOk, strErrMsg = make_symlink( vDictArgs, vstrFrameworkPythonDir, strSrc, strTarget ); |
47 |
+ |
48 |
|
49 |
diff --git a/sys-devel/llvm/llvm-3.7.0-r2.ebuild b/sys-devel/llvm/llvm-3.7.0-r2.ebuild |
50 |
new file mode 100644 |
51 |
index 0000000..de885b7 |
52 |
--- /dev/null |
53 |
+++ b/sys-devel/llvm/llvm-3.7.0-r2.ebuild |
54 |
@@ -0,0 +1,504 @@ |
55 |
+# Copyright 1999-2015 Gentoo Foundation |
56 |
+# Distributed under the terms of the GNU General Public License v2 |
57 |
+# $Id$ |
58 |
+ |
59 |
+EAPI=5 |
60 |
+ |
61 |
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja} |
62 |
+PYTHON_COMPAT=( python2_7 pypy ) |
63 |
+ |
64 |
+inherit check-reqs cmake-utils eutils flag-o-matic multilib \ |
65 |
+ multilib-minimal python-r1 toolchain-funcs pax-utils |
66 |
+ |
67 |
+DESCRIPTION="Low Level Virtual Machine" |
68 |
+HOMEPAGE="http://llvm.org/" |
69 |
+SRC_URI="http://llvm.org/releases/${PV}/${P}.src.tar.xz |
70 |
+ clang? ( http://llvm.org/releases/${PV}/compiler-rt-${PV}.src.tar.xz |
71 |
+ http://llvm.org/releases/${PV}/cfe-${PV}.src.tar.xz |
72 |
+ http://llvm.org/releases/${PV}/clang-tools-extra-${PV}.src.tar.xz ) |
73 |
+ lldb? ( http://llvm.org/releases/${PV}/lldb-${PV}.src.tar.xz ) |
74 |
+ !doc? ( http://dev.gentoo.org/~voyageur/distfiles/${P}-manpages.tar.bz2 )" |
75 |
+ |
76 |
+LICENSE="UoI-NCSA" |
77 |
+SLOT="0/${PV}" |
78 |
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x64-freebsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos" |
79 |
+IUSE="clang debug doc gold libedit +libffi lldb multitarget ncurses ocaml |
80 |
+ python +static-analyzer test xml video_cards_radeon kernel_Darwin" |
81 |
+ |
82 |
+COMMON_DEPEND=" |
83 |
+ sys-libs/zlib:0= |
84 |
+ clang? ( |
85 |
+ python? ( ${PYTHON_DEPS} ) |
86 |
+ static-analyzer? ( |
87 |
+ dev-lang/perl:* |
88 |
+ ${PYTHON_DEPS} |
89 |
+ ) |
90 |
+ xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] ) |
91 |
+ ) |
92 |
+ gold? ( >=sys-devel/binutils-2.22:*[cxx] ) |
93 |
+ libedit? ( dev-libs/libedit:0=[${MULTILIB_USEDEP}] ) |
94 |
+ libffi? ( >=virtual/libffi-3.0.13-r1:0=[${MULTILIB_USEDEP}] ) |
95 |
+ ncurses? ( >=sys-libs/ncurses-5.9-r3:0=[${MULTILIB_USEDEP}] ) |
96 |
+ ocaml? ( |
97 |
+ dev-lang/ocaml:0= |
98 |
+ dev-ml/findlib |
99 |
+ dev-ml/ocaml-ctypes )" |
100 |
+# configparser-3.2 breaks the build (3.3 or none at all are fine) |
101 |
+DEPEND="${COMMON_DEPEND} |
102 |
+ dev-lang/perl |
103 |
+ >=sys-devel/make-3.81 |
104 |
+ >=sys-devel/flex-2.5.4 |
105 |
+ >=sys-devel/bison-1.875d |
106 |
+ || ( >=sys-devel/gcc-3.0 >=sys-devel/llvm-3.5 |
107 |
+ ( >=sys-freebsd/freebsd-lib-9.1-r10 sys-libs/libcxx ) |
108 |
+ ) |
109 |
+ || ( >=sys-devel/binutils-2.18 >=sys-devel/binutils-apple-5.1 ) |
110 |
+ kernel_Darwin? ( sys-libs/libcxx ) |
111 |
+ clang? ( xml? ( virtual/pkgconfig ) ) |
112 |
+ doc? ( dev-python/sphinx ) |
113 |
+ gold? ( sys-libs/binutils-libs ) |
114 |
+ libffi? ( virtual/pkgconfig ) |
115 |
+ lldb? ( dev-lang/swig ) |
116 |
+ !!<dev-python/configparser-3.3.0.2 |
117 |
+ ocaml? ( test? ( dev-ml/ounit ) ) |
118 |
+ ${PYTHON_DEPS}" |
119 |
+RDEPEND="${COMMON_DEPEND} |
120 |
+ clang? ( !<=sys-devel/clang-${PV}-r99 ) |
121 |
+ abi_x86_32? ( !<=app-emulation/emul-linux-x86-baselibs-20130224-r2 |
122 |
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] )" |
123 |
+PDEPEND="clang? ( =sys-devel/clang-${PV}-r100 )" |
124 |
+ |
125 |
+# pypy gives me around 1700 unresolved tests due to open file limit |
126 |
+# being exceeded. probably GC does not close them fast enough. |
127 |
+REQUIRED_USE="${PYTHON_REQUIRED_USE} |
128 |
+ lldb? ( clang ) |
129 |
+ test? ( || ( $(python_gen_useflags 'python*') ) )" |
130 |
+ |
131 |
+S=${WORKDIR}/${P/_}.src |
132 |
+ |
133 |
+pkg_pretend() { |
134 |
+ # in megs |
135 |
+ # !clang !debug !multitarget -O2 400 |
136 |
+ # !clang !debug multitarget -O2 550 |
137 |
+ # clang !debug !multitarget -O2 950 |
138 |
+ # clang !debug multitarget -O2 1200 |
139 |
+ # !clang debug multitarget -O2 5G |
140 |
+ # clang !debug multitarget -O0 -g 12G |
141 |
+ # clang debug multitarget -O2 16G |
142 |
+ # clang debug multitarget -O0 -g 14G |
143 |
+ |
144 |
+ local build_size=550 |
145 |
+ use clang && build_size=1200 |
146 |
+ |
147 |
+ if use debug; then |
148 |
+ ewarn "USE=debug is known to increase the size of package considerably" |
149 |
+ ewarn "and cause the tests to fail." |
150 |
+ ewarn |
151 |
+ |
152 |
+ (( build_size *= 14 )) |
153 |
+ elif is-flagq '-g?(gdb)?([1-9])'; then |
154 |
+ ewarn "The C++ compiler -g option is known to increase the size of the package" |
155 |
+ ewarn "considerably. If you run out of space, please consider removing it." |
156 |
+ ewarn |
157 |
+ |
158 |
+ (( build_size *= 10 )) |
159 |
+ fi |
160 |
+ |
161 |
+ # Multiply by number of ABIs :). |
162 |
+ local abis=( $(multilib_get_enabled_abis) ) |
163 |
+ (( build_size *= ${#abis[@]} )) |
164 |
+ |
165 |
+ local CHECKREQS_DISK_BUILD=${build_size}M |
166 |
+ check-reqs_pkg_pretend |
167 |
+ |
168 |
+ if [[ ${MERGE_TYPE} != binary ]]; then |
169 |
+ echo 'int main() {return 0;}' > "${T}"/test.cxx || die |
170 |
+ ebegin "Trying to build a C++11 test program" |
171 |
+ if ! $(tc-getCXX) -std=c++11 -o /dev/null "${T}"/test.cxx; then |
172 |
+ eerror "LLVM-${PV} requires C++11-capable C++ compiler. Your current compiler" |
173 |
+ eerror "does not seem to support -std=c++11 option. Please upgrade your compiler" |
174 |
+ eerror "to gcc-4.7 or an equivalent version supporting C++11." |
175 |
+ die "Currently active compiler does not support -std=c++11" |
176 |
+ fi |
177 |
+ eend ${?} |
178 |
+ fi |
179 |
+} |
180 |
+ |
181 |
+pkg_setup() { |
182 |
+ pkg_pretend |
183 |
+} |
184 |
+ |
185 |
+src_unpack() { |
186 |
+ default |
187 |
+ |
188 |
+ if use clang; then |
189 |
+ mv "${WORKDIR}"/cfe-${PV/_}.src "${S}"/tools/clang \ |
190 |
+ || die "clang source directory move failed" |
191 |
+ mv "${WORKDIR}"/compiler-rt-${PV/_}.src "${S}"/projects/compiler-rt \ |
192 |
+ || die "compiler-rt source directory move failed" |
193 |
+ mv "${WORKDIR}"/clang-tools-extra-${PV/_}.src "${S}"/tools/clang/tools/extra \ |
194 |
+ || die "clang-tools-extra source directory move failed" |
195 |
+ fi |
196 |
+ |
197 |
+ if use lldb; then |
198 |
+ mv "${WORKDIR}"/lldb-${PV/_}.src "${S}"/tools/lldb \ |
199 |
+ || die "lldb source directory move failed" |
200 |
+ fi |
201 |
+} |
202 |
+ |
203 |
+src_prepare() { |
204 |
+ # Make ocaml warnings non-fatal, bug #537308 |
205 |
+ sed -e "/RUN/s/-warn-error A//" -i test/Bindings/OCaml/*ml || die |
206 |
+ # Fix libdir for ocaml bindings install, bug #559134 |
207 |
+ epatch "${FILESDIR}"/cmake/${P}-ocaml-multilib.patch |
208 |
+ |
209 |
+ # Make it possible to override Sphinx HTML install dirs |
210 |
+ # https://llvm.org/bugs/show_bug.cgi?id=23780 |
211 |
+ epatch "${FILESDIR}"/cmake/0002-cmake-Support-overriding-Sphinx-HTML-doc-install-dir.patch |
212 |
+ |
213 |
+ # Prevent race conditions with parallel Sphinx runs |
214 |
+ # https://llvm.org/bugs/show_bug.cgi?id=23781 |
215 |
+ epatch "${FILESDIR}"/cmake/0003-cmake-Add-an-ordering-dep-between-HTML-man-Sphinx-ta.patch |
216 |
+ |
217 |
+ # Prevent installing libgtest |
218 |
+ # https://llvm.org/bugs/show_bug.cgi?id=18341 |
219 |
+ epatch "${FILESDIR}"/cmake/0004-cmake-Do-not-install-libgtest.patch |
220 |
+ |
221 |
+ if use clang; then |
222 |
+ # Automatically select active system GCC's libraries, bugs #406163 and #417913 |
223 |
+ epatch "${FILESDIR}"/clang-3.5-gentoo-runtime-gcc-detection-v3.patch |
224 |
+ |
225 |
+ epatch "${FILESDIR}"/clang-3.6-gentoo-install.patch |
226 |
+ |
227 |
+ sed -i -e "s^@EPREFIX@^${EPREFIX}^" \ |
228 |
+ tools/clang/tools/scan-build/scan-build || die |
229 |
+ |
230 |
+ # Install clang runtime into /usr/lib/clang |
231 |
+ # https://llvm.org/bugs/show_bug.cgi?id=23792 |
232 |
+ epatch "${FILESDIR}"/cmake/clang-0001-Install-clang-runtime-into-usr-lib-without-suffix.patch |
233 |
+ epatch "${FILESDIR}"/cmake/compiler-rt-0001-cmake-Install-compiler-rt-into-usr-lib-without-suffi.patch |
234 |
+ |
235 |
+ # Make it possible to override CLANG_LIBDIR_SUFFIX |
236 |
+ # (that is used only to find LLVMgold.so) |
237 |
+ # https://llvm.org/bugs/show_bug.cgi?id=23793 |
238 |
+ epatch "${FILESDIR}"/cmake/clang-0002-cmake-Make-CLANG_LIBDIR_SUFFIX-overridable.patch |
239 |
+ |
240 |
+ # Fix WX sections, bug #421527 |
241 |
+ find "${S}"/projects/compiler-rt/lib/builtins -type f -name \*.S -exec sed \ |
242 |
+ -e '$a\\n#if defined(__linux__) && defined(__ELF__)\n.section .note.GNU-stack,"",%progbits\n#endif' \ |
243 |
+ -i {} \; || die |
244 |
+ fi |
245 |
+ |
246 |
+ if use lldb; then |
247 |
+ # Do not install dummy readline.so module from |
248 |
+ # https://llvm.org/bugs/show_bug.cgi?id=18841 |
249 |
+ sed -e 's/add_subdirectory(readline)/#&/' \ |
250 |
+ -i tools/lldb/scripts/Python/modules/CMakeLists.txt || die |
251 |
+ |
252 |
+ # Fix Python paths, bugs #562436 and #562438 |
253 |
+ epatch "${FILESDIR}"/${PN}-3.7-lldb_python.patch |
254 |
+ sed -e "s/GENTOO_LIBDIR/$(get_libdir)/" \ |
255 |
+ -i tools/lldb/scripts/Python/finishSwigPythonLLDB.py || die |
256 |
+ fi |
257 |
+ |
258 |
+ # User patches |
259 |
+ epatch_user |
260 |
+ |
261 |
+ python_setup |
262 |
+ |
263 |
+ # Native libdir is used to hold LLVMgold.so |
264 |
+ NATIVE_LIBDIR=$(get_libdir) |
265 |
+} |
266 |
+ |
267 |
+multilib_src_configure() { |
268 |
+ local targets |
269 |
+ if use multitarget; then |
270 |
+ targets=all |
271 |
+ else |
272 |
+ targets='host;CppBackend' |
273 |
+ use video_cards_radeon && targets+=';AMDGPU' |
274 |
+ fi |
275 |
+ |
276 |
+ local ffi_cflags ffi_ldflags |
277 |
+ if use libffi; then |
278 |
+ ffi_cflags=$(pkg-config --cflags-only-I libffi) |
279 |
+ ffi_ldflags=$(pkg-config --libs-only-L libffi) |
280 |
+ fi |
281 |
+ |
282 |
+ local libdir=$(get_libdir) |
283 |
+ local mycmakeargs=( |
284 |
+ "${mycmakeargs[@]}" |
285 |
+ -DLLVM_LIBDIR_SUFFIX=${libdir#lib} |
286 |
+ |
287 |
+ -DBUILD_SHARED_LIBS=ON |
288 |
+ -DLLVM_ENABLE_TIMESTAMPS=OFF |
289 |
+ -DLLVM_TARGETS_TO_BUILD="${targets}" |
290 |
+ -DLLVM_BUILD_TESTS=$(usex test) |
291 |
+ |
292 |
+ -DLLVM_ENABLE_FFI=$(usex libffi) |
293 |
+ -DLLVM_ENABLE_TERMINFO=$(usex ncurses) |
294 |
+ -DLLVM_ENABLE_ASSERTIONS=$(usex debug) |
295 |
+ -DLLVM_ENABLE_EH=ON |
296 |
+ -DLLVM_ENABLE_RTTI=ON |
297 |
+ |
298 |
+ -DWITH_POLLY=OFF # TODO |
299 |
+ |
300 |
+ -DLLVM_HOST_TRIPLE="${CHOST}" |
301 |
+ |
302 |
+ -DFFI_INCLUDE_DIR="${ffi_cflags#-I}" |
303 |
+ -DFFI_LIBRARY_DIR="${ffi_ldflags#-L}" |
304 |
+ |
305 |
+ -DHAVE_HISTEDIT_H=$(usex libedit) |
306 |
+ ) |
307 |
+ |
308 |
+ if use lldb; then |
309 |
+ mycmakeargs+=( |
310 |
+ -DLLDB_DISABLE_LIBEDIT=$(usex !libedit) |
311 |
+ -DLLDB_DISABLE_CURSES=$(usex !ncurses) |
312 |
+ -DLLDB_ENABLE_TERMINFO=$(usex ncurses) |
313 |
+ ) |
314 |
+ fi |
315 |
+ |
316 |
+ if ! multilib_is_native_abi || ! use ocaml; then |
317 |
+ mycmakeargs+=( |
318 |
+ -DOCAMLFIND=NO |
319 |
+ ) |
320 |
+ fi |
321 |
+# Note: go bindings have no CMake rules at the moment |
322 |
+# but let's kill the check in case they are introduced |
323 |
+# if ! multilib_is_native_abi || ! use go; then |
324 |
+ mycmakeargs+=( |
325 |
+ -DGO_EXECUTABLE=GO_EXECUTABLE-NOTFOUND |
326 |
+ ) |
327 |
+# fi |
328 |
+ |
329 |
+ if multilib_is_native_abi; then |
330 |
+ mycmakeargs+=( |
331 |
+ -DLLVM_BUILD_DOCS=$(usex doc) |
332 |
+ -DLLVM_ENABLE_SPHINX=$(usex doc) |
333 |
+ -DLLVM_ENABLE_DOXYGEN=OFF |
334 |
+ -DLLVM_INSTALL_HTML="${EPREFIX}/usr/share/doc/${PF}/html" |
335 |
+ -DSPHINX_WARNINGS_AS_ERRORS=OFF |
336 |
+ -DLLVM_INSTALL_UTILS=ON |
337 |
+ ) |
338 |
+ |
339 |
+ if use clang; then |
340 |
+ mycmakeargs+=( |
341 |
+ -DCLANG_INSTALL_HTML="${EPREFIX}/usr/share/doc/${PF}/clang" |
342 |
+ ) |
343 |
+ fi |
344 |
+ |
345 |
+ if use gold; then |
346 |
+ mycmakeargs+=( |
347 |
+ -DLLVM_BINUTILS_INCDIR="${EPREFIX}"/usr/include |
348 |
+ ) |
349 |
+ fi |
350 |
+ |
351 |
+ if use lldb; then |
352 |
+ mycmakeargs+=( |
353 |
+ -DLLDB_DISABLE_PYTHON=$(usex !python) |
354 |
+ ) |
355 |
+ fi |
356 |
+ |
357 |
+ else |
358 |
+ if use clang; then |
359 |
+ mycmakeargs+=( |
360 |
+ # disable compiler-rt on non-native ABI because: |
361 |
+ # 1. it fails to configure because of -m32 |
362 |
+ # 2. it is shared between ABIs so no point building |
363 |
+ # it multiple times |
364 |
+ -DLLVM_EXTERNAL_COMPILER_RT_BUILD=OFF |
365 |
+ -DLLVM_EXTERNAL_CLANG_TOOLS_EXTRA_BUILD=OFF |
366 |
+ ) |
367 |
+ fi |
368 |
+ if use lldb; then |
369 |
+ mycmakeargs+=( |
370 |
+ # only run swig on native abi |
371 |
+ -DLLDB_DISABLE_PYTHON=ON |
372 |
+ ) |
373 |
+ fi |
374 |
+ fi |
375 |
+ |
376 |
+ if use clang; then |
377 |
+ mycmakeargs+=( |
378 |
+ -DCLANG_ENABLE_ARCMT=$(usex static-analyzer) |
379 |
+ -DCLANG_ENABLE_STATIC_ANALYZER=$(usex static-analyzer) |
380 |
+ -DCLANG_LIBDIR_SUFFIX="${NATIVE_LIBDIR#lib}" |
381 |
+ ) |
382 |
+ |
383 |
+ # -- not needed when compiler-rt is built with host compiler -- |
384 |
+ # cmake passes host C*FLAGS to compiler-rt build |
385 |
+ # which is performed using clang, so we need to filter out |
386 |
+ # some flags clang does not support |
387 |
+ # (if you know some more flags that don't work, let us know) |
388 |
+ #filter-flags -msahf -frecord-gcc-switches |
389 |
+ fi |
390 |
+ |
391 |
+ cmake-utils_src_configure |
392 |
+} |
393 |
+ |
394 |
+multilib_src_compile() { |
395 |
+ cmake-utils_src_compile |
396 |
+ # TODO: not sure why this target is not correctly called |
397 |
+ multilib_is_native_abi && use doc && use ocaml && cmake-utils_src_make docs/ocaml_doc |
398 |
+ |
399 |
+ pax-mark m "${BUILD_DIR}"/bin/llvm-rtdyld |
400 |
+ pax-mark m "${BUILD_DIR}"/bin/lli |
401 |
+ pax-mark m "${BUILD_DIR}"/bin/lli-child-target |
402 |
+ |
403 |
+ if use test; then |
404 |
+ pax-mark m "${BUILD_DIR}"/unittests/ExecutionEngine/Orc/OrcJITTests |
405 |
+ pax-mark m "${BUILD_DIR}"/unittests/ExecutionEngine/MCJIT/MCJITTests |
406 |
+ pax-mark m "${BUILD_DIR}"/unittests/Support/SupportTests |
407 |
+ fi |
408 |
+} |
409 |
+ |
410 |
+multilib_src_test() { |
411 |
+ # respect TMPDIR! |
412 |
+ local -x LIT_PRESERVES_TMP=1 |
413 |
+ local test_targets=( check ) |
414 |
+ # clang tests won't work on non-native ABI because we skip compiler-rt |
415 |
+ multilib_is_native_abi && use clang && test_targets+=( check-clang ) |
416 |
+ cmake-utils_src_make "${test_targets[@]}" |
417 |
+} |
418 |
+ |
419 |
+src_install() { |
420 |
+ local MULTILIB_CHOST_TOOLS=( |
421 |
+ /usr/bin/llvm-config |
422 |
+ ) |
423 |
+ |
424 |
+ local MULTILIB_WRAPPED_HEADERS=( |
425 |
+ /usr/include/llvm/Config/config.h |
426 |
+ /usr/include/llvm/Config/llvm-config.h |
427 |
+ ) |
428 |
+ |
429 |
+ if use clang; then |
430 |
+ # note: magic applied in multilib_src_install()! |
431 |
+ CLANG_VERSION=${PV%.*} |
432 |
+ |
433 |
+ MULTILIB_CHOST_TOOLS+=( |
434 |
+ /usr/bin/clang |
435 |
+ /usr/bin/clang++ |
436 |
+ /usr/bin/clang-cl |
437 |
+ /usr/bin/clang-${CLANG_VERSION} |
438 |
+ /usr/bin/clang++-${CLANG_VERSION} |
439 |
+ /usr/bin/clang-cl-${CLANG_VERSION} |
440 |
+ ) |
441 |
+ |
442 |
+ MULTILIB_WRAPPED_HEADERS+=( |
443 |
+ /usr/include/clang/Config/config.h |
444 |
+ ) |
445 |
+ fi |
446 |
+ |
447 |
+ multilib-minimal_src_install |
448 |
+} |
449 |
+ |
450 |
+multilib_src_install() { |
451 |
+ cmake-utils_src_install |
452 |
+ |
453 |
+ if multilib_is_native_abi; then |
454 |
+ # Install man pages. |
455 |
+ use doc || doman "${WORKDIR}"/${P}-manpages/*.1 |
456 |
+ |
457 |
+ # Symlink the gold plugin. |
458 |
+ if use gold; then |
459 |
+ dodir "/usr/${CHOST}/binutils-bin/lib/bfd-plugins" |
460 |
+ dosym "../../../../$(get_libdir)/LLVMgold.so" \ |
461 |
+ "/usr/${CHOST}/binutils-bin/lib/bfd-plugins/LLVMgold.so" |
462 |
+ fi |
463 |
+ fi |
464 |
+ |
465 |
+ # apply CHOST and CLANG_VERSION to clang executables |
466 |
+ # they're statically linked so we don't have to worry about the lib |
467 |
+ if use clang; then |
468 |
+ local clang_tools=( clang clang++ clang-cl ) |
469 |
+ local i |
470 |
+ |
471 |
+ # cmake gives us: |
472 |
+ # - clang-X.Y |
473 |
+ # - clang -> clang-X.Y |
474 |
+ # - clang++, clang-cl -> clang |
475 |
+ # we want to have: |
476 |
+ # - clang-X.Y |
477 |
+ # - clang++-X.Y, clang-cl-X.Y -> clang-X.Y |
478 |
+ # - clang, clang++, clang-cl -> clang*-X.Y |
479 |
+ # so we need to fix the two tools |
480 |
+ for i in "${clang_tools[@]:1}"; do |
481 |
+ rm "${ED%/}/usr/bin/${i}" || die |
482 |
+ dosym "clang-${CLANG_VERSION}" "/usr/bin/${i}-${CLANG_VERSION}" |
483 |
+ dosym "${i}-${CLANG_VERSION}" "/usr/bin/${i}" |
484 |
+ done |
485 |
+ |
486 |
+ # now prepend ${CHOST} and let the multilib-build.eclass symlink it |
487 |
+ if ! multilib_is_native_abi; then |
488 |
+ # non-native? let's replace it with a simple wrapper |
489 |
+ for i in "${clang_tools[@]}"; do |
490 |
+ rm "${ED%/}/usr/bin/${i}-${CLANG_VERSION}" || die |
491 |
+ cat > "${T}"/wrapper.tmp <<-_EOF_ |
492 |
+ #!${EPREFIX}/bin/sh |
493 |
+ exec "${i}-${CLANG_VERSION}" $(get_abi_CFLAGS) "\${@}" |
494 |
+ _EOF_ |
495 |
+ newbin "${T}"/wrapper.tmp "${i}-${CLANG_VERSION}" |
496 |
+ done |
497 |
+ fi |
498 |
+ fi |
499 |
+} |
500 |
+ |
501 |
+multilib_src_install_all() { |
502 |
+ insinto /usr/share/vim/vimfiles |
503 |
+ doins -r utils/vim/*/ |
504 |
+ # some users may find it useful |
505 |
+ dodoc utils/vim/vimrc |
506 |
+ |
507 |
+ if use clang; then |
508 |
+ pushd tools/clang >/dev/null || die |
509 |
+ |
510 |
+ if use static-analyzer ; then |
511 |
+ pushd tools/scan-build >/dev/null || die |
512 |
+ |
513 |
+ dobin ccc-analyzer scan-build |
514 |
+ dosym ccc-analyzer /usr/bin/c++-analyzer |
515 |
+ doman scan-build.1 |
516 |
+ |
517 |
+ insinto /usr/share/llvm |
518 |
+ doins scanview.css sorttable.js |
519 |
+ |
520 |
+ popd >/dev/null || die |
521 |
+ fi |
522 |
+ |
523 |
+ python_inst() { |
524 |
+ if use static-analyzer ; then |
525 |
+ pushd tools/scan-view >/dev/null || die |
526 |
+ |
527 |
+ python_doscript scan-view |
528 |
+ |
529 |
+ touch __init__.py || die |
530 |
+ python_moduleinto clang |
531 |
+ python_domodule *.py Resources |
532 |
+ |
533 |
+ popd >/dev/null || die |
534 |
+ fi |
535 |
+ |
536 |
+ if use python ; then |
537 |
+ pushd bindings/python/clang >/dev/null || die |
538 |
+ |
539 |
+ python_moduleinto clang |
540 |
+ python_domodule *.py |
541 |
+ |
542 |
+ popd >/dev/null || die |
543 |
+ fi |
544 |
+ |
545 |
+ # AddressSanitizer symbolizer (currently separate) |
546 |
+ python_doscript "${S}"/projects/compiler-rt/lib/asan/scripts/asan_symbolize.py |
547 |
+ } |
548 |
+ python_foreach_impl python_inst |
549 |
+ popd >/dev/null || die |
550 |
+ fi |
551 |
+} |
552 |
+ |
553 |
+pkg_postinst() { |
554 |
+ if use clang; then |
555 |
+ elog "To enable OpenMP support in clang, install sys-libs/libomp" |
556 |
+ elog "and use the '-fopenmp=libomp' command line option" |
557 |
+ fi |
558 |
+} |