commit:     8395fe36d257a6da070961b98f39e2fe48d1f921
Author:     gentoo90 <gentoo90 <AT> gmail <DOT> com>
AuthorDate: Tue Jul 28 20:52:59 2020 +0000
Commit:     Mikhail Pukhlikov <cynede <AT> gentoo <DOT> org>
CommitDate: Mon Aug  3 06:25:41 2020 +0000
URL:        https://gitweb.gentoo.org/repo/proj/rust.git/commit/?id=8395fe36

dev-lang/rust-bin-9999: add "source" useflag

Downloads and installs the sourcecode. Required for RLS.

Signed-off-by: Mikhail Pukhlikov <cynede <AT> gentoo.org>

 dev-lang/rust-bin/rust-bin-9999.ebuild | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/dev-lang/rust-bin/rust-bin-9999.ebuild 
b/dev-lang/rust-bin/rust-bin-9999.ebuild
index bd0fb59..66bddf0 100644
--- a/dev-lang/rust-bin/rust-bin-9999.ebuild
+++ b/dev-lang/rust-bin/rust-bin-9999.ebuild
@@ -8,10 +8,12 @@ inherit eutils bash-completion-r1
 DESCRIPTION="Systems programming language from Mozilla"
 HOMEPAGE="https://www.rust-lang.org/";
 MY_SRC_URI="https://static.rust-lang.org/dist/rust-nightly";
+MY_SRC_SRC_URI="https://static.rust-lang.org/dist/rust-src-nightly.tar.xz";
 MY_STDLIB_SRC_URI="https://static.rust-lang.org/dist/rust-std-nightly";
 
 if [[ -v RUST_NIGHTLY_DATE ]]; then
        
MY_SRC_URI="https://static.rust-lang.org/dist/${RUST_NIGHTLY_DATE}/rust-nightly";
+       
MY_SRC_SRC_URI="https://static.rust-lang.org/dist/${RUST_NIGHTLY_DATE}/rust-src-nightly.tar.xz";
        
MY_STDLIB_SRC_URI="https://static.rust-lang.org/dist/${RUST_NIGHTLY_DATE}/rust-std-nightly";
 fi
 
@@ -25,7 +27,7 @@ SLOT="nightly"
 KEYWORDS=""
 RESTRICT="network-sandbox"
 
-IUSE="clippy cpu_flags_x86_sse2 doc libressl rls rustfmt 
${ALL_RUSTLIB_TARGETS[*]}"
+IUSE="clippy cpu_flags_x86_sse2 doc libressl rls rustfmt source 
${ALL_RUSTLIB_TARGETS[*]}"
 
 CDEPEND="
        >=app-eselect/eselect-rust-0.3_pre20150425
@@ -43,7 +45,8 @@ RDEPEND="${CDEPEND}
        net-misc/curl[ssl]
        !dev-util/cargo
        "
-REQUIRED_USE="x86? ( cpu_flags_x86_sse2 )"
+REQUIRED_USE="x86? ( cpu_flags_x86_sse2 )
+       rls? ( source )"
 
 QA_PREBUILT="
        opt/${P}/bin/*-${PV}
@@ -74,12 +77,20 @@ src_unpack() {
                        cat "${WORKDIR}/rust-std-nightly-${target}/components" 
>> "${S}/components"
                fi
        done
+
+       if use source; then
+               wget "${MY_SRC_SRC_URI}" || die
+               unpack ./"rust-src-nightly.tar.xz"
+               mv "${WORKDIR}/rust-src-nightly/rust-src" "${S}/" || die
+               cat "${WORKDIR}/rust-src-nightly/components" >> 
"${S}/components"
+       fi
 }
 
 src_install() {
        local std=$(grep 'std' ./components | paste -s -d',')
        local components="rustc,cargo,${std}"
        use doc && components="${components},rust-docs"
+       use source && components="${components},rust-src"
        use clippy && components="${components},clippy-preview"
        if use rls; then
                local analysis=$(grep 'analysis' ./components)

Reply via email to