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, 30 Nov 2020 17:11:45
Message-Id: 1606756288.eb0dcc20fa2d63b660c35173c882ffd8de4f51e1.gyakovlev@gentoo
1 commit: eb0dcc20fa2d63b660c35173c882ffd8de4f51e1
2 Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
3 AuthorDate: Mon Nov 30 17:10:54 2020 +0000
4 Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
5 CommitDate: Mon Nov 30 17:11:28 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=eb0dcc20
7
8 sys-devel/rust-std: bump to 1.48.0
9
10 Package-Manager: Portage-3.0.11, 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.48.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 5c548978160..13dd3b050c9 100644
19 --- a/sys-devel/rust-std/Manifest
20 +++ b/sys-devel/rust-std/Manifest
21 @@ -1,2 +1,3 @@
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
26 diff --git a/sys-devel/rust-std/rust-std-1.48.0.ebuild b/sys-devel/rust-std/rust-std-1.48.0.ebuild
27 new file mode 100644
28 index 00000000000..e0bcdc1d61f
29 --- /dev/null
30 +++ b/sys-devel/rust-std/rust-std-1.48.0.ebuild
31 @@ -0,0 +1,154 @@
32 +# Copyright 2020 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 +}