aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgentoo90 <gentoo90@gmail.com>2020-07-28 23:52:59 +0300
committerMikhail Pukhlikov <cynede@gentoo.org>2020-08-03 10:25:41 +0400
commit8395fe36d257a6da070961b98f39e2fe48d1f921 (patch)
treee7cbe00bcedbfc829c41b7032775069879305ef3
parentUpdate rust (diff)
downloadrust-8395fe36d257a6da070961b98f39e2fe48d1f921.tar.gz
rust-8395fe36d257a6da070961b98f39e2fe48d1f921.tar.bz2
rust-8395fe36d257a6da070961b98f39e2fe48d1f921.zip
dev-lang/rust-bin-9999: add "source" useflag
Downloads and installs the sourcecode. Required for RLS. Signed-off-by: Mikhail Pukhlikov <cynede@gentoo.org>
-rw-r--r--dev-lang/rust-bin/rust-bin-9999.ebuild15
1 files 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)