commit:     d2e9fc2c57ca98303914d5632c20edce74f846a6
Author:     Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
AuthorDate: Fri Nov 12 19:56:17 2021 +0000
Commit:     Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
CommitDate: Fri Nov 12 20:01:35 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d2e9fc2c

dev-lang/rust: add rust-src useflag

previously 'src' component was installed by 'rls' useflag.
let's split it out for people who want 'src' but don't need rls.

Bug: https://bugs.gentoo.org/800785
Bug: https://bugs.gentoo.org/819786
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>

 dev-lang/rust/metadata.xml       | 1 +
 dev-lang/rust/rust-1.56.1.ebuild | 8 ++++++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/dev-lang/rust/metadata.xml b/dev-lang/rust/metadata.xml
index 4ecf03a3d4e..a51257c9ae1 100644
--- a/dev-lang/rust/metadata.xml
+++ b/dev-lang/rust/metadata.xml
@@ -16,6 +16,7 @@
                <flag name="parallel-compiler">Build a multi-threaded rustc 
(experimental, not tested by upstream)</flag>
                <flag name="rls">Install rls, Rust Language Server (used with 
IDEs supporting RLS protocol)</flag>
                <flag name="rustfmt">Install rustfmt, Rust code formatter</flag>
+               <flag name="rust-src">Install rust-src, needed by developer 
tools and for build-std (cross)</flag>
                <flag name="system-bootstrap">Bootstrap using installed rust 
compiler</flag>
                <flag name="system-llvm">Use the system LLVM install</flag>
                <flag name="wasm">Build support for the wasm32-unknown-unknown 
target</flag>

diff --git a/dev-lang/rust/rust-1.56.1.ebuild b/dev-lang/rust/rust-1.56.1.ebuild
index b0dc62b63ef..ebe0f6c8037 100644
--- a/dev-lang/rust/rust-1.56.1.ebuild
+++ b/dev-lang/rust/rust-1.56.1.ebuild
@@ -41,7 +41,7 @@ LLVM_TARGET_USEDEPS=${ALL_LLVM_TARGETS[@]/%/(-)?}
 
 LICENSE="|| ( MIT Apache-2.0 ) BSD-1 BSD-2 BSD-4 UoI-NCSA"
 
-IUSE="clippy cpu_flags_x86_sse2 debug doc miri nightly parallel-compiler rls 
rustfmt system-bootstrap system-llvm test wasm ${ALL_LLVM_TARGETS[*]}"
+IUSE="clippy cpu_flags_x86_sse2 debug doc miri nightly parallel-compiler rls 
rustfmt rust-src system-bootstrap system-llvm test wasm ${ALL_LLVM_TARGETS[*]}"
 
 # Please keep the LLVM dependency block separate. Since LLVM is slotted,
 # we need to *really* make sure we're not pulling more than one slot
@@ -119,6 +119,7 @@ RDEPEND="${DEPEND}
 REQUIRED_USE="|| ( ${ALL_LLVM_TARGETS[*]} )
        miri? ( nightly )
        parallel-compiler? ( nightly )
+       rls? ( rust-src )
        test? ( ${ALL_LLVM_TARGETS[*]} )
        wasm? ( llvm_targets_WebAssembly )
        x86? ( cpu_flags_x86_sse2 )
@@ -277,11 +278,14 @@ src_configure() {
                tools="\"miri\",$tools"
        fi
        if use rls; then
-               tools="\"rls\",\"analysis\",\"src\",$tools"
+               tools="\"rls\",\"analysis\",$tools"
        fi
        if use rustfmt; then
                tools="\"rustfmt\",$tools"
        fi
+       if use rust-src; then
+               tools="\"src\",$tools"
+       fi
 
        local rust_stage0_root
        if use system-bootstrap; then

Reply via email to