Gentoo Archives: gentoo-commits

From: Georgy Yakovlev <gyakovlev@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/rust/
Date: Thu, 30 Jan 2020 19:24:55
Message-Id: 1580411819.23763766a0770178c7b599a353d06b2e060d8f95.gyakovlev@gentoo
1 commit: 23763766a0770178c7b599a353d06b2e060d8f95
2 Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
3 AuthorDate: Thu Jan 30 19:15:36 2020 +0000
4 Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
5 CommitDate: Thu Jan 30 19:16:59 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=23763766
7
8 dev-lang/rust: bump to 1.41.0
9
10 Package-Manager: Portage-2.3.84, Repoman-2.3.20
11 Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>
12
13 dev-lang/rust/Manifest | 15 ++
14 dev-lang/rust/rust-1.41.0.ebuild | 366 +++++++++++++++++++++++++++++++++++++++
15 2 files changed, 381 insertions(+)
16
17 diff --git a/dev-lang/rust/Manifest b/dev-lang/rust/Manifest
18 index bd0bf119a33..774662a8ad8 100644
19 --- a/dev-lang/rust/Manifest
20 +++ b/dev-lang/rust/Manifest
21 @@ -54,7 +54,22 @@ DIST rust-1.39.0-powerpc64le-unknown-linux-gnu.tar.xz 247026740 BLAKE2B 90269aa7
22 DIST rust-1.39.0-s390x-unknown-linux-gnu.tar.xz 298119784 BLAKE2B 82f64163929c129e2aaee8909401c4f302496f63f8d9d366d6f7460b4546d7657ea38bcd864ecd0f58a5995e47f7f5890e4523dcbcbc51e3bf4085536b07de5f SHA512 d2b588f802d4fbe153dbd88cb745d34d1f5434cb3134cc9e091ebfb336a48b4c886cd80311cf92b5e1c6a16374302853a67e8a0576b02a89dbcf61d27919a045
23 DIST rust-1.39.0-x86_64-unknown-linux-gnu.tar.xz 284967620 BLAKE2B c5d2c2a11c4f66105ece51e7ca45ca6a9e0d70215f94ce52f6e61b20995ceb611e45bad1e5e9f33fd444bb0a58a2edb691f1a65a1caf36ad892c034e00104383 SHA512 02ca6c821877379d8bd0bcc38281a87e6f86bdbae1270da19e41336cc3a812d9c11c1e976655c192c39153f92cda90ddbd7b4b0bcb4f6787d6d354d2be827a8a
24 DIST rust-1.39.0-x86_64-unknown-linux-musl.tar.xz 262751216 BLAKE2B f719f4168f3d463f5184b9f72990f2e43b99f75902f762f5736e819f47ad451a325cbc7b7140cb322b46b5dc51253ebb8aa2a16b0f792343dbfcab5a91ac95a4 SHA512 155458717aaaaa82b202fae180c094e5a40f45071c3a0f6d27423a612ffe926058642fc82aaa7ea091963108b7a819d6156294149648e5b0a5d5b6196028f4fb
25 +DIST rust-1.40.0-aarch64-unknown-linux-gnu.tar.xz 80285104 BLAKE2B 857a3148337833a216912b732c017827d0ee2869af41d114f3a743fbc8bd0ad851c4c42dca63cbcb8f15c816a8c45bd60049fb60ea80a85faec23000140acab6 SHA512 f601e4251e08a6d66edb0489b6ab840b57622b506547e81036e6dfe08eb71005a22a2777a0b8b2d07a6f88286d58f513482b863116311a6f43c7284769af6e7f
26 +DIST rust-1.40.0-arm-unknown-linux-gnueabi.tar.xz 82051152 BLAKE2B 33c62780b3f228298217f7a16e00348cf3c29c504f59de414a0e8a3c506c801d87f460a7bf6107bb7856249c5a5b8fad94499f7f059602b99252ef85dc5b973c SHA512 2098ff12393dd99004ce94f49d445dad03184a108ea8249b70e51abd44bd510f8a4ee43eba3b32967b1a543951e8eec5b06c85692312821b5c855c1d5f034e94
27 +DIST rust-1.40.0-arm-unknown-linux-gnueabihf.tar.xz 82518972 BLAKE2B 2861693efa9bbd54e09bd693886941ec13b09f1901d384f24534b2852f9cb3b59fa0eaac1ec16bc6df49437cf08a09eff6c649729b0b8c2b4d8def6d7111d229 SHA512 994a91704e65e126bf3d53aa5ccbf9f92f05495a68db1917754f8bf078f16b0255797c884b4f2c70033ae0c94d5f41ad73e1af2e963580ebf56c90a6bf76630a
28 +DIST rust-1.40.0-armv7-unknown-linux-gnueabihf.tar.xz 84254100 BLAKE2B 5ec75764435f5b906ed5ac84c6454a8fade0d71a9f9d2b3c799525ebf1e1a6e208e85dffe125e3de163d94a62693241a6ed59651955942edc8cdfad5c354a23d SHA512 d3345946c5a3d5cb3d7fca4d3200710704d64547ebfa4ab11c45ea1a18ca3c49b429783d499845f31dcb150abe2f6836fe203fd9d7aa53e0475b940da5549492
29 +DIST rust-1.40.0-i686-unknown-linux-gnu.tar.xz 122168896 BLAKE2B c89278bd7af7d167251c122297b4a8045da94951aaba5288a3a47b7d4f7af2af2e5ae672388f5c6192382e800151ad54cb2fc9a4fd66fde3acb8acb877aaa27b SHA512 d727149afbbc3b2709360dd6080ff301e781aaa94459c1348d3e35382bc9c7ad65c4d70f9bfc7b44ac92ddaf89e3aab92b75b9d184eba86916da25bd629592b6
30 +DIST rust-1.40.0-mips-unknown-linux-gnu.tar.xz 74305992 BLAKE2B cf51e3d843a32a3025232d1bc4374c55d3931d8b8634aed83f3f5e890081d7ed2a09d0aa3f026936d5e2f91fd26b56be704cf2975678db5fa23cf57c34277a89 SHA512 995b875dcbbd8472e3109504e695bf15eca812ea252e5ff1a615fb1c5dd3b66fe637fa4c30618b1584af4b641d4b4d5a4d7e1b6a09cb0ca4ff8fdd8a3488a255
31 +DIST rust-1.40.0-mips64-unknown-linux-gnuabi64.tar.xz 80925812 BLAKE2B a77123767639e93531fdf30af711a8dafd91c4143e7774edf88a9f513fd6fc928f3c96656ce4d0ede54677077c8eb383d5c37bee6881fd0796fe47257a16d753 SHA512 ebbb01c033c16dd9fe93ce0a532afa39b1459b056896c906f9e561285977e7c569e770c7e624e485cd8014008c9d496dae893921bbc1342c3e2b6520c9b84440
32 +DIST rust-1.40.0-mipsel-unknown-linux-gnu.tar.xz 76145484 BLAKE2B e06cfc8ac8d6124c4eb7c004c9e792c6ba21de5621d21456a7e47f1cd67f584d480708ddb098d882005953db818da27e396c9409c1e089d7db42844608ba1fe8 SHA512 4d4b52397574cfcbf8e79d71cbf783119b0096ed6d8b1f1a4c191336ac0e616b682342077f3451db477e0271a5ac453ee418314c071e8f922e790eb0e32ae768
33 +DIST rust-1.40.0-powerpc-unknown-linux-gnu.tar.xz 82846452 BLAKE2B e82e117b0592278b491399f27de4c26b518bf8f7cbb60125fc3ae36ddb033113324222ac7433ac9b02026efe4be477ec9967c55648121869a36ce833c3600afd SHA512 4d71bbf1b29f9ea649f444bafbaa8d6447026d992c264736b50365736c9e2129d28f23e09260aa21be10562727a5f6b298ddaf8f7598b4bad53d65cdd2f9e9f0
34 +DIST rust-1.40.0-powerpc64-unknown-linux-gnu.tar.xz 85231436 BLAKE2B b307d794e9e849d40a98116851950f76576b5ea6bb159c71830bb4210c40d5b6cc37d67d316d1b289735f83a29393699a49dd0c11cafe8191a64de6384ed69af SHA512 eae2e0ba3a6a9ba07945112c17962ca3c77737fa187759e674e78f626777da85a5ee6107168fe2866b5beb1ecf2e655652cb7d9b51867b247d76e174dfb103ce
35 +DIST rust-1.40.0-powerpc64le-unknown-linux-gnu.tar.xz 87972788 BLAKE2B ad1e460dbd7ee5dbe90bf84a68fbcdd89f3d7a1a898ccd94827327bbb2bfeafeb66d5c50651183e0d429f8d14a41e4e26b8f7cae2ff61b055eddcb2c0fa6aecd SHA512 8b82f3bacc503aa23cfa7a6cd6232e34b734becffbbe02df9f766878d526d24d7409d8c104f39fa791c0f7a8b3fa61f6b8a528e89e8ab94d6a131b2d0ac11f0f
36 +DIST rust-1.40.0-s390x-unknown-linux-gnu.tar.xz 95398844 BLAKE2B e897ac3e1f46a63c7ad14e0e5229b7028ac325256e084439bcad0ced631eb26d50ca72710c46e59accb0e3d0574d08a9c15455be59a8d78173387d35ddd3bed7 SHA512 e71d3a1d85975653b6d972a4854c9e53be7f2d093a601145261c97f7917f869399fbc6322a04f63b782a5a28b91c3be40041a8c77367d19dec8d0e857cbbef14
37 +DIST rust-1.40.0-x86_64-unknown-linux-gnu.tar.xz 110186516 BLAKE2B ad89d8cecbd565b23c98ec095bad218de971cb4bb89924bbcb012df6c9ecf0db2b50d624abdf6b050fe1f5067aea9311dc01852950a5ca5e993e99f913fc5dbc SHA512 11a2ad1d8b9e91cbe9ee6a1954d46ac75eeaa83f0c2425a8ad70d191727b02e86ead33d6464222effca6f5134c31a165801a854aa57bdb5f12944d605de3c1d1
38 +DIST rust-1.40.0-x86_64-unknown-linux-musl.tar.xz 96869284 BLAKE2B 61cdf2eab51455e377e079e7013959ee51358c9846f8442f81a3240062af573f452a0f5f007e63cbbcdd0db98ac22ab0d4f3006f6ef30327b609d303410cba8c SHA512 3e6d7cf7b24c09d13266e06f20ab317c5ffb68de3242719c71e95c3d778269c4076e06badfb488e8fc223b822246ebbeb888d4168ddf6e2401793e23e77810bb
39 DIST rustc-1.37.0-src.tar.xz 98654252 BLAKE2B ddee92c7959a0e1ee11ffe5ded6017703cfac7bbf2a00dc46c37ed28f1cd1d31e1d5b62cc1a5ae2d55d64f8705d0cb282f4968deddf36c3152e5e0cfdfbea67d SHA512 bfee43f578e6d44ead950b870b9fd31087e1bd3f917611f5dce7ad56504b83185edf43e297e8d1304e9e97b9a580d1e6adf6608ab8ed6dee0dc8c5153cdbc5d4
40 DIST rustc-1.38.0-src.tar.xz 96163304 BLAKE2B 1e900b44db64727477ccf8e58e0ebb9ec209bbeb349816b5f7937e58c165db8befae33c5667732e5aaaa677c5a6c1e0229d9969ab8967fda9b8d7a593e6c5eb6 SHA512 b756d29a7a222bc7b5c7f42ff397346ab840f78e559f93e6e36b65e76eea525cf429899fe4de9fb8966623a2225b552feef9fa831bee50f9e25c976fa2af8c0a
41 DIST rustc-1.39.0-src.tar.xz 96495140 BLAKE2B 6df6bf0c3b38c28753713acdc477ea6929740c32893171dd9b8620992439e45730ef6f9489a6fc411ff5884c661ac4c07b7b93f5a4174207ed53351d2dea09bf SHA512 8610b2ec77722087c572bd84ac562a5b7c5f1a644aea58c5d5daa07a9aed242703b7816e73e2eaa049f773d5907859e259744a0de700622df005584fd798dab0
42 DIST rustc-1.40.0-src.tar.xz 92306352 BLAKE2B 762b9592414e5c816540f6fd37d07b3b0ffe97a151968cc8ae77be2fda03a6d66905192985edc65055cc7811dbd90faa2b2c056481f72161c6f7ccbcce13671a SHA512 b5ac3079acefb62d3c985b77f624d7fb68de23a59396fed9ccb292db61641c064f3146ee54d3cf59067b17ebfaadd14a6b2b466def60316bb5b13ba3aef01e1f
43 +DIST rustc-1.41.0-src.tar.xz 93763052 BLAKE2B a68524fb6e3abb43d52ae6676a1e9de1c5d33606eaea6e93bb518f10b196d620f2f370c631c32e39a624af71a3bf6911662a9df7eecb8dde78a20c8054a349fc SHA512 0e30fe53b77860085bea0f1f60315eb835b00dd796c5d1b98ed44fe6fc27336dfb064908c86e1669a9cbe81c9ca1495e1c259a8a268bef23b23805a719cef0dd
44
45 diff --git a/dev-lang/rust/rust-1.41.0.ebuild b/dev-lang/rust/rust-1.41.0.ebuild
46 new file mode 100644
47 index 00000000000..98bd9b6b817
48 --- /dev/null
49 +++ b/dev-lang/rust/rust-1.41.0.ebuild
50 @@ -0,0 +1,366 @@
51 +# Copyright 1999-2020 Gentoo Authors
52 +# Distributed under the terms of the GNU General Public License v2
53 +
54 +EAPI=7
55 +
56 +PYTHON_COMPAT=( python2_7 python3_{6,7} )
57 +
58 +inherit bash-completion-r1 check-reqs estack flag-o-matic llvm multiprocessing multilib-build python-any-r1 rust-toolchain toolchain-funcs
59 +
60 +if [[ ${PV} = *beta* ]]; then
61 + betaver=${PV//*beta}
62 + BETA_SNAPSHOT="${betaver:0:4}-${betaver:4:2}-${betaver:6:2}"
63 + MY_P="rustc-beta"
64 + SLOT="beta/${PV}"
65 + SRC="${BETA_SNAPSHOT}/rustc-beta-src.tar.xz"
66 +else
67 + ABI_VER="$(ver_cut 1-2)"
68 + SLOT="stable/${ABI_VER}"
69 + MY_P="rustc-${PV}"
70 + SRC="${MY_P}-src.tar.xz"
71 + KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86"
72 +fi
73 +
74 +RUST_STAGE0_VERSION="1.$(($(ver_cut 2) - 1)).0"
75 +
76 +DESCRIPTION="Systems programming language from Mozilla"
77 +HOMEPAGE="https://www.rust-lang.org/"
78 +
79 +SRC_URI="
80 + https://static.rust-lang.org/dist/${SRC} -> rustc-${PV}-src.tar.xz
81 + !system-bootstrap? ( $(rust_all_arch_uris rust-${RUST_STAGE0_VERSION}) )
82 +"
83 +
84 +ALL_LLVM_TARGETS=( AArch64 AMDGPU ARM BPF Hexagon Lanai Mips MSP430
85 + NVPTX PowerPC RISCV Sparc SystemZ WebAssembly X86 XCore )
86 +ALL_LLVM_TARGETS=( "${ALL_LLVM_TARGETS[@]/#/llvm_targets_}" )
87 +LLVM_TARGET_USEDEPS=${ALL_LLVM_TARGETS[@]/%/?}
88 +
89 +LICENSE="|| ( MIT Apache-2.0 ) BSD-1 BSD-2 BSD-4 UoI-NCSA"
90 +
91 +IUSE="clippy cpu_flags_x86_sse2 debug doc libressl nightly parallel-compiler rls rustfmt system-bootstrap system-llvm wasm ${ALL_LLVM_TARGETS[*]}"
92 +
93 +# Please keep the LLVM dependency block separate. Since LLVM is slotted,
94 +# we need to *really* make sure we're not pulling more than one slot
95 +# simultaneously.
96 +
97 +# How to use it:
98 +# 1. List all the working slots (with min versions) in ||, newest first.
99 +# 2. Update the := to specify *max* version, e.g. < 10.
100 +# 3. Specify LLVM_MAX_SLOT, e.g. 9.
101 +LLVM_DEPEND="
102 + || (
103 + sys-devel/llvm:9[llvm_targets_WebAssembly?]
104 + wasm? ( =sys-devel/lld-9* )
105 + )
106 + <sys-devel/llvm-10:=
107 +"
108 +LLVM_MAX_SLOT=9
109 +
110 +BOOTSTRAP_DEPEND="|| ( >=dev-lang/rust-1.$(($(ver_cut 2) - 1)).0-r1 >=dev-lang/rust-bin-1.$(($(ver_cut 2) - 1)) )"
111 +
112 +COMMON_DEPEND="
113 + sys-libs/zlib
114 + !libressl? ( dev-libs/openssl:0= )
115 + libressl? ( dev-libs/libressl:0= )
116 + net-libs/libssh2
117 + net-libs/http-parser:=
118 + net-misc/curl[ssl]
119 + elibc_musl? ( sys-libs/libunwind )
120 + system-llvm? (
121 + ${LLVM_DEPEND}
122 + )
123 +"
124 +
125 +DEPEND="${COMMON_DEPEND}
126 + ${PYTHON_DEPS}
127 + || (
128 + >=sys-devel/gcc-4.7
129 + >=sys-devel/clang-3.5
130 + )
131 + system-bootstrap? ( ${BOOTSTRAP_DEPEND} )
132 + system-llvm? (
133 + dev-util/cmake
134 + dev-util/ninja
135 + )
136 +"
137 +
138 +RDEPEND="${COMMON_DEPEND}
139 + >=app-eselect/eselect-rust-20190311
140 +"
141 +
142 +REQUIRED_USE="|| ( ${ALL_LLVM_TARGETS[*]} )
143 + parallel-compiler? ( nightly )
144 + wasm? ( llvm_targets_WebAssembly )
145 + x86? ( cpu_flags_x86_sse2 )
146 +"
147 +
148 +QA_FLAGS_IGNORED="
149 + usr/bin/*-${PV}
150 + usr/lib*/lib*.so
151 + usr/lib/rustlib/*/codegen-backends/librustc_codegen_llvm-llvm.so
152 + usr/lib/rustlib/*/lib/lib*.so
153 +"
154 +
155 +QA_SONAME="usr/lib.*/librustc_macros.*.so"
156 +
157 +PATCHES=(
158 + "${FILESDIR}"/1.40.0-add-soname.patch
159 +)
160 +
161 +S="${WORKDIR}/${MY_P}-src"
162 +
163 +toml_usex() {
164 + usex "$1" true false
165 +}
166 +
167 +pre_build_checks() {
168 + CHECKREQS_DISK_BUILD="10G"
169 + eshopts_push -s extglob
170 + if is-flagq '-g?(gdb)?([1-9])'; then
171 + CHECKREQS_DISK_BUILD="15G"
172 + fi
173 + eshopts_pop
174 + check-reqs_pkg_setup
175 +}
176 +
177 +pkg_pretend() {
178 + pre_build_checks
179 +}
180 +
181 +pkg_setup() {
182 + pre_build_checks
183 + python-any-r1_pkg_setup
184 +
185 + export LIBGIT2_SYS_USE_PKG_CONFIG=1
186 + export LIBSSH2_SYS_USE_PKG_CONFIG=1
187 + export PKG_CONFIG_ALLOW_CROSS=1
188 +
189 + if use system-llvm; then
190 + llvm_pkg_setup
191 +
192 + local llvm_config="$(get_llvm_prefix "$LLVM_MAX_SLOT")/bin/llvm-config"
193 +
194 + export LLVM_LINK_SHARED=1
195 + export RUSTFLAGS="${RUSTFLAGS} -Lnative=$("${llvm_config}" --libdir)"
196 + fi
197 +}
198 +
199 +src_prepare() {
200 + if ! use system-bootstrap; then
201 + local rust_stage0_root="${WORKDIR}"/rust-stage0
202 + local rust_stage0="rust-${RUST_STAGE0_VERSION}-$(rust_abi)"
203 +
204 + "${WORKDIR}/${rust_stage0}"/install.sh --disable-ldconfig \
205 + --destdir="${rust_stage0_root}" --prefix=/ || die
206 + fi
207 +
208 + default
209 +}
210 +
211 +src_configure() {
212 + local rust_target="" rust_targets="" arch_cflags
213 +
214 + # Collect rust target names to compile standard libs for all ABIs.
215 + for v in $(multilib_get_enabled_abi_pairs); do
216 + rust_targets="${rust_targets},\"$(rust_abi $(get_abi_CHOST ${v##*.}))\""
217 + done
218 + if use wasm; then
219 + rust_targets="${rust_targets},\"wasm32-unknown-unknown\""
220 + fi
221 + rust_targets="${rust_targets#,}"
222 +
223 + local extended="true" tools="\"cargo\","
224 + if use clippy; then
225 + tools="\"clippy\",$tools"
226 + fi
227 + if use rls; then
228 + tools="\"rls\",\"analysis\",\"src\",$tools"
229 + fi
230 + if use rustfmt; then
231 + tools="\"rustfmt\",$tools"
232 + fi
233 +
234 + local rust_stage0_root
235 + if use system-bootstrap; then
236 + rust_stage0_root="$(rustc --print sysroot)"
237 + else
238 + rust_stage0_root="${WORKDIR}"/rust-stage0
239 + fi
240 +
241 + rust_target="$(rust_abi)"
242 +
243 + cat <<- EOF > "${S}"/config.toml
244 + [llvm]
245 + optimize = $(toml_usex !debug)
246 + release-debuginfo = $(toml_usex debug)
247 + assertions = $(toml_usex debug)
248 + targets = "${LLVM_TARGETS// /;}"
249 + experimental-targets = ""
250 + link-shared = $(toml_usex system-llvm)
251 + [build]
252 + build = "${rust_target}"
253 + host = ["${rust_target}"]
254 + target = [${rust_targets}]
255 + cargo = "${rust_stage0_root}/bin/cargo"
256 + rustc = "${rust_stage0_root}/bin/rustc"
257 + docs = $(toml_usex doc)
258 + compiler-docs = $(toml_usex doc)
259 + submodules = false
260 + python = "${EPYTHON}"
261 + locked-deps = true
262 + vendor = true
263 + extended = ${extended}
264 + tools = [${tools}]
265 + verbose = 2
266 + [install]
267 + prefix = "${EPREFIX}/usr"
268 + libdir = "lib"
269 + docdir = "share/doc/${PF}"
270 + mandir = "share/man"
271 + [rust]
272 + optimize = $(toml_usex !debug)
273 + debug = $(toml_usex debug)
274 + debug-assertions = $(toml_usex debug)
275 + default-linker = "$(tc-getCC)"
276 + parallel-compiler = $(toml_usex parallel-compiler)
277 + channel = "$(usex nightly nightly stable)"
278 + rpath = false
279 + lld = $(usex system-llvm false $(toml_usex wasm))
280 + [dist]
281 + src-tarball = false
282 + EOF
283 +
284 + for v in $(multilib_get_enabled_abi_pairs); do
285 + rust_target=$(rust_abi $(get_abi_CHOST ${v##*.}))
286 + arch_cflags="$(get_abi_CFLAGS ${v##*.})"
287 +
288 + cat <<- EOF >> "${S}"/config.env
289 + CFLAGS_${rust_target}=${arch_cflags}
290 + EOF
291 +
292 + cat <<- EOF >> "${S}"/config.toml
293 + [target.${rust_target}]
294 + cc = "$(tc-getBUILD_CC)"
295 + cxx = "$(tc-getBUILD_CXX)"
296 + linker = "$(tc-getCC)"
297 + ar = "$(tc-getAR)"
298 + EOF
299 + # librustc_target/spec/linux_musl_base.rs sets base.crt_static_default = true;
300 + if use elibc_musl; then
301 + cat <<- EOF >> "${S}"/config.toml
302 + crt-static = false
303 + EOF
304 + fi
305 + if use system-llvm; then
306 + cat <<- EOF >> "${S}"/config.toml
307 + llvm-config = "$(get_llvm_prefix "${LLVM_MAX_SLOT}")/bin/llvm-config"
308 + EOF
309 + fi
310 + done
311 +
312 + if use wasm; then
313 + cat <<- EOF >> "${S}"/config.toml
314 + [target.wasm32-unknown-unknown]
315 + linker = "$(usex system-llvm lld rust-lld)"
316 + EOF
317 + fi
318 +}
319 +
320 +src_compile() {
321 + env $(cat "${S}"/config.env)\
322 + "${EPYTHON}" ./x.py build -vv --config="${S}"/config.toml -j$(makeopts_jobs) \
323 + --exclude src/tools/miri || die # https://github.com/rust-lang/rust/issues/52305
324 +}
325 +
326 +src_install() {
327 + env DESTDIR="${D}" "${EPYTHON}" ./x.py install -vv --config="${S}"/config.toml \
328 + --exclude src/tools/miri || die
329 +
330 + # bug #689562, #689160
331 + rm "${D}/etc/bash_completion.d/cargo" || die
332 + rmdir "${D}"/etc{/bash_completion.d,} || die
333 + dobashcomp build/tmp/dist/cargo-image/etc/bash_completion.d/cargo
334 +
335 + mv "${ED}/usr/bin/rustc" "${ED}/usr/bin/rustc-${PV}" || die
336 + mv "${ED}/usr/bin/rustdoc" "${ED}/usr/bin/rustdoc-${PV}" || die
337 + mv "${ED}/usr/bin/rust-gdb" "${ED}/usr/bin/rust-gdb-${PV}" || die
338 + mv "${ED}/usr/bin/rust-gdbgui" "${ED}/usr/bin/rust-gdbgui-${PV}" || die
339 + mv "${ED}/usr/bin/rust-lldb" "${ED}/usr/bin/rust-lldb-${PV}" || die
340 + mv "${ED}/usr/bin/cargo" "${ED}/usr/bin/cargo-${PV}" || die
341 + if use clippy; then
342 + mv "${ED}/usr/bin/clippy-driver" "${ED}/usr/bin/clippy-driver-${PV}" || die
343 + mv "${ED}/usr/bin/cargo-clippy" "${ED}/usr/bin/cargo-clippy-${PV}" || die
344 + fi
345 + if use rls; then
346 + mv "${ED}/usr/bin/rls" "${ED}/usr/bin/rls-${PV}" || die
347 + fi
348 + if use rustfmt; then
349 + mv "${ED}/usr/bin/rustfmt" "${ED}/usr/bin/rustfmt-${PV}" || die
350 + mv "${ED}/usr/bin/cargo-fmt" "${ED}/usr/bin/cargo-fmt-${PV}" || die
351 + fi
352 +
353 + # Move public shared libs to abi specific libdir
354 + # Private and target specific libs MUST stay in /usr/lib/rustlib/${rust_target}/lib
355 + if [[ $(get_libdir) != lib ]]; then
356 + dodir /usr/$(get_libdir)
357 + mv "${ED}/usr/lib"/*.so "${ED}/usr/$(get_libdir)/" || die
358 + fi
359 +
360 + dodoc COPYRIGHT
361 +
362 + # note: eselect-rust adds EROOT to all paths below
363 + cat <<-EOF > "${T}/provider-${P}"
364 + /usr/bin/rustdoc
365 + /usr/bin/rust-gdb
366 + /usr/bin/rust-gdbgui
367 + /usr/bin/rust-lldb
368 + EOF
369 + echo /usr/bin/cargo >> "${T}/provider-${P}"
370 + if use clippy; then
371 + echo /usr/bin/clippy-driver >> "${T}/provider-${P}"
372 + echo /usr/bin/cargo-clippy >> "${T}/provider-${P}"
373 + fi
374 + if use rls; then
375 + echo /usr/bin/rls >> "${T}/provider-${P}"
376 + fi
377 + if use rustfmt; then
378 + echo /usr/bin/rustfmt >> "${T}/provider-${P}"
379 + echo /usr/bin/cargo-fmt >> "${T}/provider-${P}"
380 + fi
381 + dodir /etc/env.d/rust
382 + insinto /etc/env.d/rust
383 + doins "${T}/provider-${P}"
384 +}
385 +
386 +pkg_postinst() {
387 + eselect rust update --if-unset
388 +
389 + elog "Rust installs a helper script for calling GDB and LLDB,"
390 + elog "for your convenience it is installed under /usr/bin/rust-{gdb,lldb}-${PV}."
391 +
392 + ewarn "cargo is now installed from dev-lang/rust{,-bin} instead of dev-util/cargo."
393 + ewarn "This might have resulted in a dangling symlink for /usr/bin/cargo on some"
394 + ewarn "systems. This can be resolved by calling 'sudo eselect rust set ${P}'."
395 +
396 + if has_version app-editors/emacs; then
397 + elog "install app-emacs/rust-mode to get emacs support for rust."
398 + fi
399 +
400 + if has_version app-editors/gvim || has_version app-editors/vim; then
401 + elog "install app-vim/rust-vim to get vim support for rust."
402 + fi
403 +
404 + if use elibc_musl; then
405 + ewarn "${PN} on *-musl targets is configured with crt-static"
406 + ewarn ""
407 + ewarn "you will need to set RUSTFLAGS=\"-C target-feature=-crt-static\" in make.conf"
408 + ewarn "to use it with portage, otherwise you may see failures like"
409 + ewarn "error: cannot produce proc-macro for serde_derive v1.0.98 as the target "
410 + ewarn "x86_64-unknown-linux-musl does not support these crate types"
411 + fi
412 +}
413 +
414 +pkg_postrm() {
415 + eselect rust cleanup
416 +}