Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev-lang/rust: enable rust-std-armv7 as an example #6

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion dev-lang/rust/rust-1.32.0.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,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 rls rustfmt system-llvm wasm ${ALL_LLVM_TARGETS[*]}"
IUSE="clippy cpu_flags_x86_sse2 debug doc libressl rls rustfmt rust-std-armv7 system-llvm wasm ${ALL_LLVM_TARGETS[*]}"

COMMON_DEPEND=">=app-eselect/eselect-rust-0.3_pre20150425
sys-libs/zlib
Expand Down Expand Up @@ -126,6 +126,10 @@ src_configure() {
if use wasm; then
rust_targets="${rust_targets},\"wasm32-unknown-unknown\""
fi

if use rust-std-armv7; then
rust_targets="${rust_targets},\"armv7-unknown-linux-gnueabihf\""
fi
rust_targets="${rust_targets#,}"

local extended="true" tools="\"cargo\","
Expand Down Expand Up @@ -207,6 +211,17 @@ src_configure() {
linker = "rust-lld"
EOF
fi


if use rust-std-armv7; then
cat <<- EOF >> "${S}"/config.toml
[target.armv7-unknown-linux-gnueabihf]
cc = "armv7a-unknown-linux-gnueabihf-gcc"
cxx = "armv7a-unknown-linux-gnueabihf-g++"
linker = "armv7a-unknown-linux-gnueabihf-gcc"
ar = "armv7a-unknown-linux-gnueabihf-ar"
EOF
fi
}

src_compile() {
Expand Down