Skip to content

Commit

Permalink
Add rust-analyzer to rust
Browse files Browse the repository at this point in the history
Fix rust-9999 compilation.
Fix pijul license.

Signed-off-by: Mikhail Pukhlikov <[email protected]>
  • Loading branch information
o01eg authored and cnd committed Sep 10, 2020
1 parent cc2208c commit ec149d4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
19 changes: 16 additions & 3 deletions dev-lang/rust/rust-9999.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,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 libressl miri parallel-compiler rls rustfmt system-llvm wasm sanitize ${ALL_LLVM_TARGETS[*]}"
IUSE="clippy cpu_flags_x86_sse2 debug doc libressl miri parallel-compiler rls rustfmt rust-analyzer system-llvm wasm sanitize ${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
Expand Down Expand Up @@ -118,6 +118,7 @@ pre_build_checks() {
M=$(( $(usex clippy 128 0) + ${M} ))
M=$(( $(usex miri 128 0) + ${M} ))
M=$(( $(usex rls 512 0) + ${M} ))
M=$(( $(usex rust-analyzer 512 0) + ${M} ))
M=$(( $(usex rustfmt 256 0) + ${M} ))
M=$(( $(usex system-llvm 0 2048) + ${M} ))
M=$(( $(usex wasm 256 0) + ${M} ))
Expand Down Expand Up @@ -181,7 +182,7 @@ src_configure() {
if use system-llvm; then
# un-hardcode rust-lld linker for this target
# https://bugs.gentoo.org/715348
sed -i '/linker:/ s/rust-lld/wasm-ld/' src/librustc_target/spec/wasm32_base.rs || die
sed -i '/linker:/ s/rust-lld/wasm-ld/' compiler/rustc_target/src/spec/wasm32_base.rs || die
fi
fi
rust_targets="${rust_targets#,}"
Expand All @@ -194,11 +195,17 @@ src_configure() {
tools="\"miri\",$tools"
fi
if use rls; then
tools="\"rls\",\"analysis\",\"src\",$tools"
tools="\"rls\",$tools"
fi
if use rustfmt; then
tools="\"rustfmt\",$tools"
fi
if use rust-analyzer; then
tools="\"rust-analyzer\",$tools"
fi
if [ use rls -o use rust-analyzer ]; then
tools="\"analysis\",\"src\",$tools"
fi

rust_target="$(rust_abi)"

Expand Down Expand Up @@ -420,6 +427,9 @@ src_install() {
if use rls; then
mv "${ED}/usr/bin/rls" "${ED}/usr/bin/rls-${PV}" || die
fi
if use rust-analyzer; then
mv "${ED}/usr/bin/rust-analyzer" "${ED}/usr/bin/rust-analyzer-${PV}" || die
fi
if use rustfmt; then
mv "${ED}/usr/bin/rustfmt" "${ED}/usr/bin/rustfmt-${PV}" || die
mv "${ED}/usr/bin/cargo-fmt" "${ED}/usr/bin/cargo-fmt-${PV}" || die
Expand Down Expand Up @@ -472,6 +482,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
2 changes: 1 addition & 1 deletion dev-vcs/pijul/pijul-0.12.2.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ SRC_URI="$(cargo_crate_uris ${CRATES})"
RESTRICT="mirror"
# License set may be more restrictive as OR is not respected
# use cargo-license for a more accurate license picture
LICENSE="Apache-2.0 Apache-2.0 WITH LLVM-exception BSD-2-Clause BSD-3-Clause BSL-1.0 CC0-1.0 GPL-2.0 GPL-2.0+ GPL-3.0 ISC LGPL-3.0 MIT Unlicense Zlib"
LICENSE="Apache-2.0 MIT"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""
Expand Down

0 comments on commit ec149d4

Please sign in to comment.