Gentoo Archives: gentoo-commits

From: Dirkjan Ochtman <djc@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/rust/
Date: Thu, 15 Nov 2018 09:29:25
Message-Id: 1542274065.3a5b9598e49664cf3b11fb276adae40093c40d9e.djc@gentoo
1 commit: 3a5b9598e49664cf3b11fb276adae40093c40d9e
2 Author: Dirkjan Ochtman <djc <AT> gentoo <DOT> org>
3 AuthorDate: Thu Nov 15 09:27:27 2018 +0000
4 Commit: Dirkjan Ochtman <djc <AT> gentoo <DOT> org>
5 CommitDate: Thu Nov 15 09:27:45 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3a5b9598
7
8 dev-lang/rust: fix inconsistency, optionally use system LLVM
9
10 Fixes: https://bugs.gentoo.org/663240
11 Signed-off-by: Dirkjan Ochtman <djc <AT> gentoo.org>
12 Package-Manager: Portage-2.3.51, Repoman-2.3.11
13
14 dev-lang/rust/metadata.xml | 1 +
15 dev-lang/rust/rust-1.30.1-r1.ebuild | 22 ++++++++++++++--------
16 2 files changed, 15 insertions(+), 8 deletions(-)
17
18 diff --git a/dev-lang/rust/metadata.xml b/dev-lang/rust/metadata.xml
19 index c6a534bebad..cd1133751de 100644
20 --- a/dev-lang/rust/metadata.xml
21 +++ b/dev-lang/rust/metadata.xml
22 @@ -8,6 +8,7 @@
23 <use>
24 <flag name="cargo">Install cargo component</flag>
25 <flag name="clippy">Install clippy component</flag>
26 + <flag name="system-llvm">Use the system LLVM install</flag>
27 <flag name="rls">Install rls component</flag>
28 <flag name="rustfmt">Install rustfmt component</flag>
29 <flag name="wasm">Build support for the wasm32-unknown-unknown
30
31 diff --git a/dev-lang/rust/rust-1.30.1-r1.ebuild b/dev-lang/rust/rust-1.30.1-r1.ebuild
32 index 17118cfdb50..39efcc08a62 100644
33 --- a/dev-lang/rust/rust-1.30.1-r1.ebuild
34 +++ b/dev-lang/rust/rust-1.30.1-r1.ebuild
35 @@ -5,7 +5,7 @@ EAPI=6
36
37 PYTHON_COMPAT=( python2_7 python3_{5,6} pypy )
38
39 -inherit eapi7-ver multiprocessing multilib-build python-any-r1 rust-toolchain toolchain-funcs
40 +inherit eapi7-ver llvm multiprocessing multilib-build python-any-r1 rust-toolchain toolchain-funcs
41
42 if [[ ${PV} = *beta* ]]; then
43 betaver=${PV//*beta}
44 @@ -36,7 +36,7 @@ LLVM_TARGET_USEDEPS=${ALL_LLVM_TARGETS[@]/%/?}
45
46 LICENSE="|| ( MIT Apache-2.0 ) BSD-1 BSD-2 BSD-4 UoI-NCSA"
47
48 -IUSE="clippy cpu_flags_x86_sse2 debug doc +jemalloc libressl rls rustfmt wasm ${ALL_LLVM_TARGETS[*]}"
49 +IUSE="clippy cpu_flags_x86_sse2 debug doc +jemalloc libressl rls rustfmt system-llvm wasm ${ALL_LLVM_TARGETS[*]}"
50
51 COMMON_DEPEND=">=app-eselect/eselect-rust-0.3_pre20150425
52 jemalloc? ( dev-libs/jemalloc )
53 @@ -45,7 +45,8 @@ COMMON_DEPEND=">=app-eselect/eselect-rust-0.3_pre20150425
54 libressl? ( dev-libs/libressl:0= )
55 net-libs/libssh2
56 net-libs/http-parser:=
57 - net-misc/curl[ssl]"
58 + net-misc/curl[ssl]
59 + system-llvm? ( >=sys-devel/llvm-6:= )"
60 DEPEND="${COMMON_DEPEND}
61 ${PYTHON_DEPS}
62 || (
63 @@ -78,7 +79,7 @@ src_prepare() {
64 }
65
66 src_configure() {
67 - local rust_target="" rust_targets="" rust_target_name arch_cflags
68 + local rust_target="" rust_targets="" arch_cflags
69
70 # Collect rust target names to compile standard libs for all ABIs.
71 for v in $(multilib_get_enabled_abi_pairs); do
72 @@ -110,6 +111,7 @@ src_configure() {
73 release-debuginfo = $(toml_usex debug)
74 assertions = $(toml_usex debug)
75 targets = "${LLVM_TARGETS// /;}"
76 + link-shared = $(toml_usex system-llvm)
77 [build]
78 build = "${rust_target}"
79 host = ["${rust_target}"]
80 @@ -140,7 +142,7 @@ src_configure() {
81 EOF
82
83 for v in $(multilib_get_enabled_abi_pairs); do
84 - rust_target=$(get_abi_CHOST ${v##*.})
85 + rust_target=$(rust_abi $(get_abi_CHOST ${v##*.}))
86 arch_cflags="$(get_abi_CFLAGS ${v##*.})"
87
88 cat <<- EOF >> "${S}"/config.env
89 @@ -154,6 +156,11 @@ src_configure() {
90 linker = "$(tc-getCC)"
91 ar = "$(tc-getAR)"
92 EOF
93 + if use system-llvm; then
94 + cat <<- EOF >> "${S}"/config.toml
95 + llvm-config = "$(get_llvm_prefix)/bin/llvm-config"
96 + EOF
97 + fi
98 done
99
100 if use wasm; then
101 @@ -200,10 +207,9 @@ src_install() {
102 continue
103 fi
104 abi_libdir=$(get_abi_LIBDIR ${v##*.})
105 - rust_target=$(get_abi_CHOST ${v##*.})
106 - rust_abi=$(rust_abi $rust_target)
107 + rust_target=$(rust_abi $(get_abi_CHOST ${v##*.}))
108 mkdir -p "${D}/usr/${abi_libdir}"
109 - cp "${D}/usr/$(get_libdir)/${P}/rustlib/${rust_abi}/lib"/*.so \
110 + cp "${D}/usr/$(get_libdir)/${P}/rustlib/${rust_target}/lib"/*.so \
111 "${D}/usr/${abi_libdir}" || die
112 done