commit:     7dea7c05b03c12a5e6e826de9918b64912d0488c
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Thu Apr  3 18:12:23 2025 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Thu Apr  3 19:03:26 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7dea7c05

sys-devel/rust-std: add 1.86.0

Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 sys-devel/rust-std/Manifest               |   1 +
 sys-devel/rust-std/rust-std-1.86.0.ebuild | 152 ++++++++++++++++++++++++++++++
 2 files changed, 153 insertions(+)

diff --git a/sys-devel/rust-std/Manifest b/sys-devel/rust-std/Manifest
index a0feb8898626..21072a944391 100644
--- a/sys-devel/rust-std/Manifest
+++ b/sys-devel/rust-std/Manifest
@@ -10,3 +10,4 @@ DIST rustc-1.83.0-src.tar.xz 353808388 BLAKE2B 
217c85f7351a7c57a2684da2c7c81a320
 DIST rustc-1.84.1-src.tar.xz 355078168 BLAKE2B 
849e8c909493bf76ce9749b9dcb1967180223b91a41d690bc477e78557d4e24949c9a8d8276d824af8c54ad62bc4a998e7a8efbc0bbd2008a4f64f51a7690d48
 SHA512 
f1cc4765736551508408126e44086988e8ddc30c1a929bf7b61c6be85ad0d65928dd5fb1041cfaeee8eb37d2208f2c1917e276aef2bc9a8e40e34f6713b349e1
 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

diff --git a/sys-devel/rust-std/rust-std-1.86.0.ebuild 
b/sys-devel/rust-std/rust-std-1.86.0.ebuild
new file mode 100644
index 000000000000..c81b21f0667a
--- /dev/null
+++ b/sys-devel/rust-std/rust-std-1.86.0.ebuild
@@ -0,0 +1,152 @@
+# 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
+
+DESCRIPTION="Rust standard library, standalone (for crossdev)"
+HOMEPAGE="https://www.rust-lang.org";
+SRC_URI="https://static.rust-lang.org/dist/rustc-${PV}-src.tar.xz";
+S="${WORKDIR}/${P/-std/c}-src"
+
+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}:=
+"
+DEPEND="||
+       (
+               >="${CATEGORY}"/gcc-4.7:*
+               >="${CATEGORY/sys-devel/llvm-core}"/clang-3.5:*
+       )
+"
+RDEPEND="${DEPEND}"
+
+# need full compiler to run tests
+RESTRICT="test"
+
+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