sys-devel/rust-std: add 1.87.0_beta20250430

Signed-off-by: Matt Jolly <kangie@gentoo.org>
This commit is contained in:
Matt Jolly
2025-05-06 11:53:15 +10:00
parent 51c2f3dff7
commit 7eddb36b66
2 changed files with 182 additions and 0 deletions

View File

@@ -13,3 +13,5 @@ DIST rustc-1.85.1-src.tar.xz 274028992 BLAKE2B 1dddbbc0d14fe9551fd2eb59a47521ac7
DIST rustc-1.86.0-src.tar.xz 275696736 BLAKE2B 9f33a710a3e567d92f56091920643f5ef2ddf2ad52acb5d9ee78496a7b5dbc10da5a51c72cf2a6f66d543a531d3138a49767c98501ae4e885e03988d2ccfbb59 SHA512 9ce195e24a03765f7163de16271e3d19d731d4b80fcc2bfd919106c9d42543eade018f712f6947ea3c6e57c6cb2e6841596aa668d608b8da15101a7da14f3097
DIST rustc-1.87.0_beta20250420-src.tar.xz 283544556 BLAKE2B 70a59c7d695e881a4e21d500f19b7d83e3a86bc8d5dfaaaa28a4cd4631b12937a2743119e3181e84af7b348386c672f4e62675da8cfb399095fcdda527b072e0 SHA512 37e62954c21b0d5c232dca1d0fe476b165eb63b7315c1fcaa18068707f4fd00e2def09968ee1d243f62cb3eae3fbb4381493b8505179342705998dce08e23afe
DIST rustc-1.87.0_beta20250420-src.tar.xz.asc 801 BLAKE2B c0ed0686d3bc612e8b0edb96817928107905220328af81d2f9200552c3edb58d98ae8844f01b7dd20e59e6c0a173f6da11b2cd58d0c3b5d5f0bd8290528ea86c SHA512 e2e694feec13d8fb8d9b50442c0c2e3de5cef0a249730c945124880220e44d481b2109098c5a8479f765384a4298e293e63743c924e0866ed2e5aece3a35c98f
DIST rustc-1.87.0_beta20250430-src.tar.xz 283517896 BLAKE2B 5d86aa824662230a843576798a544ef5e3a49e0166b66c9ecc9926832e102562aac3493748085b7f38a71e5954206d27f7ab3e219a27d96b1c55a8ab8419851a SHA512 5c29e7513b70416f97ba7a5f9669600da9b695d8dc6df582aa6ffa017da5c38215d9a27584fa6f6b2309813127571eba49a3fef375a6598c607f007f41f6d3fe
DIST rustc-1.87.0_beta20250430-src.tar.xz.asc 801 BLAKE2B 4ecdc70a469bce016e7c92a77a8c088ed37375e994a820b24c67269358eed4bc465aa77c4974b1e72586b23737b1d25844394b5de36fd4427978eff20bd07102 SHA512 f8c10cf66e2fb791de7b994bba622d1f8e8df75e48fd8d30795edaa6316b935583b51e235520d2aa2578cfcea1dda17ff2256317c7f4bb1f6606f5afbd6a80d1

View File

@@ -0,0 +1,180 @@
# Copyright 2020-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{10..13} )
inherit flag-o-matic multiprocessing python-any-r1 rust-toolchain toolchain-funcs verify-sig
DESCRIPTION="Rust standard library, standalone (for crossdev)"
HOMEPAGE="https://www.rust-lang.org"
if [[ ${PV} = *9999* ]]; then
inherit git-r3
EGIT_REPO_URI="https://github.com/rust-lang/rust.git"
EGIT_SUBMODULES=(
"*"
"-src/gcc"
)
elif [[ ${PV} == *beta* ]]; then
# Identify the snapshot date of the beta release:
# curl -Ls static.rust-lang.org/dist/channel-rust-beta.toml | grep beta-src.tar.xz
betaver=${PV//*beta}
BETA_SNAPSHOT="${betaver:0:4}-${betaver:4:2}-${betaver:6:2}"
MY_P="rustc-beta"
SRC_URI="https://static.rust-lang.org/dist/${BETA_SNAPSHOT}/rustc-beta-src.tar.xz -> rustc-${PV}-src.tar.xz
verify-sig? ( https://static.rust-lang.org/dist/${BETA_SNAPSHOT}/rustc-beta-src.tar.xz.asc
-> rustc-${PV}-src.tar.xz.asc )
"
S="${WORKDIR}/${MY_P}-src"
else
MY_P="rustc-${PV}"
SRC_URI="https://static.rust-lang.org/dist/${MY_P}-src.tar.xz
verify-sig? ( https://static.rust-lang.org/dist/${MY_P}-src.tar.xz.asc )
"
S="${WORKDIR}/${MY_P}-src"
KEYWORDS="~amd64 ~arm ~arm64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86"
fi
LICENSE="|| ( MIT Apache-2.0 ) BSD-1 BSD-2 BSD-4"
SLOT="stable/$(ver_cut 1-2)"
# please do not keyword
#KEYWORDS="" #nowarn
IUSE="debug"
BDEPEND="
${PYTHON_DEPS}
~dev-lang/rust-${PV}:=
verify-sig? ( sec-keys/openpgp-keys-rust )
"
DEPEND="||
(
>="${CATEGORY}"/gcc-4.7:*
>="${CATEGORY/sys-devel/llvm-core}"/clang-3.5:*
)
"
RDEPEND="${DEPEND}"
# need full compiler to run tests
RESTRICT="test"
VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/rust.asc
QA_FLAGS_IGNORED="usr/lib/rust/${PV}/rustlib/.*/lib/lib.*.so"
#
# The cross magic
#
export CTARGET=${CTARGET:-${CHOST}}
if [[ ${CTARGET} == ${CHOST} ]] ; then
if [[ ${CATEGORY} == cross-* ]] ; then
export CTARGET=${CATEGORY#cross-}
fi
fi
is_cross() {
[[ ${CHOST} != ${CTARGET} ]]
}
toml_usex() {
usex "$1" true false
}
pkg_pretend() {
is_cross || die "${PN} should only be used for cross"
}
pkg_setup() {
python-any-r1_pkg_setup
}
src_prepare() {
default
}
src_configure() {
# do the great cleanup
strip-flags
filter-flags '-mcpu=*' '-march=*' '-mtune=*' '-m32' '-m64'
strip-unsupported-flags
local rust_root x
rust_root="$(rustc --print sysroot)"
rtarget="$(rust_abi ${CTARGET})"
rtarget="${ERUST_STD_RTARGET:-${rtarget}}" # some targets need to be custom.
rbuild="$(rust_abi ${CBUILD})"
rhost="$(rust_abi ${CHOST})"
echo
for x in CATEGORY rust_root rbuild rhost rtarget RUSTFLAGS CFLAGS CXXFLAGS LDFLAGS; do
einfo "$(printf '%10s' ${x^^}:) ${!x}"
done
cat <<- EOF > "${S}"/config.toml
[build]
build = "${rbuild}"
host = ["${rhost}"]
target = ["${rtarget}"]
cargo = "${rust_root}/bin/cargo"
rustc = "${rust_root}/bin/rustc"
submodules = false
python = "${EPYTHON}"
locked-deps = true
vendor = true
extended = true
verbose = 2
cargo-native-static = false
[install]
prefix = "${EPREFIX}/usr/lib/${PN}/${PV}"
sysconfdir = "etc"
docdir = "share/doc/rust"
bindir = "bin"
libdir = "lib"
mandir = "share/man"
[rust]
# https://github.com/rust-lang/rust/issues/54872
codegen-units-std = 1
optimize = true
debug = $(toml_usex debug)
debug-assertions = $(toml_usex debug)
debuginfo-level-rustc = 0
backtrace = true
incremental = false
default-linker = "$(tc-getCC)"
rpath = false
dist-src = false
remap-debuginfo = true
jemalloc = false
[dist]
src-tarball = false
[target.${rtarget}]
ar = "$(tc-getAR ${CTARGET})"
cc = "$(tc-getCC ${CTARGET})"
cxx = "$(tc-getCXX ${CTARGET})"
linker = "$(tc-getCC ${CTARGET})"
ranlib = "$(tc-getRANLIB ${CTARGET})"
$(usev elibc_musl 'crt-static = false')
EOF
einfo "${PN^} configured with the following settings:"
cat "${S}"/config.toml || die
}
src_compile() {
env RUST_BACKTRACE=1 \
"${EPYTHON}" ./x.py build -vv --config="${S}"/config.toml -j$(makeopts_jobs) \
library/std --stage 0 || die
}
src_test() {
ewarn "${PN} can't run tests"
}
src_install() {
local rustlib="lib/rust/${PV}/lib/rustlib"
dodir "/usr/${rustlib}"
pushd "build/${rhost}/stage0-sysroot/lib/rustlib" > /dev/null || die
cp -pPRv "${rtarget}" "${ED}/usr/${rustlib}" || die
popd > /dev/null || die
}