Gentoo Archives: gentoo-commits

From: Georgy Yakovlev <gyakovlev@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-devel/rust-std/
Date: Mon, 13 Sep 2021 15:27:18
Message-Id: 1631546809.852dcf13b1556c3561851681fc87cdec7c36da81.gyakovlev@gentoo
1 commit: 852dcf13b1556c3561851681fc87cdec7c36da81
2 Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
3 AuthorDate: Mon Sep 13 15:26:49 2021 +0000
4 Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
5 CommitDate: Mon Sep 13 15:26:49 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=852dcf13
7
8 sys-devel/rust-std: add 1.55.0
9
10 Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>
11
12 sys-devel/rust-std/Manifest | 1 +
13 sys-devel/rust-std/rust-std-1.55.0.ebuild | 154 ++++++++++++++++++++++++++++++
14 2 files changed, 155 insertions(+)
15
16 diff --git a/sys-devel/rust-std/Manifest b/sys-devel/rust-std/Manifest
17 index ef1b6bae41a..30d98fdbce7 100644
18 --- a/sys-devel/rust-std/Manifest
19 +++ b/sys-devel/rust-std/Manifest
20 @@ -2,3 +2,4 @@ DIST rustc-1.51.0-src.tar.xz 109596164 BLAKE2B c1ac89655adfe7db8005476d42c748cf1
21 DIST rustc-1.52.1-src.tar.xz 115109508 BLAKE2B c5d73f5884037d287d88ba9fdaf63a36678b692e1b510920045797ab29f1660f05cda901e19411ff83ec3084c4130034c269976b1056220f3e629cff116d07f0 SHA512 55f5053ce40d4eba4663052817aef6a6275139ca229c89cd1ec44711458b412720203301d8c7975aac5720a91fcaf21847f8184f641cbb0004f722520283c73c
22 DIST rustc-1.53.0-src.tar.xz 115686332 BLAKE2B fa068f89d42f927fdc79ee31aad1386eaf2aa596a060e059c5a1a73fe48c48d008fc952cd6c7912b743e41d77a94b205639eed0f728b2539b62f18a772cabfe3 SHA512 70485cf7a0f7fc36ee31644e546374079dc387a85b44e5e793707fd0a4d7ca05d311291e78b86db955485d8f21c47ff9e1908acc4da68ba04929287213a40c24
23 DIST rustc-1.54.0-src.tar.xz 116286856 BLAKE2B 5ac47822646a0b6205f09282168b4d4ddcace9f6bc8f242c890327ca4074626f129514f8bcae5c5556015745f718990cce490658076f5cd3526623439540416b SHA512 5162f85b43ca2c5af93fdbfb2597d75df8a838f7fcc025a5298499ce1043db50f1ea2fbba753e47ce5daad3d80d4b612acf6527ef902c34117763e687fdbbcfa
24 +DIST rustc-1.55.0-src.tar.xz 117197580 BLAKE2B 8d9739ce7571146aee0e07c6287de9a8c4f1a914606cd47819eb1ef118b15772ecf22d0d43d7732f03c234a013fa54a4a7f0578a3f136af518f71bf64a03305d SHA512 7522f2fa95d5af92472404ecc97d7d9e745e88c933196a83fa373ce1efff6db3c295e0e2afdbfa1ff00644554efa0c3c7f6c11f9119ecf9010cb440b3f27c2da
25
26 diff --git a/sys-devel/rust-std/rust-std-1.55.0.ebuild b/sys-devel/rust-std/rust-std-1.55.0.ebuild
27 new file mode 100644
28 index 00000000000..7ca481644a6
29 --- /dev/null
30 +++ b/sys-devel/rust-std/rust-std-1.55.0.ebuild
31 @@ -0,0 +1,154 @@
32 +# Copyright 2020-2021 Gentoo Authors
33 +# Distributed under the terms of the GNU General Public License v2
34 +
35 +EAPI=7
36 +
37 +PYTHON_COMPAT=( python3_{7,8,9} )
38 +
39 +inherit flag-o-matic multiprocessing python-any-r1 rust-toolchain toolchain-funcs
40 +
41 +DESCRIPTION="Rust standard library, standalone (for crossdev)"
42 +HOMEPAGE="https://www.rust-lang.org"
43 +SRC_URI="https://static.rust-lang.org/dist/rustc-${PV}-src.tar.xz"
44 +
45 +LICENSE="|| ( MIT Apache-2.0 ) BSD-1 BSD-2 BSD-4 UoI-NCSA"
46 +SLOT="stable/$(ver_cut 1-2)"
47 +# please do not keyword
48 +#KEYWORDS="" #nowarn
49 +IUSE="debug"
50 +
51 +BDEPEND="
52 + ${PYTHON_DEPS}
53 + ~dev-lang/rust-${PV}:=
54 +"
55 +
56 +DEPEND="||
57 + (
58 + >="${CATEGORY}"/gcc-4.7:*
59 + >="${CATEGORY}"/clang-3.5:*
60 + )
61 +"
62 +
63 +RDEPEND="${DEPEND}"
64 +
65 +# need full compiler to run tests
66 +RESTRICT="test"
67 +
68 +QA_FLAGS_IGNORED="usr/lib/rust/${PV}/rustlib/.*/lib/lib.*.so"
69 +
70 +S="${WORKDIR}/${P/-std/c}-src"
71 +
72 +#
73 +# The cross magic
74 +#
75 +export CTARGET=${CTARGET:-${CHOST}}
76 +if [[ ${CTARGET} == ${CHOST} ]] ; then
77 + if [[ ${CATEGORY} == cross-* ]] ; then
78 + export CTARGET=${CATEGORY#cross-}
79 + fi
80 +fi
81 +
82 +is_cross() {
83 + [[ ${CHOST} != ${CTARGET} ]]
84 +}
85 +
86 +toml_usex() {
87 + usex "$1" true false
88 +}
89 +
90 +pkg_pretend() {
91 + is_cross || die "${PN} should only be used for cross"
92 +}
93 +
94 +pkg_setup() {
95 + python-any-r1_pkg_setup
96 +}
97 +
98 +src_prepare() {
99 + default
100 +}
101 +
102 +src_configure() {
103 + # do the great cleanup
104 + strip-flags
105 + filter-flags '-mcpu=*' '-march=*' '-mtune=*' '-m32' '-m64'
106 + strip-unsupported-flags
107 +
108 + local rust_root x
109 + rust_root="$(rustc --print sysroot)"
110 + rtarget="$(rust_abi ${CTARGET})"
111 + rtarget="${ERUST_STD_RTARGET:-${rtarget}}" # some targets need to be custom.
112 + rbuild="$(rust_abi ${CBUILD})"
113 + rhost="$(rust_abi ${CHOST})"
114 +
115 + echo
116 + for x in CATEGORY rust_root rbuild rhost rtarget RUSTFLAGS CFLAGS CXXFLAGS LDFLAGS; do
117 + einfo "$(printf '%10s' ${x^^}:) ${!x}"
118 + done
119 +
120 + cat <<- EOF > "${S}"/config.toml
121 + [build]
122 + build = "${rbuild}"
123 + host = ["${rhost}"]
124 + target = ["${rtarget}"]
125 + cargo = "${rust_root}/bin/cargo"
126 + rustc = "${rust_root}/bin/rustc"
127 + submodules = false
128 + python = "${EPYTHON}"
129 + locked-deps = true
130 + vendor = true
131 + extended = true
132 + verbose = 2
133 + cargo-native-static = false
134 + [install]
135 + prefix = "${EPREFIX}/usr/lib/${PN}/${PV}"
136 + sysconfdir = "etc"
137 + docdir = "share/doc/rust"
138 + bindir = "bin"
139 + libdir = "lib"
140 + mandir = "share/man"
141 + [rust]
142 + # https://github.com/rust-lang/rust/issues/54872
143 + codegen-units-std = 1
144 + optimize = true
145 + debug = $(toml_usex debug)
146 + debug-assertions = $(toml_usex debug)
147 + debuginfo-level-rustc = 0
148 + backtrace = true
149 + incremental = false
150 + default-linker = "$(tc-getCC)"
151 + rpath = false
152 + dist-src = false
153 + remap-debuginfo = true
154 + jemalloc = false
155 + [dist]
156 + src-tarball = false
157 + [target.${rtarget}]
158 + cc = "$(tc-getCC ${CTARGET})"
159 + cxx = "$(tc-getCXX ${CTARGET})"
160 + linker = "$(tc-getCC ${CTARGET})"
161 + ar = "$(tc-getAR ${CTARGET})"
162 + $(usex elibc_musl 'crt-static = false' '')
163 + EOF
164 +
165 + einfo "${PN^} configured with the following settings:"
166 + cat "${S}"/config.toml || die
167 +}
168 +
169 +src_compile() {
170 + env RUST_BACKTRACE=1 \
171 + "${EPYTHON}" ./x.py build -vv --config="${S}"/config.toml -j$(makeopts_jobs) \
172 + library/std --stage 0 || die
173 +}
174 +
175 +src_test() {
176 + ewarn "${PN} can't run tests"
177 +}
178 +
179 +src_install() {
180 + local rustlib="lib/rust/${PV}/lib/rustlib"
181 + dodir "/usr/${rustlib}"
182 + pushd "build/${rhost}/stage0-sysroot/lib/rustlib" > /dev/null || die
183 + cp -pPRv "${rtarget}" "${ED}/usr/${rustlib}" || die
184 + popd > /dev/null || die
185 +}