commit:     5e9e7bb305a9b75402865257744c1a38bcdf91ac
Author:     Matt Jolly <kangie <AT> gentoo <DOT> org>
AuthorDate: Mon Apr 21 01:57:49 2025 +0000
Commit:     Matt Jolly <kangie <AT> gentoo <DOT> org>
CommitDate: Wed Apr 23 11:36:02 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5e9e7bb3

sys-devel/rust-std: add 1.87.0_beta20250420

Signed-off-by: Matt Jolly <kangie <AT> gentoo.org>

 sys-devel/rust-std/Manifest                        |   2 +
 .../rust-std/rust-std-1.87.0_beta20250420.ebuild   | 180 +++++++++++++++++++++
 2 files changed, 182 insertions(+)

diff --git a/sys-devel/rust-std/Manifest b/sys-devel/rust-std/Manifest
index 21072a944391..33469dce1f3a 100644
--- a/sys-devel/rust-std/Manifest
+++ b/sys-devel/rust-std/Manifest
@@ -11,3 +11,5 @@ DIST rustc-1.84.1-src.tar.xz 355078168 BLAKE2B 
849e8c909493bf76ce9749b9dcb196718
 DIST rustc-1.85.0-src.tar.xz 274011696 BLAKE2B 
9cb1c5b9fa9b0ee8a3150d634b58f4d14c38342f19cffbdcaa4e783150f9b3c516763d549d9998d90e11377cd59e9d9442a99079aafccdc005739b075574447a
 SHA512 
3e9c933d1d9b6e5fb081837cf07eb1638b1a6b4fd1cb607dd860c5021ba7b521edbaf8ba0fa8f182f62178b72a3e1a3e6b26675e8fb6530871137852a074443c
 DIST rustc-1.85.1-src.tar.xz 274028992 BLAKE2B 
1dddbbc0d14fe9551fd2eb59a47521ac7eaf783b8ebf5e89d3e82b38f3f1539c14626a86b6530a47e5a967d47a04db7a3daef568eb5164f42d98b6826346cffe
 SHA512 
d61afb4f00d0c63eef132e10ca5369202064ecad8ab5bcf4fbd62e9a20b2bd71840b2a769dadcf43452fc0448865975c9de1c129752caa9928d2757027bacf7c
 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

diff --git a/sys-devel/rust-std/rust-std-1.87.0_beta20250420.ebuild 
b/sys-devel/rust-std/rust-std-1.87.0_beta20250420.ebuild
new file mode 100644
index 000000000000..b3e050dba80c
--- /dev/null
+++ b/sys-devel/rust-std/rust-std-1.87.0_beta20250420.ebuild
@@ -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
+}

Reply via email to