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: Fri, 12 Apr 2019 04:08:09
Message-Id: 1555042046.85332176a874ee27573ae99d409fbdbd68c52fc5.gyakovlev@gentoo
1 commit: 85332176a874ee27573ae99d409fbdbd68c52fc5
2 Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
3 AuthorDate: Thu Apr 11 19:17:46 2019 +0000
4 Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
5 CommitDate: Fri Apr 12 04:07:26 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=85332176
7
8 dev-lang/rust: bump to 1.34.0
9
10 Package-Manager: Portage-2.3.62, Repoman-2.3.12
11 Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>
12
13 dev-lang/rust/Manifest | 14 ++
14 dev-lang/rust/rust-1.34.0.ebuild | 320 +++++++++++++++++++++++++++++++++++++++
15 2 files changed, 334 insertions(+)
16
17 diff --git a/dev-lang/rust/Manifest b/dev-lang/rust/Manifest
18 index dfb3caadbeb..c396c1c5962 100644
19 --- a/dev-lang/rust/Manifest
20 +++ b/dev-lang/rust/Manifest
21 @@ -63,9 +63,23 @@ DIST rust-1.32.0-powerpc64-unknown-linux-gnu.tar.xz 120518816 BLAKE2B 9666c809b8
22 DIST rust-1.32.0-powerpc64le-unknown-linux-gnu.tar.xz 124278796 BLAKE2B cee79918a210c34918cf183c918099cd2c246d881576f80e960492c7d5ae1920a43f2d4424700543a7cf50cc5f18618b6d4abfac1e856c9e8711fb73429571b7 SHA512 058c1ebe58bb22e8ff791a74edb058e7494e2673dd1d91ffad646ec71cfdc240e934b44fbae6e58639143b33161d314224e7d1c7b2cc35677bf9eab901e130eb
23 DIST rust-1.32.0-s390x-unknown-linux-gnu.tar.xz 128857448 BLAKE2B ab0ce58315d116a0aaed007d03df7be4ecfeee01fd6e368173e8aa023b2ae1d922824e92b103aaf205ed2adf1f9da78abd229fff313c24e32ea3fad68f8bdda3 SHA512 4f32934472356d9b7e15abb0fa07be9eddccc7b9e0a1834bbee5ff279c6ece9174d942e2feed611f9b697613ee3b76f8a8ab68559b6d075e740aeab117223325
24 DIST rust-1.32.0-x86_64-unknown-linux-gnu.tar.xz 147868652 BLAKE2B 616e69d80dd0e7de2ac86f2090825c8a991ad1b88155d21d0eef89b7aea418ba8bb0140eeb497c417c77afc770f51498020ee86cfd059533500c0cb88f0130b6 SHA512 5c5def0c415b0f34e1e7476841a0bd3f91fe4bde8321c7b06b1cd2a3d10a3d676ed16a26561929ce39c3c2cbcf7a16960c5decca9e385afe8295da32b4fb7a17
25 +DIST rust-1.33.0-aarch64-unknown-linux-gnu.tar.xz 121877852 BLAKE2B accab68c374afe3eafa38e7ad33c32c427db8d0caab722461075c679af2406d991453a8e529a013b99a5841ef9a5e047cdc9ca88dbebab0c904f4afd99c2b851 SHA512 51f6ca909411fd3b3c05baedc38be8a29923966e7cd6960a10152886687132d4ef9750140c5121b9486d6f6ee1ed7ff35f8105c9f0731fe98ce750d0ea9c528f
26 +DIST rust-1.33.0-arm-unknown-linux-gnueabi.tar.xz 122944304 BLAKE2B c9c29d9409d5829029ffc444c890c0bba0ea213c0a4eb169e65447b6183b0693ab26d48db2fb0be5a325f6ebb7588f90e18b8377f46276d519fcdf5a637ddae7 SHA512 7911dd32cb415d69c05041f450540312d6a78efea36646b4d409a01a0809d94c2eb6a20bfc27772f50cfa0cfed076c3cf5ce62509820819111226f6974f05844
27 +DIST rust-1.33.0-arm-unknown-linux-gnueabihf.tar.xz 123280648 BLAKE2B be19b75623995c0f986d56318887685e70b682caa735adeac259a3f4b67f56537dc43a2a5d696db66547cb523227498c9fcc4213b28df12e5d26999f3caaa7ee SHA512 a0850de543cd11efab4d67bde498e5897f66bbffa1671c4bb6d31fc709dc0869e322e18982dffd199ad6ff7cee282475b04a563fd11a4c7df86f872b02fcce93
28 +DIST rust-1.33.0-armv7-unknown-linux-gnueabihf.tar.xz 125019964 BLAKE2B d5d25099719e4ba9bedeb1de89ec3ecb53cbf9d5540de83f723250f5c0130d0a8a7e7a1956cf1581fd709a806b7d42a55dcc94cf9d5e164cd0638a84f65f2f37 SHA512 25a16c576d826115fdac5a55b89bf3372dfb39c563f2ce7d39b0a7a3c9bdc43eaf10974dfa42e26c5aa04aee169ced3e797fa46fa82bd9f4ceddeddaf6687659
29 +DIST rust-1.33.0-i686-unknown-linux-gnu.tar.xz 168000488 BLAKE2B 62ee1355ddcc09723bd604faba92a602da68768ab741820905b473ff590e1bc7a2bd755db129d04efe9820326bfeb1b5ff54de37188e6b58ef45ec4144c05ada SHA512 f61f97c529232fd6d7587bbf34c41dd9cc334272b1d523464d7b964aba5a102edaff8d387445e3fdb2b9587c1cdd870e97b9572c9421e79ee047479443f1896d
30 +DIST rust-1.33.0-mips-unknown-linux-gnu.tar.xz 115251736 BLAKE2B 6785896dd969c52c49edb265d2883d48debb0bed77aecbec0a913ec0d7751d747d9a3d5db2b8fdbdec9a9f598bf13a2870987740f79a75042a030d549cb1d7a0 SHA512 17c76e83a6be9813b842909177dbab89abc2ffa4b97c32a45d8e9c0cb69311570d3797932d49b8c26522c812cb9fc86d00a3787a9a413d57140349d75dfd266a
31 +DIST rust-1.33.0-mips64-unknown-linux-gnuabi64.tar.xz 123408336 BLAKE2B f45ed3ab2c899bbdfbdbd3f50f3db1aaeb0fab32f1693cd432132d6e5713cbea63876d7e506eba8c25f5f28a946b524438837c9342f7b7cdf446910698136a34 SHA512 40998fe7ea3f40bb39d7a6d2dc16043aaaf0cbd2cda912b6deeb42fe02da480d4a218810610fc6e31686ab89db1da0cddb6b2599e98c3ba6856fef7c0d64bae7
32 +DIST rust-1.33.0-mipsel-unknown-linux-gnu.tar.xz 117489676 BLAKE2B b35648ede3694707cea887c0856e016ac98c53c8099202c30e819805564fcfa3d43410980980b8b9c977b4cbf97e185a4049311cda67e0dd5443136c6fe43ae0 SHA512 957a16738b3fc37b916593cb2e5a2d503da08bfe9517f3537483fa48781073e9f54eb14f8f9afc3d2e85fcd45ee0eb3fce1dc2680b5667e67520af363eeeb134
33 +DIST rust-1.33.0-powerpc-unknown-linux-gnu.tar.xz 117067768 BLAKE2B a968d0eaa52edaa3b5f99d11b34b9f24930a1639277a92d5d68cf80007b8f026daabd07c5379fd18a82c904939172a677be6a0baa9c73785b1ee19d7d04fa66a SHA512 8129b248ea55e427d29d8a637081d1744c08368178ca55c5367c485959984d41d093044ced29825194287a5bda3d491148f36c4c16d6efac797bb8c3af9800e7
34 +DIST rust-1.33.0-powerpc64-unknown-linux-gnu.tar.xz 126030216 BLAKE2B b1d1b996b833ebf8e8fb29d1395192a4354cac4d5381a3ac4f7b8338a19b3b49e5bd318268ee6cd075fa7b69d539e8d2dc021eddfda794791cb1a154b7d2b7e8 SHA512 7d53501d20119ba8d9723650800cdbde17e4ed1719f6258c48c25113082e0400d9ac74ca1bfca54722dbb2049f7b5d34177bb613031c1611daa2545e1706c745
35 +DIST rust-1.33.0-powerpc64le-unknown-linux-gnu.tar.xz 130922680 BLAKE2B db63d859631703e845efac57074e0f33f80a3b52b2e9dc8707b81892eee8fc922fa5a7d4b7b1f45fb5f19ea4d7f6fde9212f1c6e99e7e4c30dbc02aa87b0df7e SHA512 393c808e93792cf2b126d6111834932a55cbf18339942ac0d20fc4a3692b0ac08c21a3c8fd393795f7aafecac5a2c5d7c9415c18017a7453f759f746045f5144
36 +DIST rust-1.33.0-s390x-unknown-linux-gnu.tar.xz 134441220 BLAKE2B e6f0a6e54e4e1fde10f54f66615d44442b7cb5eb5bda43d55ee791328c7ecd61505b3d84719df82b7c5c7ae473b7041512f2cf346281518d7d78d0e22112fa05 SHA512 755a0203e2c143386cb3729faada4d2c38b254dfa7e6eeb722ec9847d6319a1d3d289c7b77a2bc478d79dbbabfcd826d8b015acd29fbdf5acb591feae1876205
37 +DIST rust-1.33.0-x86_64-unknown-linux-gnu.tar.xz 155298128 BLAKE2B af5bc628bc054bd354d5af78e53cd2ffbfbdf2c2d3a3e58eeb593f148c54024fa5905aa53a69c514d6d41e48688697e1ce8adb866817c77cdf541399f6e7956f SHA512 b7f3087f34e99517cd729f5ff1f8cce3f3254cb36c734d5b90d878293e4406934c2f597bf7e2941e9257046f62c9274eb4769a64dabfbc5f0bbf2a1703f7fef8
38 DIST rustc-1.29.1-src.tar.xz 61937676 BLAKE2B 6a60249538e1ec62471f4d0e3fc31c0a648433aa6f85ca7341657ea07772e338eb92a629941685808f4b80e84cb025d78aee9d0d6fa71c6635a1647c61bca9bc SHA512 1ded651b4c460e11e5e44c26de88a80fb13c2000097de2ee1e5af89638e12a7e8f43dd756689d4cc4fad45c52d4d43a3c70dd6a3ae550735b9dad5f8defea6a7
39 DIST rustc-1.29.2-src.tar.xz 61888912 BLAKE2B f59b0bf45caa6f6136f92ffbaa612bbc6a340c8694ec69d75aadace9180c36753f985641915524388b52cc108f8f5b71840ee3a6c0b1fcff6decb61d2d8a161e SHA512 d8fa9501764348ace8f60f2069bcd016925abe56c8bbc2b87fb52ff796e4bc7284c1fccbb1671416437bb82fde7d9240eeae875d6099914e27e75cfe050e2d38
40 DIST rustc-1.30.1-src.tar.xz 96086232 BLAKE2B 170767b64efe670086e7c4e73838b489a155a72c703148f83cad29d401a825a94a1def3aa462ba527e1bd08181c7a9be0e404c25f012906541c3d739eb57e9e5 SHA512 e466db81b9a82239670c48b876dc7390fcdda28c6390308691ddf2e0c12a39b57bd5ddb18322d1b4cd58165f69a666c7d83bee6573049da3b94e401657459bf5
41 DIST rustc-1.31.1-src.tar.xz 96915864 BLAKE2B bedfe1d56e2f99bb43b4b652d540aedf0a86c47b8493f28fb29e5af3135ff469ed40775bc2ee25ac5bd28a264ecba0094d7c9b6aae25ea365ed3e6f354ffa40b SHA512 d6688711452295c41468af214f036499074d82fbeedc3f03560275219c2fae910e623e38e3210176d86f78ba5533ea098da5ff21532c8ad1a5aac132bb74ee02
42 DIST rustc-1.32.0-src.tar.xz 99602696 BLAKE2B ab26247e3ecb75dbe373254c1c49f46c00a5a4db2b9cedffccb30122ea3b7de2761d6995b5423d0105caf85cc9542b4c21d487385faa34c835398c3320ccbd3b SHA512 487c405fed6430f62d2d0c38b65f6223b1c5074c7a0d3734dc8b3bb72fca255f5727e49541749569713a0c3e9a67eff574ba5698e8dceca6f0ef20b50f99aa42
43 DIST rustc-1.33.0-src.tar.xz 100635400 BLAKE2B 1fe8ffcfab8324a93a07b9b9ac9cd050fd9d660fb24884761e8ce5e5a67ce5b6df8513e1440090b39c3ced9cb5ced43f07cc9b0337d39625d2cf4aa9e083cfef SHA512 3291e4e19f75f44c81e6fcf4c01edc7c9d326eca43722381231abcf2e99f4314059ba59a29b79f5511ad9421c358c45e8fe18584d6954d17fe2aabad0f9d9147
44 +DIST rustc-1.34.0-src.tar.xz 95055768 BLAKE2B 5df848369e8087ac10c57d9818e644e51be1d4a89e68341a2a49a09f0902c153ba5fab2d82e4178742b3ac4205249347950d0685259f6b1fe0761ec4daf87518 SHA512 cf9952cafe42987f84a6fe9e351a401f2db35c33ddc87d2efb762c4c33a643ffe516f00d848a1ae759f48cea1504243b6169c29ab28ba2e6b00a51422c745861
45
46 diff --git a/dev-lang/rust/rust-1.34.0.ebuild b/dev-lang/rust/rust-1.34.0.ebuild
47 new file mode 100644
48 index 00000000000..93f20ba1ce3
49 --- /dev/null
50 +++ b/dev-lang/rust/rust-1.34.0.ebuild
51 @@ -0,0 +1,320 @@
52 +# Copyright 1999-2019 Gentoo Authors
53 +# Distributed under the terms of the GNU General Public License v2
54 +
55 +EAPI=6
56 +
57 +PYTHON_COMPAT=( python2_7 python3_{5,6,7} pypy )
58 +
59 +inherit check-reqs eapi7-ver estack flag-o-matic llvm multiprocessing multilib-build python-any-r1 rust-toolchain toolchain-funcs
60 +
61 +if [[ ${PV} = *beta* ]]; then
62 + betaver=${PV//*beta}
63 + BETA_SNAPSHOT="${betaver:0:4}-${betaver:4:2}-${betaver:6:2}"
64 + MY_P="rustc-beta"
65 + SLOT="beta/${PV}"
66 + SRC="${BETA_SNAPSHOT}/rustc-beta-src.tar.xz"
67 +else
68 + ABI_VER="$(ver_cut 1-2)"
69 + SLOT="stable/${ABI_VER}"
70 + MY_P="rustc-${PV}"
71 + SRC="${MY_P}-src.tar.xz"
72 + KEYWORDS="~amd64 ~arm64 ~ppc64 ~x86"
73 +fi
74 +
75 +RUST_STAGE0_VERSION="1.$(($(ver_cut 2) - 1)).0"
76 +
77 +DESCRIPTION="Systems programming language from Mozilla"
78 +HOMEPAGE="https://www.rust-lang.org/"
79 +
80 +SRC_URI="https://static.rust-lang.org/dist/${SRC} -> rustc-${PV}-src.tar.xz
81 + $(rust_all_arch_uris rust-${RUST_STAGE0_VERSION})"
82 +
83 +ALL_LLVM_TARGETS=( AArch64 AMDGPU ARM BPF Hexagon Lanai Mips MSP430
84 + NVPTX PowerPC Sparc SystemZ WebAssembly X86 XCore )
85 +ALL_LLVM_TARGETS=( "${ALL_LLVM_TARGETS[@]/#/llvm_targets_}" )
86 +LLVM_TARGET_USEDEPS=${ALL_LLVM_TARGETS[@]/%/?}
87 +
88 +LICENSE="|| ( MIT Apache-2.0 ) BSD-1 BSD-2 BSD-4 UoI-NCSA"
89 +
90 +IUSE="clippy cpu_flags_x86_sse2 debug doc libressl rls rustfmt system-llvm wasm ${ALL_LLVM_TARGETS[*]}"
91 +
92 +# Please keep the LLVM dependency block separate. Since LLVM is slotted,
93 +# we need to *really* make sure we're not pulling one than more slot
94 +# simultaneously.
95 +
96 +# How to use it:
97 +# 1. List all the working slots (with min versions) in ||, newest first.
98 +# 2. Update the := to specify *max* version, e.g. < 9.
99 +# 3. Specify LLVM_MAX_SLOT, e.g. 8.
100 +LLVM_DEPEND="
101 + || (
102 + sys-devel/llvm:8[llvm_targets_WebAssembly?]
103 + )
104 + <sys-devel/llvm-9:=
105 +"
106 +LLVM_MAX_SLOT=8
107 +
108 +COMMON_DEPEND="
109 + sys-libs/zlib
110 + !libressl? ( dev-libs/openssl:0= )
111 + libressl? ( dev-libs/libressl:0= )
112 + net-libs/libssh2
113 + net-libs/http-parser:=
114 + net-misc/curl[ssl]
115 + system-llvm? (
116 + ${LLVM_DEPEND}
117 + )
118 +"
119 +
120 +DEPEND="${COMMON_DEPEND}
121 + ${PYTHON_DEPS}
122 + || (
123 + >=sys-devel/gcc-4.7
124 + >=sys-devel/clang-3.5
125 + )
126 + dev-util/cmake"
127 +RDEPEND="${COMMON_DEPEND}
128 + >=app-eselect/eselect-rust-20190311
129 + !dev-util/cargo
130 + rustfmt? ( !dev-util/rustfmt )"
131 +REQUIRED_USE="|| ( ${ALL_LLVM_TARGETS[*]} )
132 + wasm? ( llvm_targets_WebAssembly )
133 + x86? ( cpu_flags_x86_sse2 )
134 +"
135 +
136 +S="${WORKDIR}/${MY_P}-src"
137 +
138 +toml_usex() {
139 + usex "$1" true false
140 +}
141 +
142 +pre_build_checks() {
143 + CHECKREQS_DISK_BUILD="7G"
144 + CHECKREQS_MEMORY="4G"
145 + eshopts_push -s extglob
146 + if is-flagq '-g?(gdb)?([1-9])'; then
147 + CHECKREQS_DISK_BUILD="10G"
148 + CHECKREQS_MEMORY="16G"
149 + fi
150 + eshopts_pop
151 + check-reqs_pkg_setup
152 +}
153 +
154 +pkg_pretend() {
155 + pre_build_checks
156 +}
157 +
158 +pkg_setup() {
159 + pre_build_checks
160 + python-any-r1_pkg_setup
161 + use system-llvm && llvm_pkg_setup
162 +}
163 +
164 +src_prepare() {
165 + local rust_stage0_root="${WORKDIR}"/rust-stage0
166 +
167 + local rust_stage0="rust-${RUST_STAGE0_VERSION}-$(rust_abi)"
168 +
169 + "${WORKDIR}/${rust_stage0}"/install.sh --disable-ldconfig --destdir="${rust_stage0_root}" --prefix=/ || die
170 +
171 + # ugly hack for https://bugs.gentoo.org/679806
172 + if use ppc64; then
173 + sed -i 's/getentropy/gEtEnTrOpY/g' "${rust_stage0_root}"/bin/cargo || die
174 + export OPENSSL_ppccap=0
175 + fi
176 +
177 + default
178 +}
179 +
180 +src_configure() {
181 + local rust_target="" rust_targets="" arch_cflags
182 +
183 + # Collect rust target names to compile standard libs for all ABIs.
184 + for v in $(multilib_get_enabled_abi_pairs); do
185 + rust_targets="${rust_targets},\"$(rust_abi $(get_abi_CHOST ${v##*.}))\""
186 + done
187 + if use wasm; then
188 + rust_targets="${rust_targets},\"wasm32-unknown-unknown\""
189 + fi
190 + rust_targets="${rust_targets#,}"
191 +
192 + local extended="true" tools="\"cargo\","
193 + if use clippy; then
194 + tools="\"clippy\",$tools"
195 + fi
196 + if use rls; then
197 + tools="\"rls\",\"analysis\",\"src\",$tools"
198 + fi
199 + if use rustfmt; then
200 + tools="\"rustfmt\",$tools"
201 + fi
202 +
203 + local rust_stage0_root="${WORKDIR}"/rust-stage0
204 +
205 + rust_target="$(rust_abi)"
206 +
207 + cat <<- EOF > "${S}"/config.toml
208 + [llvm]
209 + optimize = $(toml_usex !debug)
210 + release-debuginfo = $(toml_usex debug)
211 + assertions = $(toml_usex debug)
212 + targets = "${LLVM_TARGETS// /;}"
213 + link-shared = $(toml_usex system-llvm)
214 + [build]
215 + build = "${rust_target}"
216 + host = ["${rust_target}"]
217 + target = [${rust_targets}]
218 + cargo = "${rust_stage0_root}/bin/cargo"
219 + rustc = "${rust_stage0_root}/bin/rustc"
220 + docs = $(toml_usex doc)
221 + submodules = false
222 + python = "${EPYTHON}"
223 + locked-deps = true
224 + vendor = true
225 + extended = ${extended}
226 + tools = [${tools}]
227 + [install]
228 + prefix = "${EPREFIX}/usr"
229 + libdir = "$(get_libdir)/${P}"
230 + docdir = "share/doc/${P}"
231 + mandir = "share/${P}/man"
232 + [rust]
233 + optimize = $(toml_usex !debug)
234 + debuginfo = $(toml_usex debug)
235 + debug-assertions = $(toml_usex debug)
236 + default-linker = "$(tc-getCC)"
237 + channel = "stable"
238 + rpath = false
239 + lld = $(toml_usex wasm)
240 + EOF
241 +
242 + for v in $(multilib_get_enabled_abi_pairs); do
243 + rust_target=$(rust_abi $(get_abi_CHOST ${v##*.}))
244 + arch_cflags="$(get_abi_CFLAGS ${v##*.})"
245 +
246 + cat <<- EOF >> "${S}"/config.env
247 + CFLAGS_${rust_target}=${arch_cflags}
248 + EOF
249 +
250 + cat <<- EOF >> "${S}"/config.toml
251 + [target.${rust_target}]
252 + cc = "$(tc-getBUILD_CC)"
253 + cxx = "$(tc-getBUILD_CXX)"
254 + linker = "$(tc-getCC)"
255 + ar = "$(tc-getAR)"
256 + EOF
257 + if use system-llvm; then
258 + cat <<- EOF >> "${S}"/config.toml
259 + llvm-config = "$(get_llvm_prefix "${LLVM_MAX_SLOT}")/bin/llvm-config"
260 + EOF
261 + fi
262 + done
263 +
264 + if use wasm; then
265 + cat <<- EOF >> "${S}"/config.toml
266 + [target.wasm32-unknown-unknown]
267 + linker = "rust-lld"
268 + EOF
269 + fi
270 +}
271 +
272 +src_compile() {
273 + env $(cat "${S}"/config.env)\
274 + "${EPYTHON}" ./x.py build -v --config="${S}"/config.toml -j$(makeopts_jobs) \
275 + --exclude src/tools/miri || die # https://github.com/rust-lang/rust/issues/52305
276 +}
277 +
278 +src_install() {
279 + local rust_target abi_libdir
280 +
281 + env DESTDIR="${D}" "${EPYTHON}" ./x.py install -v || die
282 +
283 + mv "${D}/usr/bin/rustc" "${D}/usr/bin/rustc-${PV}" || die
284 + mv "${D}/usr/bin/rustdoc" "${D}/usr/bin/rustdoc-${PV}" || die
285 + mv "${D}/usr/bin/rust-gdb" "${D}/usr/bin/rust-gdb-${PV}" || die
286 + mv "${D}/usr/bin/rust-lldb" "${D}/usr/bin/rust-lldb-${PV}" || die
287 + mv "${D}/usr/bin/cargo" "${D}/usr/bin/cargo-${PV}" || die
288 + if use clippy; then
289 + mv "${D}/usr/bin/clippy-driver" "${D}/usr/bin/clippy-driver-${PV}" || die
290 + mv "${D}/usr/bin/cargo-clippy" "${D}/usr/bin/cargo-clippy-${PV}" || die
291 + fi
292 + if use rls; then
293 + mv "${D}/usr/bin/rls" "${D}/usr/bin/rls-${PV}" || die
294 + fi
295 + if use rustfmt; then
296 + mv "${D}/usr/bin/rustfmt" "${D}/usr/bin/rustfmt-${PV}" || die
297 + mv "${D}/usr/bin/cargo-fmt" "${D}/usr/bin/cargo-fmt-${PV}" || die
298 + fi
299 +
300 + # Copy shared library versions of standard libraries for all targets
301 + # into the system's abi-dependent lib directories because the rust
302 + # installer only does so for the native ABI.
303 + for v in $(multilib_get_enabled_abi_pairs); do
304 + if [ ${v##*.} = ${DEFAULT_ABI} ]; then
305 + continue
306 + fi
307 + abi_libdir=$(get_abi_LIBDIR ${v##*.})
308 + rust_target=$(rust_abi $(get_abi_CHOST ${v##*.}))
309 + mkdir -p "${D}/usr/${abi_libdir}"
310 + cp "${D}/usr/$(get_libdir)/${P}/rustlib/${rust_target}/lib"/*.so \
311 + "${D}/usr/${abi_libdir}" || die
312 + done
313 +
314 + dodoc COPYRIGHT
315 +
316 + # FIXME:
317 + # Really not sure if that env is needed, specailly LDPATH
318 + cat <<-EOF > "${T}"/50${P}
319 + LDPATH="/usr/$(get_libdir)/${P}"
320 + MANPATH="/usr/share/${P}/man"
321 + EOF
322 + doenvd "${T}"/50${P}
323 +
324 + cat <<-EOF > "${T}/provider-${P}"
325 + /usr/bin/rustdoc
326 + /usr/bin/rust-gdb
327 + /usr/bin/rust-lldb
328 + EOF
329 + echo /usr/bin/cargo >> "${T}/provider-${P}"
330 + if use clippy; then
331 + echo /usr/bin/clippy-driver >> "${T}/provider-${P}"
332 + echo /usr/bin/cargo-clippy >> "${T}/provider-${P}"
333 + fi
334 + if use rls; then
335 + echo /usr/bin/rls >> "${T}/provider-${P}"
336 + fi
337 + if use rustfmt; then
338 + echo /usr/bin/rustfmt >> "${T}/provider-${P}"
339 + echo /usr/bin/cargo-fmt >> "${T}/provider-${P}"
340 + fi
341 + dodir /etc/env.d/rust
342 + insinto /etc/env.d/rust
343 + doins "${T}/provider-${P}"
344 +}
345 +
346 +pkg_postinst() {
347 + eselect rust update --if-unset
348 +
349 + elog "Rust installs a helper script for calling GDB and LLDB,"
350 + elog "for your convenience it is installed under /usr/bin/rust-{gdb,lldb}-${PV}."
351 +
352 + ewarn "cargo is now installed from dev-lang/rust{,-bin} instead of dev-util/cargo."
353 + ewarn "This might have resulted in a dangling symlink for /usr/bin/cargo on some"
354 + ewarn "systems. This can be resolved by calling 'sudo eselect rust set ${P}'."
355 +
356 + if has_version app-editors/emacs || has_version app-editors/emacs-vcs; then
357 + elog "install app-emacs/rust-mode to get emacs support for rust."
358 + fi
359 +
360 + if has_version app-editors/gvim || has_version app-editors/vim; then
361 + elog "install app-vim/rust-vim to get vim support for rust."
362 + fi
363 +
364 + if has_version 'app-shells/zsh'; then
365 + elog "install app-shells/rust-zshcomp to get zsh completion for rust."
366 + fi
367 +}
368 +
369 +pkg_postrm() {
370 + eselect rust unset --if-invalid
371 +}