mirror of
https://github.com/flatcar/scripts.git
synced 2025-11-27 05:21:34 +01:00
rust-toolchain.eclass: Sync with Gentoo
Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
This commit is contained in:
parent
fc0aca0068
commit
e90451ff2b
@ -373,6 +373,7 @@ eclass/python-utils-r1.eclass
|
|||||||
eclass/readme.gentoo-r1.eclass
|
eclass/readme.gentoo-r1.eclass
|
||||||
eclass/ruby-single.eclass
|
eclass/ruby-single.eclass
|
||||||
eclass/ruby-utils.eclass
|
eclass/ruby-utils.eclass
|
||||||
|
eclass/rust-toolchain.eclass
|
||||||
eclass/rpm.eclass
|
eclass/rpm.eclass
|
||||||
eclass/savedconfig.eclass
|
eclass/savedconfig.eclass
|
||||||
eclass/selinux-policy-2.eclass
|
eclass/selinux-policy-2.eclass
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# Copyright 1999-2023 Gentoo Authors
|
# Copyright 1999-2024 Gentoo Authors
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
|
|
||||||
# @ECLASS: rust-toolchain.eclass
|
# @ECLASS: rust-toolchain.eclass
|
||||||
@ -7,17 +7,14 @@
|
|||||||
# @SUPPORTED_EAPIS: 8
|
# @SUPPORTED_EAPIS: 8
|
||||||
# @BLURB: helps map gentoo arches to rust ABIs
|
# @BLURB: helps map gentoo arches to rust ABIs
|
||||||
# @DESCRIPTION:
|
# @DESCRIPTION:
|
||||||
# This eclass contains a src_unpack default phase function, and
|
# This eclass contains helper functions, to aid in proper rust-ABI handling for
|
||||||
# helper functions, to aid in proper rust-ABI handling for various
|
# various gentoo arches.
|
||||||
# gentoo arches.
|
|
||||||
|
|
||||||
case ${EAPI} in
|
case ${EAPI} in
|
||||||
8) ;;
|
8) ;;
|
||||||
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
|
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
inherit multilib-build
|
|
||||||
|
|
||||||
# @ECLASS_VARIABLE: RUST_TOOLCHAIN_BASEURL
|
# @ECLASS_VARIABLE: RUST_TOOLCHAIN_BASEURL
|
||||||
# @DESCRIPTION:
|
# @DESCRIPTION:
|
||||||
# This variable specifies the base URL used by the
|
# This variable specifies the base URL used by the
|
||||||
@ -48,7 +45,8 @@ rust_abi() {
|
|||||||
powerpc64le*) echo powerpc64le-unknown-linux-gnu;;
|
powerpc64le*) echo powerpc64le-unknown-linux-gnu;;
|
||||||
powerpc64*) echo powerpc64-unknown-linux-gnu;;
|
powerpc64*) echo powerpc64-unknown-linux-gnu;;
|
||||||
powerpc*) echo powerpc-unknown-linux-gnu;;
|
powerpc*) echo powerpc-unknown-linux-gnu;;
|
||||||
riscv64*) echo riscv64gc-unknown-linux-gnu;;
|
riscv64*gnu) echo riscv64gc-unknown-linux-gnu;;
|
||||||
|
riscv64*musl) echo riscv64gc-unknown-linux-musl;;
|
||||||
s390x*) echo s390x-unknown-linux-gnu;;
|
s390x*) echo s390x-unknown-linux-gnu;;
|
||||||
x86_64*gnu) echo x86_64-unknown-linux-gnu;;
|
x86_64*gnu) echo x86_64-unknown-linux-gnu;;
|
||||||
x86_64*musl) echo x86_64-unknown-linux-musl;;
|
x86_64*musl) echo x86_64-unknown-linux-musl;;
|
||||||
@ -56,24 +54,6 @@ rust_abi() {
|
|||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
# @FUNCTION: rust_all_abis
|
|
||||||
# @DESCRIPTION:
|
|
||||||
# Outputs a list of all the enabled Rust ABIs
|
|
||||||
rust_all_abis() {
|
|
||||||
if use multilib; then
|
|
||||||
local abi
|
|
||||||
local ALL_ABIS=()
|
|
||||||
for abi in $(multilib_get_enabled_abis); do
|
|
||||||
ALL_ABIS+=( $(rust_abi $(get_abi_CHOST ${abi})) )
|
|
||||||
done
|
|
||||||
local abi_list
|
|
||||||
IFS=, eval 'abi_list=${ALL_ABIS[*]}'
|
|
||||||
echo ${abi_list}
|
|
||||||
else
|
|
||||||
rust_abi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# @FUNCTION: rust_arch_uri
|
# @FUNCTION: rust_arch_uri
|
||||||
# @USAGE: <rust-ABI> <base-uri> [alt-distfile-basename]
|
# @USAGE: <rust-ABI> <base-uri> [alt-distfile-basename]
|
||||||
# @DESCRIPTION:
|
# @DESCRIPTION:
|
||||||
@ -127,7 +107,9 @@ rust_all_arch_uris()
|
|||||||
big-endian? ( $(rust_arch_uri powerpc64-unknown-linux-gnu "$@") )
|
big-endian? ( $(rust_arch_uri powerpc64-unknown-linux-gnu "$@") )
|
||||||
!big-endian? ( $(rust_arch_uri powerpc64le-unknown-linux-gnu "$@") )
|
!big-endian? ( $(rust_arch_uri powerpc64le-unknown-linux-gnu "$@") )
|
||||||
)
|
)
|
||||||
riscv? ( $(rust_arch_uri riscv64gc-unknown-linux-gnu "$@") )
|
riscv? (
|
||||||
|
elibc_glibc? ( $(rust_arch_uri riscv64gc-unknown-linux-gnu "$@") )
|
||||||
|
)
|
||||||
s390? ( $(rust_arch_uri s390x-unknown-linux-gnu "$@") )
|
s390? ( $(rust_arch_uri s390x-unknown-linux-gnu "$@") )
|
||||||
"
|
"
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user