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