summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWANG Xuerui <xen0n@gentoo.org>2023-05-31 15:25:27 +0800
committerWANG Xuerui <xen0n@gentoo.org>2023-07-20 17:48:25 +0800
commitb65ec7188f25479e458186b9a41d89205fd8a859 (patch)
treed5e731c05a6d623f24b3384eff91c7838bc3ca1c
parentapp-emulation/virtualbox: sync live (diff)
downloadgentoo-b65ec7188f25479e458186b9a41d89205fd8a859.tar.gz
gentoo-b65ec7188f25479e458186b9a41d89205fd8a859.tar.bz2
gentoo-b65ec7188f25479e458186b9a41d89205fd8a859.zip
rust-toolchain.eclass: cosmetic cleanups
Re-tab the file, and reorganize the rust_abi and rust_all_arch_uris helpers so the keys are sorted alphabetically while preserving match order. No functional change intended. See: https://github.com/gentoo/gentoo/pull/31241 Signed-off-by: WANG Xuerui <xen0n@gentoo.org>
-rw-r--r--eclass/rust-toolchain.eclass70
1 files changed, 40 insertions, 30 deletions
diff --git a/eclass/rust-toolchain.eclass b/eclass/rust-toolchain.eclass
index df48d3fae264..ef4b2a91ef7d 100644
--- a/eclass/rust-toolchain.eclass
+++ b/eclass/rust-toolchain.eclass
@@ -36,21 +36,21 @@ rust_abi() {
case ${CTARGET%%*-} in
aarch64*gnu) echo aarch64-unknown-linux-gnu;;
aarch64*musl) echo aarch64-unknown-linux-musl;;
- mips64*) echo mips64-unknown-linux-gnuabi64;;
+ armv6j*h*) echo arm-unknown-linux-gnueabihf;;
+ armv6j*s*) echo arm-unknown-linux-gnueabi;;
+ armv7a*h*) echo armv7-unknown-linux-gnueabihf;;
+ i?86*) echo i686-unknown-linux-gnu;;
+ mips64*) echo mips64-unknown-linux-gnuabi64;;
+ mipsel*) echo mipsel-unknown-linux-gnu;;
+ mips*) echo mips-unknown-linux-gnu;;
powerpc64le*) echo powerpc64le-unknown-linux-gnu;;
powerpc64*) echo powerpc64-unknown-linux-gnu;;
- x86_64*gnu) echo x86_64-unknown-linux-gnu;;
+ powerpc*) echo powerpc-unknown-linux-gnu;;
+ riscv64*) echo riscv64gc-unknown-linux-gnu;;
+ s390x*) echo s390x-unknown-linux-gnu;;
+ x86_64*gnu) echo x86_64-unknown-linux-gnu;;
x86_64*musl) echo x86_64-unknown-linux-musl;;
- armv6j*s*) echo arm-unknown-linux-gnueabi;;
- armv6j*h*) echo arm-unknown-linux-gnueabihf;;
- armv7a*h*) echo armv7-unknown-linux-gnueabihf;;
- i?86*) echo i686-unknown-linux-gnu;;
- mipsel*) echo mipsel-unknown-linux-gnu;;
- mips*) echo mips-unknown-linux-gnu;;
- powerpc*) echo powerpc-unknown-linux-gnu;;
- s390x*) echo s390x-unknown-linux-gnu;;
- riscv64*) echo riscv64gc-unknown-linux-gnu;;
- *) echo ${CTARGET};;
+ *) echo ${CTARGET};;
esac
}
@@ -105,22 +105,32 @@ rust_arch_uri() {
#
rust_all_arch_uris()
{
- local uris=""
- uris+="abi_x86_64? ( elibc_glibc? ( $(rust_arch_uri x86_64-unknown-linux-gnu "$@") )
- elibc_musl? ( $(rust_arch_uri x86_64-unknown-linux-musl "$@") ) ) "
- uris+="arm? ( $(rust_arch_uri arm-unknown-linux-gnueabi "$@")
- $(rust_arch_uri arm-unknown-linux-gnueabihf "$@")
- $(rust_arch_uri armv7-unknown-linux-gnueabihf "$@") ) "
- uris+="arm64? ( elibc_glibc? ( $(rust_arch_uri aarch64-unknown-linux-gnu "$@") )
- elibc_musl? ( $(rust_arch_uri aarch64-unknown-linux-musl "$@") ) ) "
- uris+="mips? ( $(rust_arch_uri mips-unknown-linux-gnu "$@")
- $(rust_arch_uri mipsel-unknown-linux-gnu "$@")
- $(rust_arch_uri mips64-unknown-linux-gnuabi64 "$@") ) "
- uris+="ppc? ( $(rust_arch_uri powerpc-unknown-linux-gnu "$@") ) "
- uris+="ppc64? ( $(rust_arch_uri powerpc64-unknown-linux-gnu "$@")
- $(rust_arch_uri powerpc64le-unknown-linux-gnu "$@") ) "
- uris+="s390? ( $(rust_arch_uri s390x-unknown-linux-gnu "$@") ) "
- uris+="abi_x86_32? ( $(rust_arch_uri i686-unknown-linux-gnu "$@") ) "
- uris+="riscv? ( $(rust_arch_uri riscv64gc-unknown-linux-gnu "$@") ) "
- echo "${uris}"
+ echo "
+ abi_x86_32? ( $(rust_arch_uri i686-unknown-linux-gnu "$@") )
+ abi_x86_64? (
+ elibc_glibc? ( $(rust_arch_uri x86_64-unknown-linux-gnu "$@") )
+ elibc_musl? ( $(rust_arch_uri x86_64-unknown-linux-musl "$@") )
+ )
+ arm? (
+ $(rust_arch_uri arm-unknown-linux-gnueabi "$@")
+ $(rust_arch_uri arm-unknown-linux-gnueabihf "$@")
+ $(rust_arch_uri armv7-unknown-linux-gnueabihf "$@")
+ )
+ arm64? (
+ elibc_glibc? ( $(rust_arch_uri aarch64-unknown-linux-gnu "$@") )
+ elibc_musl? ( $(rust_arch_uri aarch64-unknown-linux-musl "$@") )
+ )
+ mips? (
+ $(rust_arch_uri mips-unknown-linux-gnu "$@")
+ $(rust_arch_uri mipsel-unknown-linux-gnu "$@")
+ $(rust_arch_uri mips64-unknown-linux-gnuabi64 "$@")
+ )
+ ppc? ( $(rust_arch_uri powerpc-unknown-linux-gnu "$@") )
+ ppc64? (
+ $(rust_arch_uri powerpc64-unknown-linux-gnu "$@")
+ $(rust_arch_uri powerpc64le-unknown-linux-gnu "$@")
+ )
+ riscv? ( $(rust_arch_uri riscv64gc-unknown-linux-gnu "$@") )
+ s390? ( $(rust_arch_uri s390x-unknown-linux-gnu "$@") )
+ "
}