commit:     0433bdce4b55fe0d3fb0071bcb826af0acef7d4d
Author:     Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
AuthorDate: Fri Sep 23 04:43:12 2022 +0000
Commit:     Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
CommitDate: Fri Sep 23 04:49:45 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0433bdce

dev-lang/rust-bin: improve musl envd file in 1.64.0

Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>

 dev-lang/rust-bin/rust-bin-1.64.0.ebuild | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/dev-lang/rust-bin/rust-bin-1.64.0.ebuild 
b/dev-lang/rust-bin/rust-bin-1.64.0.ebuild
index 9e2846e0a8ac..9e7e4048e675 100644
--- a/dev-lang/rust-bin/rust-bin-1.64.0.ebuild
+++ b/dev-lang/rust-bin/rust-bin-1.64.0.ebuild
@@ -152,12 +152,14 @@ multilib_src_install() {
        dosym "../../opt/${P}/lib/rustlib" "/usr/lib/rustlib-bin-${PV}"
        dosym "../../../opt/${P}/share/doc/rust" "/usr/share/doc/${P}"
 
-       # musl logic can be improved a bit, but fine as is for now
+       # make all capital underscored variable
+       local CARGO_TRIPLET="$(rust_abi)"
+       CARGO_TRIPLET="${CARGO_TRIPLET//-/_}"
+       CARGO_TRIPLET="${CARGO_TRIPLET^^}"
        cat <<-_EOF_ > "${T}/50${P}"
        LDPATH="${EPREFIX}/usr/lib/rust/lib"
        MANPATH="${EPREFIX}/usr/lib/rust/man"
-       $(use amd64 && usex elibc_musl 
'CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_RUSTFLAGS="-C 
target-feature=-crt-static"' '')
-       $(use arm64 && usex elibc_musl 
'CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_RUSTFLAGS="-C 
target-feature=-crt-static"' '')
+       $(usev elibc_musl "CARGO_TARGET_${CARGO_TRIPLET}_RUSTFLAGS=\"-C 
target-feature=-crt-static\"")
        _EOF_
        doenvd "${T}/50${P}"
 

Reply via email to