Gentoo Archives: gentoo-commits

From: Mikhail Pukhlikov <cynede@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/rust:master commit in: dev-lang/rust-bin/
Date: Mon, 03 Aug 2020 06:26:19
Message-Id: 1596435941.8395fe36d257a6da070961b98f39e2fe48d1f921.cynede@gentoo
1 commit: 8395fe36d257a6da070961b98f39e2fe48d1f921
2 Author: gentoo90 <gentoo90 <AT> gmail <DOT> com>
3 AuthorDate: Tue Jul 28 20:52:59 2020 +0000
4 Commit: Mikhail Pukhlikov <cynede <AT> gentoo <DOT> org>
5 CommitDate: Mon Aug 3 06:25:41 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/rust.git/commit/?id=8395fe36
7
8 dev-lang/rust-bin-9999: add "source" useflag
9
10 Downloads and installs the sourcecode. Required for RLS.
11
12 Signed-off-by: Mikhail Pukhlikov <cynede <AT> gentoo.org>
13
14 dev-lang/rust-bin/rust-bin-9999.ebuild | 15 +++++++++++++--
15 1 file changed, 13 insertions(+), 2 deletions(-)
16
17 diff --git a/dev-lang/rust-bin/rust-bin-9999.ebuild b/dev-lang/rust-bin/rust-bin-9999.ebuild
18 index bd0fb59..66bddf0 100644
19 --- a/dev-lang/rust-bin/rust-bin-9999.ebuild
20 +++ b/dev-lang/rust-bin/rust-bin-9999.ebuild
21 @@ -8,10 +8,12 @@ inherit eutils bash-completion-r1
22 DESCRIPTION="Systems programming language from Mozilla"
23 HOMEPAGE="https://www.rust-lang.org/"
24 MY_SRC_URI="https://static.rust-lang.org/dist/rust-nightly"
25 +MY_SRC_SRC_URI="https://static.rust-lang.org/dist/rust-src-nightly.tar.xz"
26 MY_STDLIB_SRC_URI="https://static.rust-lang.org/dist/rust-std-nightly"
27
28 if [[ -v RUST_NIGHTLY_DATE ]]; then
29 MY_SRC_URI="https://static.rust-lang.org/dist/${RUST_NIGHTLY_DATE}/rust-nightly"
30 + MY_SRC_SRC_URI="https://static.rust-lang.org/dist/${RUST_NIGHTLY_DATE}/rust-src-nightly.tar.xz"
31 MY_STDLIB_SRC_URI="https://static.rust-lang.org/dist/${RUST_NIGHTLY_DATE}/rust-std-nightly"
32 fi
33
34 @@ -25,7 +27,7 @@ SLOT="nightly"
35 KEYWORDS=""
36 RESTRICT="network-sandbox"
37
38 -IUSE="clippy cpu_flags_x86_sse2 doc libressl rls rustfmt ${ALL_RUSTLIB_TARGETS[*]}"
39 +IUSE="clippy cpu_flags_x86_sse2 doc libressl rls rustfmt source ${ALL_RUSTLIB_TARGETS[*]}"
40
41 CDEPEND="
42 >=app-eselect/eselect-rust-0.3_pre20150425
43 @@ -43,7 +45,8 @@ RDEPEND="${CDEPEND}
44 net-misc/curl[ssl]
45 !dev-util/cargo
46 "
47 -REQUIRED_USE="x86? ( cpu_flags_x86_sse2 )"
48 +REQUIRED_USE="x86? ( cpu_flags_x86_sse2 )
49 + rls? ( source )"
50
51 QA_PREBUILT="
52 opt/${P}/bin/*-${PV}
53 @@ -74,12 +77,20 @@ src_unpack() {
54 cat "${WORKDIR}/rust-std-nightly-${target}/components" >> "${S}/components"
55 fi
56 done
57 +
58 + if use source; then
59 + wget "${MY_SRC_SRC_URI}" || die
60 + unpack ./"rust-src-nightly.tar.xz"
61 + mv "${WORKDIR}/rust-src-nightly/rust-src" "${S}/" || die
62 + cat "${WORKDIR}/rust-src-nightly/components" >> "${S}/components"
63 + fi
64 }
65
66 src_install() {
67 local std=$(grep 'std' ./components | paste -s -d',')
68 local components="rustc,cargo,${std}"
69 use doc && components="${components},rust-docs"
70 + use source && components="${components},rust-src"
71 use clippy && components="${components},clippy-preview"
72 if use rls; then
73 local analysis=$(grep 'analysis' ./components)