1 |
commit: bb8009bcf41dead415b616b66f05d58280325862 |
2 |
Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Jan 20 22:26:33 2022 +0000 |
4 |
Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Jan 20 22:26:42 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bb8009bc |
7 |
|
8 |
sys-devel/rust-std: add 1.58.1 |
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.58.1.ebuild | 155 ++++++++++++++++++++++++++++++ |
14 |
2 files changed, 156 insertions(+) |
15 |
|
16 |
diff --git a/sys-devel/rust-std/Manifest b/sys-devel/rust-std/Manifest |
17 |
index 408325747f02..bb93701440ed 100644 |
18 |
--- a/sys-devel/rust-std/Manifest |
19 |
+++ b/sys-devel/rust-std/Manifest |
20 |
@@ -3,3 +3,4 @@ DIST rustc-1.54.0-src.tar.xz 116286856 BLAKE2B 5ac47822646a0b6205f09282168b4d4dd |
21 |
DIST rustc-1.55.0-src.tar.xz 117197580 BLAKE2B 8d9739ce7571146aee0e07c6287de9a8c4f1a914606cd47819eb1ef118b15772ecf22d0d43d7732f03c234a013fa54a4a7f0578a3f136af518f71bf64a03305d SHA512 7522f2fa95d5af92472404ecc97d7d9e745e88c933196a83fa373ce1efff6db3c295e0e2afdbfa1ff00644554efa0c3c7f6c11f9119ecf9010cb440b3f27c2da |
22 |
DIST rustc-1.56.1-src.tar.xz 121798264 BLAKE2B 09677b0332022f28a0d80949a6735929dbf64276f7eb57195d8c33e6c80f13c903432ff77d8834093ab551677618fb1d385f2300e2b1b4c064f9c245c696be32 SHA512 193468e211cde9ebc5f6e30b8e3733b79bd8710fe6dd45c7ed8d4392f91010d30466787afd4d0b2041cd7dd994924fee8ad111048824e248bd994959e55bf15f |
23 |
DIST rustc-1.58.0-src.tar.xz 124348768 BLAKE2B e5a0d919a1ca1202e218cec3da93fc69cba163069b1f2b4051778a49184715579c14cd6b03baa0225b10a8f1adf758aca427c910d95dfa2e647bbf8b7d133785 SHA512 70104f4d3b474dcb9935200ef0503f29cb15f10d38ba8630e1dadbb384924dd9137fced647794699efe83ac88083e4ae5f45712f0e1c8bc0a6f8c23eecdb0aeb |
24 |
+DIST rustc-1.58.1-src.tar.xz 124353160 BLAKE2B 686c7272db544ad46f7fb01b4e05f24f4e08ff959a000cadfaef5d8fc413b93f5ed839077bc9715defc7a0a179af091f65c7a5d7104b0b3153f0654c237c094b SHA512 eff3279d2e519343cea542a9ae2daab592e44f35af344e33ff43ed55fc7c824511790d1991dd36a603d12465de8c3688e7194c2b9557f288c587ffa04738c2ce |
25 |
|
26 |
diff --git a/sys-devel/rust-std/rust-std-1.58.1.ebuild b/sys-devel/rust-std/rust-std-1.58.1.ebuild |
27 |
new file mode 100644 |
28 |
index 000000000000..b3528f3325e7 |
29 |
--- /dev/null |
30 |
+++ b/sys-devel/rust-std/rust-std-1.58.1.ebuild |
31 |
@@ -0,0 +1,155 @@ |
32 |
+# Copyright 2020-2022 Gentoo Authors |
33 |
+# Distributed under the terms of the GNU General Public License v2 |
34 |
+ |
35 |
+EAPI=8 |
36 |
+ |
37 |
+PYTHON_COMPAT=( python3_{8..10} ) |
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 |
+ ar = "$(tc-getAR ${CTARGET})" |
159 |
+ cc = "$(tc-getCC ${CTARGET})" |
160 |
+ cxx = "$(tc-getCXX ${CTARGET})" |
161 |
+ linker = "$(tc-getCC ${CTARGET})" |
162 |
+ ranlib = "$(tc-getRANLIB ${CTARGET})" |
163 |
+ $(usev 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 |
+} |