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: Sat, 29 Sep 2018 13:22:36
Message-Id: 1538227318.837dfce8560d51e153e8c5bd900c1a587fd31825.djc@gentoo
1 commit: 837dfce8560d51e153e8c5bd900c1a587fd31825
2 Author: Dirkjan Ochtman <djc <AT> gentoo <DOT> org>
3 AuthorDate: Sat Sep 29 12:46:57 2018 +0000
4 Commit: Dirkjan Ochtman <djc <AT> gentoo <DOT> org>
5 CommitDate: Sat Sep 29 13:21:58 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=837dfce8
7
8 dev-lang/rust: version bump to 1.29.1
9
10 Package-Manager: Portage-2.3.49, Repoman-2.3.10
11
12 Signed-off-by: Dirkjan Ochtman <djc <AT> gentoo.org>
13
14 dev-lang/rust/Manifest | 4 +
15 dev-lang/rust/metadata.xml | 1 +
16 dev-lang/rust/rust-1.29.1.ebuild | 290 +++++++++++++++++++++++++++++++++++++++
17 3 files changed, 295 insertions(+)
18
19 diff --git a/dev-lang/rust/Manifest b/dev-lang/rust/Manifest
20 index e7a6c0abd82..bdc1d4db5b4 100644
21 --- a/dev-lang/rust/Manifest
22 +++ b/dev-lang/rust/Manifest
23 @@ -10,7 +10,11 @@ DIST rust-1.26.2-x86_64-unknown-linux-gnu.tar.xz 138609432 BLAKE2B 54507a8ce3ab2
24 DIST rust-1.27.2-aarch64-unknown-linux-gnu.tar.xz 94186748 BLAKE2B 7e8f46128a7638217ef63caf479e1a6d9ebde7a225b7dad55082eb06e0206f0b1a5efa65badb15127a456ddc39702482407bbb9171a11397a31bc7c85d2cbcfa SHA512 84022350f1e8fc34a353a09848333424a557ddea3b9445a1a5fc9d2f2abced942154e80888ab4091174d6d83c6766f583ef240ab2e2233de5d536633d2765040
25 DIST rust-1.27.2-i686-unknown-linux-gnu.tar.xz 144776012 BLAKE2B 98883f45637adf0920543da8951f29bf5ab11d1f39e9f4154b77e882eadce26ec5e8ed3e9bdcf560f8009fbaab4b7255ba8eb8eeb8beadad39ec6fa74b6dde45 SHA512 e17960120bdd18a527c0783ce8ca8d76cdc9b436f36a73a82fd2ea709b253f33feeb88310fab7a86305bad403eb5dad7ea43d0e5bc5ad1e3847f29e85040303a
26 DIST rust-1.27.2-x86_64-unknown-linux-gnu.tar.xz 144218956 BLAKE2B 40834086f211dd64ec76be37eb477697ff44783f261f0b9bfc10b46cc340cf3c15adf80d39a9df642b4985ea1239ad7f1d1803a44f3bd3d53f073bdc38a1de0e SHA512 14861392dad81d2c040d0deb64d5dd34652d5cc2875e404609a0f13c8fb6bdc38f9bc7b1e309829365a00c42b610f2b7a73cffa232ecfdf0618b5508a8667198
27 +DIST rust-1.28.0-aarch64-unknown-linux-gnu.tar.xz 98937652 BLAKE2B 836d3dd4e583fa50dd317c3bea56257e6ea19defdb38c16be6debb2854e147c8a92c4832263e4ac314136022a176526fe7d3774a3c5a84cd8d364cd2a1532860 SHA512 8d9acbc90ddaa1e0de0234a21798b19b5365ea371a12f9a143c6ebacbb48f57344da6e827e867513be502bce2801de27a0dbbacdf8618c653aeb58026b6c469c
28 +DIST rust-1.28.0-i686-unknown-linux-gnu.tar.xz 136925948 BLAKE2B 85d9239533920c3f16d7c61bada0caeabceceade29032b70bb4562bfd04fa0158cdd85b8a0a1119506416fa5916ade8a0466bf6c10da457299a6319aa25f9dd6 SHA512 ffdfab46db14f07354b553e02fdb9dc6602c2c52b78d8f17c499f4ddb1e257aa53479df836eb3f06a2548d34296b0277cdb6b4c6f3cec57265823df22752c135
29 +DIST rust-1.28.0-x86_64-unknown-linux-gnu.tar.xz 134120432 BLAKE2B 56fb79a98659d9c8e56b8eef87dea3302ee5901bc4507d1c204628370b20cf34b2875c9586faa0acc2bc2b1a5beedeb9b5ba199cfb85d52f268f084a02f04f27 SHA512 4f427c11a9cd22aedd01bd7ed5bee2ba5e00a27db25af4f596cf8627d88eff8e72625eb83729d2e6c6780aaffd44c0e7065a1c8fa22f4899349b72c726cf6a5f
30 DIST rustc-1.25.0-src.tar.gz 98639156 BLAKE2B 1408d5dd0611d4830de3b6b3d00e3fad4198a47599b639d0ac0bd05aaba401f743056a942e9df04a4d192c6b12e8cfe9a9cdf8cd26e48b72104ce9b423df049e SHA512 7d8886f4d5a621eb794e814deb60be681fa38cf086f87ffa14e5a3500c640b237c549a632de1331a0f1b71963de41f6d31a4df3866b7e597424002316fed81ce
31 DIST rustc-1.26.2-src.tar.xz 54613640 BLAKE2B f361b7a0ed40ccb026750b4a70b99931f1abf52024e907b588e339902de2fbbd15501d237ac048d0537005834b0a2f49935f654a8c75d40ed95c65894f611481 SHA512 a598858ddce0e05d1d431be383400f44fc551eb2e368f37b01670c0b65ea5da6a7d5b2b68bb6ef806d2107cfa0d5007008442ad4d5ddb17d18d04e0ab31600b0
32 DIST rustc-1.27.1-src.tar.xz 55458892 BLAKE2B 9c5cec24760afdcee51fb0ba8d2289b92d34de57e97e57f2e5dc129674edab4a595ab5756c789b5de15bdd5107363f12a517169cedc7c3093fa0241d200ca3ab SHA512 4a8c03476ca1867a1130b825724ecb6bd629b889d704fdd6c3de4e188f73e2d1acdfae413f26e37505d76109d23d8e9ab409b31af3d67d244f8552730ada292d
33 DIST rustc-1.28.0-src.tar.xz 55838968 BLAKE2B 1ff1f54dbae8c6481a6467d35b7c7dc340eba5e8c34f08ecb7b2300239c98a70c8459dacb8c8932ab6d9b3e2770e5b3508e23db7b01ff6014b7dbc076cf1de94 SHA512 a4885cd42a1006738cca2f0d8c0d5e4fd4014fc4629cbf691935bd36ffb896c553717022e67532359b5f1bd8e5050fc38b9dffed7c45cc76f7089ec134dfb980
34 +DIST rustc-1.29.1-src.tar.xz 61937676 BLAKE2B 6a60249538e1ec62471f4d0e3fc31c0a648433aa6f85ca7341657ea07772e338eb92a629941685808f4b80e84cb025d78aee9d0d6fa71c6635a1647c61bca9bc SHA512 1ded651b4c460e11e5e44c26de88a80fb13c2000097de2ee1e5af89638e12a7e8f43dd756689d4cc4fad45c52d4d43a3c70dd6a3ae550735b9dad5f8defea6a7
35
36 diff --git a/dev-lang/rust/metadata.xml b/dev-lang/rust/metadata.xml
37 index 88d11733609..8b63f5a12fc 100644
38 --- a/dev-lang/rust/metadata.xml
39 +++ b/dev-lang/rust/metadata.xml
40 @@ -9,6 +9,7 @@
41 <flag name="extended">Build and install rls, rustfmt and cargo
42 alongside the compiler and stdlib</flag>
43 <flag name="cargo">Install cargo component</flag>
44 + <flag name="clippy">Install clippy component</flag>
45 <flag name="jemalloc">Use <pkg>dev-libs/jemalloc</pkg> as the
46 standard memory allocator</flag>
47 <flag name="rls">Install rls component</flag>
48
49 diff --git a/dev-lang/rust/rust-1.29.1.ebuild b/dev-lang/rust/rust-1.29.1.ebuild
50 new file mode 100644
51 index 00000000000..d24453026eb
52 --- /dev/null
53 +++ b/dev-lang/rust/rust-1.29.1.ebuild
54 @@ -0,0 +1,290 @@
55 +# Copyright 1999-2018 Gentoo Foundation
56 +# Distributed under the terms of the GNU General Public License v2
57 +
58 +EAPI=6
59 +
60 +PYTHON_COMPAT=( python2_7 python3_{5,6} pypy )
61 +
62 +inherit multiprocessing multilib-build python-any-r1 toolchain-funcs versionator
63 +
64 +if [[ ${PV} = *beta* ]]; then
65 + betaver=${PV//*beta}
66 + BETA_SNAPSHOT="${betaver:0:4}-${betaver:4:2}-${betaver:6:2}"
67 + MY_P="rustc-beta"
68 + SLOT="beta/${PV}"
69 + SRC="${BETA_SNAPSHOT}/rustc-beta-src.tar.xz"
70 + KEYWORDS=""
71 +else
72 + ABI_VER="$(get_version_component_range 1-2)"
73 + SLOT="stable/${ABI_VER}"
74 + MY_P="rustc-${PV}"
75 + SRC="${MY_P}-src.tar.xz"
76 + KEYWORDS="~amd64 ~arm64 ~x86"
77 +fi
78 +
79 +CHOST_amd64=x86_64-unknown-linux-gnu
80 +CHOST_x86=i686-unknown-linux-gnu
81 +CHOST_arm64=aarch64-unknown-linux-gnu
82 +
83 +RUST_STAGE0_VERSION="1.$(($(get_version_component_range 2) - 1)).0"
84 +RUST_STAGE0_amd64="rust-${RUST_STAGE0_VERSION}-${CHOST_amd64}"
85 +RUST_STAGE0_x86="rust-${RUST_STAGE0_VERSION}-${CHOST_x86}"
86 +RUST_STAGE0_arm64="rust-${RUST_STAGE0_VERSION}-${CHOST_arm64}"
87 +
88 +CARGO_DEPEND_VERSION="0.$(($(get_version_component_range 2) + 1)).0"
89 +
90 +DESCRIPTION="Systems programming language from Mozilla"
91 +HOMEPAGE="https://www.rust-lang.org/"
92 +
93 +SRC_URI="https://static.rust-lang.org/dist/${SRC} -> rustc-${PV}-src.tar.xz
94 + amd64? ( https://static.rust-lang.org/dist/${RUST_STAGE0_amd64}.tar.xz )
95 + x86? ( https://static.rust-lang.org/dist/${RUST_STAGE0_x86}.tar.xz )
96 + arm64? ( https://static.rust-lang.org/dist/${RUST_STAGE0_arm64}.tar.xz )
97 +"
98 +
99 +ALL_LLVM_TARGETS=( AArch64 AMDGPU ARM BPF Hexagon Lanai Mips MSP430
100 + NVPTX PowerPC Sparc SystemZ X86 XCore )
101 +ALL_LLVM_TARGETS=( "${ALL_LLVM_TARGETS[@]/#/llvm_targets_}" )
102 +LLVM_TARGET_USEDEPS=${ALL_LLVM_TARGETS[@]/%/?}
103 +
104 +LICENSE="|| ( MIT Apache-2.0 ) BSD-1 BSD-2 BSD-4 UoI-NCSA"
105 +
106 +IUSE="cargo clippy debug doc +jemalloc libressl rls rustfmt wasm ${ALL_LLVM_TARGETS[*]}"
107 +
108 +RDEPEND=">=app-eselect/eselect-rust-0.3_pre20150425
109 + jemalloc? ( dev-libs/jemalloc )
110 + cargo? (
111 + sys-libs/zlib
112 + !libressl? ( dev-libs/openssl:0= )
113 + libressl? ( dev-libs/libressl:0= )
114 + net-libs/libssh2
115 + net-libs/http-parser:=
116 + net-misc/curl[ssl]
117 + )"
118 +DEPEND="${RDEPEND}
119 + ${PYTHON_DEPS}
120 + || (
121 + >=sys-devel/gcc-4.7
122 + >=sys-devel/clang-3.5
123 + )
124 + cargo? ( !dev-util/cargo )
125 + rustfmt? ( !dev-util/rustfmt )
126 + dev-util/cmake
127 +"
128 +PDEPEND="!cargo? ( >=dev-util/cargo-${CARGO_DEPEND_VERSION} )"
129 +
130 +REQUIRED_USE="|| ( ${ALL_LLVM_TARGETS[*]} )"
131 +
132 +S="${WORKDIR}/${MY_P}-src"
133 +
134 +toml_usex() {
135 + usex "$1" true false
136 +}
137 +
138 +src_prepare() {
139 + local rust_stage0_root="${WORKDIR}"/rust-stage0
140 +
141 + local rust_stage0_name="RUST_STAGE0_${ARCH}"
142 + local rust_stage0="${!rust_stage0_name}"
143 +
144 + "${WORKDIR}/${rust_stage0}"/install.sh --disable-ldconfig --destdir="${rust_stage0_root}" --prefix=/ || die
145 +
146 + default
147 +}
148 +
149 +src_configure() {
150 + local rust_target="" rust_targets="" rust_target_name arch_cflags
151 +
152 + # Collect rust target names to compile standard libs for all ABIs.
153 + for v in $(multilib_get_enabled_abi_pairs); do
154 + rust_target_name="CHOST_${v##*.}"
155 + rust_targets="${rust_targets},\"${!rust_target_name}\""
156 + done
157 + if use wasm; then
158 + rust_targets="${rust_targets},\"wasm32-unknown-unknown\""
159 + fi
160 + rust_targets="${rust_targets#,}"
161 +
162 + local extended="false" tools=""
163 + if use cargo; then
164 + extended="true"
165 + tools="\"cargo\","
166 + fi
167 + if use clippy; then
168 + extended="true"
169 + tools="\"clippy\",$tools"
170 + fi
171 + if use rls; then
172 + extended="true"
173 + tools="\"rls\",\"analysis\",\"src\",$tools"
174 + fi
175 + if use rustfmt; then
176 + extended="true"
177 + tools="\"rustfmt\",$tools"
178 + fi
179 +
180 + local rust_stage0_root="${WORKDIR}"/rust-stage0
181 +
182 + rust_target_name="CHOST_${ARCH}"
183 + rust_target="${!rust_target_name}"
184 +
185 + cat <<- EOF > "${S}"/config.toml
186 + [llvm]
187 + optimize = $(toml_usex !debug)
188 + release-debuginfo = $(toml_usex debug)
189 + assertions = $(toml_usex debug)
190 + targets = "${LLVM_TARGETS// /;}"
191 + [build]
192 + build = "${rust_target}"
193 + host = ["${rust_target}"]
194 + target = [${rust_targets}]
195 + cargo = "${rust_stage0_root}/bin/cargo"
196 + rustc = "${rust_stage0_root}/bin/rustc"
197 + docs = $(toml_usex doc)
198 + submodules = false
199 + python = "${EPYTHON}"
200 + locked-deps = true
201 + vendor = true
202 + extended = ${extended}
203 + tools = [${tools}]
204 + [install]
205 + prefix = "${EPREFIX}/usr"
206 + libdir = "$(get_libdir)"
207 + docdir = "share/doc/${P}"
208 + mandir = "share/${P}/man"
209 + [rust]
210 + optimize = $(toml_usex !debug)
211 + debuginfo = $(toml_usex debug)
212 + debug-assertions = $(toml_usex debug)
213 + use-jemalloc = $(toml_usex jemalloc)
214 + default-linker = "$(tc-getCC)"
215 + channel = "stable"
216 + rpath = false
217 + lld = $(toml_usex wasm)
218 + EOF
219 +
220 + for v in $(multilib_get_enabled_abi_pairs); do
221 + rust_target=$(get_abi_CHOST ${v##*.})
222 + arch_cflags="$(get_abi_CFLAGS ${v##*.})"
223 +
224 + cat <<- EOF >> "${S}"/config.env
225 + CFLAGS_${rust_target}=${arch_cflags}
226 + EOF
227 +
228 + cat <<- EOF >> "${S}"/config.toml
229 + [target.${rust_target}]
230 + cc = "$(tc-getBUILD_CC)"
231 + cxx = "$(tc-getBUILD_CXX)"
232 + linker = "$(tc-getCC)"
233 + ar = "$(tc-getAR)"
234 + EOF
235 + done
236 +
237 + if use wasm; then
238 + cat <<- EOF >> "${S}"/config.toml
239 + [target.wasm32-unknown-unknown]
240 + linker = "rust-lld"
241 + EOF
242 + fi
243 +}
244 +
245 +src_compile() {
246 + env $(cat "${S}"/config.env)\
247 + "${EPYTHON}" ./x.py build --config="${S}"/config.toml -j$(makeopts_jobs) \
248 + --exclude src/tools/miri || die # https://github.com/rust-lang/rust/issues/52305
249 +}
250 +
251 +src_install() {
252 + local rust_target abi_libdir
253 +
254 + env DESTDIR="${D}" "${EPYTHON}" ./x.py install || die
255 +
256 + mv "${D}/usr/bin/rustc" "${D}/usr/bin/rustc-${PV}" || die
257 + mv "${D}/usr/bin/rustdoc" "${D}/usr/bin/rustdoc-${PV}" || die
258 + mv "${D}/usr/bin/rust-gdb" "${D}/usr/bin/rust-gdb-${PV}" || die
259 + mv "${D}/usr/bin/rust-lldb" "${D}/usr/bin/rust-lldb-${PV}" || die
260 + if use cargo; then
261 + mv "${D}/usr/bin/cargo" "${D}/usr/bin/cargo-${PV}" || die
262 + fi
263 + if use clippy; then
264 + mv "${D}/usr/bin/clippy-driver" "${D}/usr/bin/clippy-driver-${PV}" || die
265 + mv "${D}/usr/bin/cargo-clippy" "${D}/usr/bin/cargo-clippy-${PV}" || die
266 + fi
267 + if use rls; then
268 + mv "${D}/usr/bin/rls" "${D}/usr/bin/rls-${PV}" || die
269 + fi
270 + if use rustfmt; then
271 + mv "${D}/usr/bin/rustfmt" "${D}/usr/bin/rustfmt-${PV}" || die
272 + mv "${D}/usr/bin/cargo-fmt" "${D}/usr/bin/cargo-fmt-${PV}" || die
273 + fi
274 +
275 + # Copy shared library versions of standard libraries for all targets
276 + # into the system's abi-dependent lib directories because the rust
277 + # installer only does so for the native ABI.
278 + for v in $(multilib_get_enabled_abi_pairs); do
279 + if [ ${v##*.} = ${DEFAULT_ABI} ]; then
280 + continue
281 + fi
282 + abi_libdir=$(get_abi_LIBDIR ${v##*.})
283 + rust_target=$(get_abi_CHOST ${v##*.})
284 + mkdir -p "${D}/usr/${abi_libdir}"
285 + cp "${D}/usr/$(get_libdir)/rustlib/${rust_target}/lib"/*.so \
286 + "${D}/usr/${abi_libdir}" || die
287 + done
288 +
289 + dodoc COPYRIGHT
290 +
291 + # FIXME:
292 + # Really not sure if that env is needed, specailly LDPATH
293 + cat <<-EOF > "${T}"/50${P}
294 + LDPATH="/usr/$(get_libdir)/${P}"
295 + MANPATH="/usr/share/${P}/man"
296 + EOF
297 + doenvd "${T}"/50${P}
298 +
299 + cat <<-EOF > "${T}/provider-${P}"
300 + /usr/bin/rustdoc
301 + /usr/bin/rust-gdb
302 + /usr/bin/rust-lldb
303 + EOF
304 + if use cargo; then
305 + echo /usr/bin/cargo >> "${T}/provider-${P}"
306 + fi
307 + if use clippy; then
308 + echo /usr/bin/clippy-driver >> "${T}/provider-${P}"
309 + echo /usr/bin/cargo-clippy >> "${T}/provider-${P}"
310 + fi
311 + if use rls; then
312 + echo /usr/bin/rls >> "${T}/provider-${P}"
313 + fi
314 + if use rustfmt; then
315 + echo /usr/bin/rustfmt >> "${T}/provider-${P}"
316 + echo /usr/bin/cargo-fmt >> "${T}/provider-${P}"
317 + fi
318 + dodir /etc/env.d/rust
319 + insinto /etc/env.d/rust
320 + doins "${T}/provider-${P}"
321 +}
322 +
323 +pkg_postinst() {
324 + eselect rust update --if-unset
325 +
326 + elog "Rust installs a helper script for calling GDB and LLDB,"
327 + elog "for your convenience it is installed under /usr/bin/rust-{gdb,lldb}-${PV}."
328 +
329 + if has_version app-editors/emacs || has_version app-editors/emacs-vcs; then
330 + elog "install app-emacs/rust-mode to get emacs support for rust."
331 + fi
332 +
333 + if has_version app-editors/gvim || has_version app-editors/vim; then
334 + elog "install app-vim/rust-vim to get vim support for rust."
335 + fi
336 +
337 + if has_version 'app-shells/zsh'; then
338 + elog "install app-shells/rust-zshcomp to get zsh completion for rust."
339 + fi
340 +}
341 +
342 +pkg_postrm() {
343 + eselect rust unset --if-invalid
344 +}