Skip to content

Commit

Permalink
dev-lang/rust-bin-9999: add "rust-analyzer" useflag
Browse files Browse the repository at this point in the history
RLS - old and busted.
rust-analyzer - new hotness.

Signed-off-by: Mikhail Pukhlikov <[email protected]>
  • Loading branch information
gentoo90 authored and cnd committed Aug 3, 2020
1 parent 8395fe3 commit 2260083
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions dev-lang/rust-bin/rust-bin-9999.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ SLOT="nightly"
KEYWORDS=""
RESTRICT="network-sandbox"

IUSE="clippy cpu_flags_x86_sse2 doc libressl rls rustfmt source ${ALL_RUSTLIB_TARGETS[*]}"
IUSE="clippy cpu_flags_x86_sse2 doc libressl rls rust-analyzer rustfmt source ${ALL_RUSTLIB_TARGETS[*]}"

CDEPEND="
>=app-eselect/eselect-rust-0.3_pre20150425
Expand All @@ -46,7 +46,8 @@ RDEPEND="${CDEPEND}
!dev-util/cargo
"
REQUIRED_USE="x86? ( cpu_flags_x86_sse2 )
rls? ( source )"
rls? ( source )
rust-analyzer? ( source )"

QA_PREBUILT="
opt/${P}/bin/*-${PV}
Expand Down Expand Up @@ -96,6 +97,10 @@ src_install() {
local analysis=$(grep 'analysis' ./components)
components="${components},rls-preview,${analysis}"
fi
if use rust-analyzer; then
local analysis=$(grep 'analysis' ./components)
components="${components},rust-analyzer-preview,${analysis}"
fi
use rustfmt && components="${components},rustfmt-preview"

elog "installing components: ${components}"
Expand Down Expand Up @@ -140,6 +145,11 @@ src_install() {
mv "${D}/opt/${P}/bin/rls" "${D}/opt/${P}/bin/${rls}" || die
dosym "../../opt/${P}/bin/${rls}" "/usr/bin/${rls}"
fi
if use rust-analyzer; then
local rust_analyzer=rust-analyzer-bin-${PV}
mv "${D}/opt/${P}/bin/rust-analyzer" "${D}/opt/${P}/bin/${rust_analyzer}" || die
dosym "../../opt/${P}/bin/${rust_analyzer}" "/usr/bin/${rust_analyzer}"
fi
if use rustfmt; then
local rustfmt=rustfmt-bin-${PV}
local cargo_fmt=cargo-fmt-bin-${PV}
Expand Down Expand Up @@ -170,6 +180,9 @@ src_install() {
if use rls; then
echo /usr/bin/rls >> "${T}/provider-${P}"
fi
if use rust-analyzer; then
echo /usr/bin/rust-analyzer >> "${T}/provider-${P}"
fi
if use rustfmt; then
echo /usr/bin/rustfmt >> "${T}/provider-${P}"
echo /usr/bin/cargo-fmt >> "${T}/provider-${P}"
Expand Down

0 comments on commit 2260083

Please sign in to comment.