Skip to content

Commit

Permalink
dev-lang/rust-bin: add IUSE=profiler
Browse files Browse the repository at this point in the history
Parallel to dev-lang/rust's IUSE=profiler.

See: gentoo#35085 (comment)
Signed-off-by: WANG Xuerui <xen0n@gentoo.org>
  • Loading branch information
xen0n committed Mar 7, 2024
1 parent 7f5bd8b commit 191f8b6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions dev-lang/rust-bin/metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
</maintainer>
<use>
<flag name="clippy">Install clippy, Rust code linter</flag>
<flag name="profiler">Build the profiler runtime and rust-demangler tool (needed for '-C profile-generate' or '-C instrument-coverage' codegen opts)</flag>
<flag name="rustfmt">Install rustfmt, Rust code formatter</flag>
<flag name="rust-analyzer">Install rust-analyzer, A Rust compiler front-end for IDEs (language server)</flag>
<flag name="rust-src">Install rust-src, needed by developer tools and for build-std (cross)</flag>
Expand Down
7 changes: 6 additions & 1 deletion dev-lang/rust-bin/rust-bin-1.76.0.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ SRC_URI="$(rust_all_arch_uris ${MY_P})
LICENSE="|| ( MIT Apache-2.0 ) BSD BSD-1 BSD-2 BSD-4"
SLOT="stable"
KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~s390 ~x86"
IUSE="big-endian clippy cpu_flags_x86_sse2 doc prefix rust-analyzer rust-src rustfmt"
IUSE="big-endian clippy cpu_flags_x86_sse2 doc prefix profiler rust-analyzer rust-src rustfmt"

DEPEND=""

Expand Down Expand Up @@ -111,6 +111,7 @@ multilib_src_install() {
local components="rustc,cargo,${std}"
use doc && components="${components},rust-docs"
use clippy && components="${components},clippy-preview"
use profiler && components="${components},rust-demangler-preview"
use rustfmt && components="${components},rustfmt-preview"
use rust-analyzer && components="${components},rust-analyzer-preview,${analysis}"
# Rust component 'rust-src' is extracted from separate archive
Expand Down Expand Up @@ -148,6 +149,7 @@ multilib_src_install() {
)

use clippy && symlinks+=( clippy-driver cargo-clippy )
use profiler && symlinks+=( rust-demangler )
use rustfmt && symlinks+=( rustfmt cargo-fmt )
use rust-analyzer && symlinks+=( rust-analyzer )

Expand Down Expand Up @@ -195,6 +197,9 @@ multilib_src_install() {
echo /usr/bin/clippy-driver >> "${T}/provider-${P}"
echo /usr/bin/cargo-clippy >> "${T}/provider-${P}"
fi
if use profiler; then
echo /usr/bin/rust-demangler >> "${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 191f8b6

Please sign in to comment.