Gentoo Archives: gentoo-commits

From: Georgy Yakovlev <gyakovlev@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/rust/
Date: Tue, 13 Oct 2020 04:02:58
Message-Id: 1602561672.6e3cb0ba351a9358e75eda51bdd30d71e9b260ff.gyakovlev@gentoo
1 commit: 6e3cb0ba351a9358e75eda51bdd30d71e9b260ff
2 Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
3 AuthorDate: Tue Oct 13 03:36:02 2020 +0000
4 Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
5 CommitDate: Tue Oct 13 04:01:12 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6e3cb0ba
7
8 dev-lang/rust: drop old
9
10 Package-Manager: Portage-3.0.8, Repoman-3.0.1
11 Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>
12
13 dev-lang/rust/Manifest | 15 --
14 dev-lang/rust/rust-1.44.1.ebuild | 502 ---------------------------------------
15 2 files changed, 517 deletions(-)
16
17 diff --git a/dev-lang/rust/Manifest b/dev-lang/rust/Manifest
18 index 9e09ade946e..52fc44542f4 100644
19 --- a/dev-lang/rust/Manifest
20 +++ b/dev-lang/rust/Manifest
21 @@ -1,17 +1,3 @@
22 -DIST rust-1.43.1-aarch64-unknown-linux-gnu.tar.xz 104148868 BLAKE2B ac5db9eb58c502253d001e0c93aef867bc584d045960a1d3c2caf6772a7c1f4fbad7da579d7c72b3376804f61f1332a54e9fc7099ba5f4a65f7e5435df28894a SHA512 b54fad5493344d2370bd77110f0ffb0231f41ab8aa9707e9303304957c5d9067dc83089432eb175605b78dc771dfcf7abfcce63d7fecdbb759dd224c17d12da0
23 -DIST rust-1.43.1-arm-unknown-linux-gnueabi.tar.xz 104779424 BLAKE2B 63c05d7403970bd4a237a6b690bcb8e78f310816a953af43da8d258a74102cd560c8674656c2036b1f391dc964ba6d2be2736bc10686c2365cc332b5c76a5502 SHA512 ea2eae6da6c757c07cf9631c706365c743c58f28b514444763ea70fed4c8fcefc5c36d55136afffc2f5e0d25e9b1fdf3243cb9def7e0f57e37b5a4783d44a61b
24 -DIST rust-1.43.1-arm-unknown-linux-gnueabihf.tar.xz 103569032 BLAKE2B fc94eeb777a72fcb1b2821b5d10bb9eaca535d76e8caee3d06aed989107460e00146516c5be5714e9739c49d5170809fc132624f9a035afba146db883346c57a SHA512 1c523dafceb29f916a192261f673048c8f781453bcee237e0e333d694d7d7b71735544906f2edea9e0a8a48fc66a478645ae8ae865a171f4f9a94f0d8e6800c1
25 -DIST rust-1.43.1-armv7-unknown-linux-gnueabihf.tar.xz 108430484 BLAKE2B a3c57930b4e7096f409a2129abef60fbdfadad59f29e428296f3151187eac286e82bdb2d0ca879db87563cdc707dbcabbb5e9048b54303653209b98268ab9cf3 SHA512 0812b3229dd47f1b5cadb49020e68d28b4267ac0489d0c2e448f21e3b0b6519bbf216ac9b20b747e035033842a6eb3b13a98706f2eddca2c088d9396dcb2c21e
26 -DIST rust-1.43.1-i686-unknown-linux-gnu.tar.xz 125731548 BLAKE2B 3a3278e409a69f3e8195bab39871b5594571c1c8f2ea2a5f8c9786a739f709381c13c1b2a3209ef62cb7c5b8aec47dd769cf3e658ed57e5037522759fa1a244e SHA512 c7423bccfb15f3df6043ec1d81203c9db9b3229dedd347cab09d3cc3b183f53aa0707f59964efccd63418e1c6ad21e7ee7dcc1495eda8c4ecb55ee8e6b3ac034
27 -DIST rust-1.43.1-mips-unknown-linux-gnu.tar.xz 95924004 BLAKE2B fc1da442dfaa535b81029ed40a85cd0d55766d84c34f0d97bf36376c44e44fd5305b429854b9c964515e10f83a06b36a6ad9daae5714e142491d99e58b1d0a07 SHA512 fe3b11e586d506dc917f0e04009a994a16575ac534a2716b49e66a0344060a26ee6c7e912b6cd7b5f010a97f59604515f899bc1b6c38f0ea86e8cecc20152dd6
28 -DIST rust-1.43.1-mips64-unknown-linux-gnuabi64.tar.xz 100980364 BLAKE2B 12439df511c3ad43ed24cb0e648a212314a747e203680929ed3e136505eb29af3dcb007162aaa337fbac56a9b1b8f1c405217756ec712c400bc0f4d9aefd64b8 SHA512 6c0d7f172e76e21596d305df7b1a38fde66a946972765de92ccc139cf8f2e8755864b7bd94328b9639023df6be51af08428f41ed78de4ba8d43620673b9f7ecb
29 -DIST rust-1.43.1-mipsel-unknown-linux-gnu.tar.xz 98512180 BLAKE2B b5e8cdf2b8d65cc39bfb325afda9ae75a360967a4f6f413f3b01257bc34130fcc873dc128a4e48bbcad774d69b9a4aae0d4a8182819a4411809af6a0c636b403 SHA512 cb01eac951384fbf2ead5b7d4acbf92485de0bbaa7e3a272a46a8934066d720d248a19a67ffc88b7b239c15478e8691b94302807dc7652e042c9b8edded6da12
30 -DIST rust-1.43.1-powerpc-unknown-linux-gnu.tar.xz 105007576 BLAKE2B 8392f36025ca91742fad9755c945b42e616272cc97c33087090c6462a5ba9f1de82a0167ed53568b5cdd4c593464ed2858811fd0c9ae8559a1cba37be6db5305 SHA512 d10da49f19b79f843ae369bdff3e5040b93934dc50dac3c09bd346c24dfa7394364da647c08206d5cef4c853b7e59d1062c16e6eeba0ffc01736eeba63dd3eb6
31 -DIST rust-1.43.1-powerpc64-unknown-linux-gnu.tar.xz 107189572 BLAKE2B ba561d45b8f9a7f446b17313d92db31b30a07d657dbc59667076ee216d66e4b2ec3811821bc6d1fde6bba811d2c46473c6e3bc06162fe4e1ffe040ad23542742 SHA512 695591807892c8f08801cd145ebc6a91ee4222000210baaaa0d6c8acf1ac6a96f4bf2566871def04d15a9965b7e3ea4287e37d7851fb14010518694d8ede75e6
32 -DIST rust-1.43.1-powerpc64le-unknown-linux-gnu.tar.xz 112921244 BLAKE2B 9fa67664fc90c1f6095d98b756cae747be2ad863b894b393d4e9ecc3a1bd527b0d26f1bae2988981b98d4d582d2b60a18c62b3db3b5fa017439e034f576e7582 SHA512 da447ec44ebf998290a73420437c8d434a6c196cfe1c3331a9adf40abf7acd97a231e352a8626bbfa961da8e0c4f450aa59d573254257f72cce4068eeb8112a1
33 -DIST rust-1.43.1-s390x-unknown-linux-gnu.tar.xz 119547480 BLAKE2B 8ce0d64e2d47f23cb927f3ea3a0f469e3cafc191ac1d47e580bce6cf0b35887484542f7d1b857d9bace5f696a072adb7e17e8c5f64af9bf1fbcc305707a15f9f SHA512 f087e50a91b1cc4a12bf15aea1cefbda9b89518febcecc0d56ea7d0a6a682be06cff7777d0a0b4812e96f3fb3295e7799bf200c1599c88cb7083a78d5002f14a
34 -DIST rust-1.43.1-x86_64-unknown-linux-gnu.tar.xz 112817212 BLAKE2B c6153889d9872ed5a60bfc43bc8c98e71654fffdd79ce775c3eb4376ed4714c5532e6aaecb769e447f3ae0bb7a11aed75754a5e879404742cb0813080dcf67eb SHA512 2fc573ca2826d9f03044f746ae4d7715b4e31b9ac933289607aa3449a538bb4dfd519540576a1d0d286c0d754a7ba6ce38beef6aded1090d3af3091b6ba2a9ee
35 -DIST rust-1.43.1-x86_64-unknown-linux-musl.tar.xz 103345832 BLAKE2B c16930854ea5e825e1338fdde3966e24d3505230891ab4e10160c5482298996768d8cee9890eadd486bfca41ebd5c9f38f7b7ead35a7848e59e409df8eaf9bdf SHA512 9f6ce2a5eaf98dc20b4ed88dbe60e8fb014ef3e7e82f5c31a28cf0f916d996271929cadeaf39a869f548aafb311f022acb408d51d4312c849c71843bc37ca202
36 DIST rust-1.44.1-aarch64-unknown-linux-gnu.tar.xz 101259004 BLAKE2B c00274660698c5e980a6fe28839f96783989bc5f102025a5e2b63466928f697afc3c70ff8efd00b525ea4b88823585e801690e6c05b246abf5600af80f911a07 SHA512 97a67addb5995f504d7326a500d1b40c52cc6e6e6f6e946adabcf825ce9b64272232a24bc30ce36e3ea63ccda4b980f3b7b61b0e88a8554f021b731ad79a35f1
37 DIST rust-1.44.1-arm-unknown-linux-gnueabi.tar.xz 107474900 BLAKE2B 1b21f28b12507cba83ede592670b715365b1ca1fa311dc70108404bc7fa199914716cf7e5560a682ccf4f37bfaf91357f547456a032b4914e75543fdb7e8e84f SHA512 5bb406cc999317a15988b434c3de53d11e3823359fd3dd798de8195fc2e7e7b32830c7cceb1cb7089f47b333346c42fd4153ba1b441799d89fa27207383b7043
38 DIST rust-1.44.1-arm-unknown-linux-gnueabihf.tar.xz 105267436 BLAKE2B 6e4c13028dc1751970b04b99db64be6e1ddbbc3b754318e3eabe03e7ae65031c4a5ed87582ec0ffa605a7ac69bee32c5fd48c6dcd84f298d73199a7f7d1c731f SHA512 fffadfc6d8317512ed50df97785a7d0094f59b9465ce5e762c45d6a3a484cdb3c04a72ac49c3d61abad898503378d841ed6abaa16a072aa6adc9069619e26a49
39 @@ -54,7 +40,6 @@ DIST rust-1.46.0-powerpc64le-unknown-linux-gnu.tar.xz 130200900 BLAKE2B d38a7f13
40 DIST rust-1.46.0-s390x-unknown-linux-gnu.tar.xz 134521076 BLAKE2B d3efd71dd7db812736680929185ad5f58a2dbf7d1b8a6f851834dd7b41713fc171dbcdf2472bedc13751bfeed58070d919d2a1138765ab75c0f4bdf817cb6418 SHA512 b6146695225ff6d0516e7bb6bc4620599356bb89b14f429a09d9d7f8715a94e8e218402346d5c9a10eeb54c0bdc40fb179289216b0cb4edd5bdf886f6b69aab4
41 DIST rust-1.46.0-x86_64-unknown-linux-gnu.tar.xz 127200200 BLAKE2B 7d755e0622cda99d111490197b21ff4aaeb7b13292804566bc677b7b1d833eaa644b7a801863a1a01e3aa34be28a80344cae69edc57f8c8788884c78e037b750 SHA512 95f5adc2d2137010c7e5ac8a0fc70485250b4f9a909cb8b164b35fffff76ab88e9b09d305bfac37324ed080c5fc7643001d2abec5454ca911dc3513f1af52c88
42 DIST rust-1.46.0-x86_64-unknown-linux-musl.tar.xz 142372372 BLAKE2B 7d3672234b61b772e2311127db569b37296bf3a9bf86841fb78c6d20da6a6abfc6c866ba4aa7cc44c12eebb0744fbeb401b491314db9eb481b926792cadcca22 SHA512 e2599c4c10fe9725e63524d89c0be869d43347620b0f6ff1a93cee5e7219f5560c6171d8eda99e5624eba60b9d488bfe0942c23eacdbac2ba42e4cd63f14b7c9
43 -DIST rustc-1.44.1-src.tar.xz 94756856 BLAKE2B 60f536c3ba0fa1fec4b6333ee57809ee5226090ad5041c14a136b4356ff3b898062e06c3fe54effe873e27931ac8fcb902cd48a38615a8de7eebc6ecb3bdc2bd SHA512 1c17002edae844a710db9b144c17171416330dc565343c65af8a6e112fb61555e2025bb4cf33cac1229d7df689e6ff8858b91ae00552400ccacafaf1de11849b
44 DIST rustc-1.45.2-src.tar.xz 98683036 BLAKE2B a4102a5d4744b7ccc9b076aba00c39d69532f777e7d39e0e4ce2033b663b43e27b55034fdb3a1e13379fae9a16bff9e7748865a84507f7388ef0ebf9d421eac7 SHA512 cc6250c0bc844e77ca6dd7ae013e434ed3009b001914114866ed31f28edf3960221454d131e298b15050e3b8153fb8298d509559c2f7307c64611aa8e36b4d25
45 DIST rustc-1.46.0-src.tar.xz 101868452 BLAKE2B da9798596b124a10d79c236a871228f05e5f571d22c2259328e7026c91e088c85f5de9c0536a16531e0cb10477bfcd16d3ac11467979f5561cb6199442b877ef SHA512 099857f1d295043587a4e2a65ef3e6a90e12c8b6958e98535a1656c113c553f9a9b621aba8a19cf21bd8d2c79d27cbfa4b8e6fabbcb3cbfee23b545be7b450b4
46 DIST rustc-1.47.0-src.tar.xz 104143736 BLAKE2B 0454094dde35275488046826da87655e51bf0795481d6d08fd70d644bfc12481bca8641166106ef32f20494906025244715b16ff21a1c023f4bd2818aab42521 SHA512 6ba83c0158f8130ddeae7e070417a2121d8a548c8fe97e28bce116d84048636c75aaee78e0c92cd43a50f5679a1223fc226cc8c5ba9bbd1465e84c5c6034d5c9
47
48 diff --git a/dev-lang/rust/rust-1.44.1.ebuild b/dev-lang/rust/rust-1.44.1.ebuild
49 deleted file mode 100644
50 index 3ddcdaa9ee1..00000000000
51 --- a/dev-lang/rust/rust-1.44.1.ebuild
52 +++ /dev/null
53 @@ -1,502 +0,0 @@
54 -# Copyright 1999-2020 Gentoo Authors
55 -# Distributed under the terms of the GNU General Public License v2
56 -
57 -EAPI=7
58 -
59 -PYTHON_COMPAT=( python3_{6,7,8} )
60 -
61 -inherit bash-completion-r1 check-reqs estack flag-o-matic llvm multiprocessing multilib-build python-any-r1 rust-toolchain toolchain-funcs
62 -
63 -if [[ ${PV} = *beta* ]]; then
64 - betaver=${PV//*beta}
65 - BETA_SNAPSHOT="${betaver:0:4}-${betaver:4:2}-${betaver:6:2}"
66 - MY_P="rustc-beta"
67 - SLOT="beta/${PV}"
68 - SRC="${BETA_SNAPSHOT}/rustc-beta-src.tar.xz"
69 -else
70 - ABI_VER="$(ver_cut 1-2)"
71 - SLOT="stable/${ABI_VER}"
72 - MY_P="rustc-${PV}"
73 - SRC="${MY_P}-src.tar.xz"
74 - KEYWORDS="amd64 arm arm64 ppc64 x86"
75 -fi
76 -
77 -RUST_STAGE0_VERSION="1.$(($(ver_cut 2) - 1)).1"
78 -
79 -DESCRIPTION="Systems programming language from Mozilla"
80 -HOMEPAGE="https://www.rust-lang.org/"
81 -
82 -SRC_URI="
83 - https://static.rust-lang.org/dist/${SRC} -> rustc-${PV}-src.tar.xz
84 - !system-bootstrap? ( $(rust_all_arch_uris rust-${RUST_STAGE0_VERSION}) )
85 -"
86 -
87 -ALL_LLVM_TARGETS=( AArch64 AMDGPU ARM BPF Hexagon Lanai Mips MSP430
88 - NVPTX PowerPC RISCV Sparc SystemZ WebAssembly X86 XCore )
89 -ALL_LLVM_TARGETS=( "${ALL_LLVM_TARGETS[@]/#/llvm_targets_}" )
90 -LLVM_TARGET_USEDEPS=${ALL_LLVM_TARGETS[@]/%/?}
91 -
92 -LICENSE="|| ( MIT Apache-2.0 ) BSD-1 BSD-2 BSD-4 UoI-NCSA"
93 -
94 -IUSE="clippy cpu_flags_x86_sse2 debug doc libressl miri nightly parallel-compiler rls rustfmt system-bootstrap system-llvm wasm ${ALL_LLVM_TARGETS[*]}"
95 -
96 -# Please keep the LLVM dependency block separate. Since LLVM is slotted,
97 -# we need to *really* make sure we're not pulling more than one slot
98 -# simultaneously.
99 -
100 -# How to use it:
101 -# 1. List all the working slots (with min versions) in ||, newest first.
102 -# 2. Update the := to specify *max* version, e.g. < 11.
103 -# 3. Specify LLVM_MAX_SLOT, e.g. 10.
104 -LLVM_DEPEND="
105 - || (
106 - sys-devel/llvm:10[${LLVM_TARGET_USEDEPS// /,}]
107 - sys-devel/llvm:9[${LLVM_TARGET_USEDEPS// /,}]
108 - )
109 - <sys-devel/llvm-11:=
110 - wasm? ( sys-devel/lld )
111 -"
112 -LLVM_MAX_SLOT=10
113 -
114 -BOOTSTRAP_DEPEND="|| ( >=dev-lang/rust-1.$(($(ver_cut 2) - 1)) >=dev-lang/rust-bin-1.$(($(ver_cut 2) - 1)) )"
115 -
116 -# libgit2 should be at least same as bundled into libgit-sys #707746
117 -COMMON_DEPEND="
118 - >=dev-libs/libgit2-0.99:=
119 - net-libs/libssh2:=
120 - net-libs/http-parser:=
121 - net-misc/curl:=[ssl]
122 - sys-libs/zlib:=
123 - !libressl? ( dev-libs/openssl:0= )
124 - libressl? ( dev-libs/libressl:0= )
125 - elibc_musl? ( sys-libs/libunwind )
126 - system-llvm? (
127 - ${LLVM_DEPEND}
128 - )
129 -"
130 -
131 -DEPEND="${COMMON_DEPEND}
132 - ${PYTHON_DEPS}
133 - || (
134 - >=sys-devel/gcc-4.7
135 - >=sys-devel/clang-3.5
136 - )
137 - system-bootstrap? ( ${BOOTSTRAP_DEPEND} )
138 - !system-llvm? (
139 - dev-util/cmake
140 - dev-util/ninja
141 - )
142 -"
143 -
144 -RDEPEND="${COMMON_DEPEND}
145 - >=app-eselect/eselect-rust-20190311
146 -"
147 -
148 -REQUIRED_USE="|| ( ${ALL_LLVM_TARGETS[*]} )
149 - miri? ( nightly )
150 - parallel-compiler? ( nightly )
151 - wasm? ( llvm_targets_WebAssembly )
152 - x86? ( cpu_flags_x86_sse2 )
153 -"
154 -
155 -QA_FLAGS_IGNORED="
156 - usr/bin/.*-${PV}
157 - usr/lib.*/lib.*.so
158 - usr/lib/rustlib/.*/codegen-backends/librustc_codegen_llvm-llvm.so
159 - usr/lib/rustlib/.*/lib/lib.*.so
160 -"
161 -
162 -QA_SONAME="
163 - usr/lib.*/lib.*.so
164 - usr/lib.*/librustc_macros.*.s
165 -"
166 -
167 -# tests need a bit more work, currently they are causing multiple
168 -# re-compilations and somewhat fragile.
169 -RESTRICT="test"
170 -
171 -PATCHES=(
172 - "${FILESDIR}"/0012-Ignore-broken-and-non-applicable-tests.patch
173 - "${FILESDIR}"/1.44.0-libressl.patch
174 -)
175 -
176 -S="${WORKDIR}/${MY_P}-src"
177 -
178 -toml_usex() {
179 - usex "$1" true false
180 -}
181 -
182 -pre_build_checks() {
183 - CHECKREQS_DISK_BUILD="9G"
184 - eshopts_push -s extglob
185 - if is-flagq '-g?(gdb)?([1-9])'; then
186 - CHECKREQS_DISK_BUILD="15G"
187 - fi
188 - eshopts_pop
189 - check-reqs_pkg_setup
190 -}
191 -
192 -pkg_pretend() {
193 - pre_build_checks
194 -}
195 -
196 -pkg_setup() {
197 - pre_build_checks
198 - python-any-r1_pkg_setup
199 -
200 - # required to link agains system libs, otherwise
201 - # crates use bundled sources and compile own static version
202 - export LIBGIT2_SYS_USE_PKG_CONFIG=1
203 - export LIBSSH2_SYS_USE_PKG_CONFIG=1
204 - export PKG_CONFIG_ALLOW_CROSS=1
205 -
206 - if use system-llvm; then
207 - llvm_pkg_setup
208 -
209 - local llvm_config="$(get_llvm_prefix "$LLVM_MAX_SLOT")/bin/llvm-config"
210 -
211 - export LLVM_LINK_SHARED=1
212 - export RUSTFLAGS="${RUSTFLAGS} -Lnative=$("${llvm_config}" --libdir)"
213 - fi
214 -}
215 -
216 -src_prepare() {
217 - if ! use system-bootstrap; then
218 - local rust_stage0_root="${WORKDIR}"/rust-stage0
219 - local rust_stage0="rust-${RUST_STAGE0_VERSION}-$(rust_abi)"
220 -
221 - "${WORKDIR}/${rust_stage0}"/install.sh --disable-ldconfig \
222 - --destdir="${rust_stage0_root}" --prefix=/ || die
223 - fi
224 -
225 - default
226 -}
227 -
228 -src_configure() {
229 - local rust_target="" rust_targets="" arch_cflags
230 -
231 - # Collect rust target names to compile standard libs for all ABIs.
232 - for v in $(multilib_get_enabled_abi_pairs); do
233 - rust_targets="${rust_targets},\"$(rust_abi $(get_abi_CHOST ${v##*.}))\""
234 - done
235 - if use wasm; then
236 - rust_targets="${rust_targets},\"wasm32-unknown-unknown\""
237 - if use system-llvm; then
238 - # un-hardcode rust-lld linker for this target
239 - # https://bugs.gentoo.org/715348
240 - sed -i '/linker:/ s/rust-lld/wasm-ld/' src/librustc_target/spec/wasm32_base.rs || die
241 - fi
242 - fi
243 - rust_targets="${rust_targets#,}"
244 -
245 - local tools="\"cargo\","
246 - if use clippy; then
247 - tools="\"clippy\",$tools"
248 - fi
249 - if use miri; then
250 - tools="\"miri\",$tools"
251 - fi
252 - if use rls; then
253 - tools="\"rls\",\"analysis\",\"src\",$tools"
254 - fi
255 - if use rustfmt; then
256 - tools="\"rustfmt\",$tools"
257 - fi
258 -
259 - local rust_stage0_root
260 - if use system-bootstrap; then
261 - rust_stage0_root="$(rustc --print sysroot)"
262 - else
263 - rust_stage0_root="${WORKDIR}"/rust-stage0
264 - fi
265 -
266 - rust_target="$(rust_abi)"
267 -
268 - cat <<- EOF > "${S}"/config.toml
269 - [llvm]
270 - optimize = $(toml_usex !debug)
271 - release-debuginfo = $(toml_usex debug)
272 - assertions = $(toml_usex debug)
273 - ninja = true
274 - targets = "${LLVM_TARGETS// /;}"
275 - experimental-targets = ""
276 - link-shared = $(toml_usex system-llvm)
277 - [build]
278 - build = "${rust_target}"
279 - host = ["${rust_target}"]
280 - target = [${rust_targets}]
281 - cargo = "${rust_stage0_root}/bin/cargo"
282 - rustc = "${rust_stage0_root}/bin/rustc"
283 - docs = $(toml_usex doc)
284 - compiler-docs = $(toml_usex doc)
285 - submodules = false
286 - python = "${EPYTHON}"
287 - locked-deps = true
288 - vendor = true
289 - extended = true
290 - tools = [${tools}]
291 - verbose = 2
292 - sanitizers = false
293 - profiler = false
294 - cargo-native-static = false
295 - [install]
296 - prefix = "${EPREFIX}/usr"
297 - libdir = "lib"
298 - docdir = "share/doc/${PF}"
299 - mandir = "share/man"
300 - [rust]
301 - optimize = true
302 - debug = $(toml_usex debug)
303 - debug-assertions = $(toml_usex debug)
304 - debuginfo-level-rustc = 0
305 - backtrace = true
306 - incremental = false
307 - default-linker = "$(tc-getCC)"
308 - parallel-compiler = $(toml_usex parallel-compiler)
309 - channel = "$(usex nightly nightly stable)"
310 - rpath = false
311 - verbose-tests = true
312 - optimize-tests = $(toml_usex !debug)
313 - codegen-tests = true
314 - dist-src = false
315 - lld = $(usex system-llvm false $(toml_usex wasm))
316 - backtrace-on-ice = true
317 - jemalloc = false
318 - [dist]
319 - src-tarball = false
320 - EOF
321 -
322 - for v in $(multilib_get_enabled_abi_pairs); do
323 - rust_target=$(rust_abi $(get_abi_CHOST ${v##*.}))
324 - arch_cflags="$(get_abi_CFLAGS ${v##*.})"
325 -
326 - cat <<- EOF >> "${S}"/config.env
327 - CFLAGS_${rust_target}=${arch_cflags}
328 - EOF
329 -
330 - cat <<- EOF >> "${S}"/config.toml
331 - [target.${rust_target}]
332 - cc = "$(tc-getBUILD_CC)"
333 - cxx = "$(tc-getBUILD_CXX)"
334 - linker = "$(tc-getCC)"
335 - ar = "$(tc-getAR)"
336 - EOF
337 - # librustc_target/spec/linux_musl_base.rs sets base.crt_static_default = true;
338 - if use elibc_musl; then
339 - cat <<- EOF >> "${S}"/config.toml
340 - crt-static = false
341 - EOF
342 - fi
343 - if use system-llvm; then
344 - cat <<- EOF >> "${S}"/config.toml
345 - llvm-config = "$(get_llvm_prefix "${LLVM_MAX_SLOT}")/bin/llvm-config"
346 - EOF
347 - fi
348 - done
349 - if use wasm; then
350 - cat <<- EOF >> "${S}"/config.toml
351 - [target.wasm32-unknown-unknown]
352 - linker = "$(usex system-llvm lld rust-lld)"
353 - EOF
354 - fi
355 -
356 - if [[ -n ${I_KNOW_WHAT_I_AM_DOING_CROSS} ]]; then #whitespace intentionally shifted below
357 - # experimental cross support
358 - # discussion: https://bugs.gentoo.org/679878
359 - # TODO: c*flags, clang, system-llvm, cargo.eclass target support
360 - # it would be much better if we could split out stdlib
361 - # complilation to separate ebuild and abuse CATEGORY to
362 - # just install to /usr/lib/rustlib/<target>
363 -
364 - # extra targets defined as a bash array
365 - # spec format: <LLVM target>:<rust-target>:<CTARGET>
366 - # best place would be /etc/portage/env/dev-lang/rust
367 - # Example:
368 - # RUST_CROSS_TARGETS=(
369 - # "AArch64:aarch64-unknown-linux-gnu:aarch64-unknown-linux-gnu"
370 - # )
371 - # no extra hand holding is done, no target transformations, all
372 - # values are passed as-is with just basic checks, so it's up to user to supply correct values
373 - # valid rust targets can be obtained with
374 - # rustc --print target-list
375 - # matching cross toolchain has to be installed
376 - # matching LLVM_TARGET has to be enabled for both rust and llvm (if using system one)
377 - # only gcc toolchains installed with crossdev are checked for now.
378 -
379 - # BUG: we can't pass host flags to cross compiler, so just filter for now
380 - # BUG: this should be more fine-grained.
381 - filter-flags '-mcpu=*' '-march=*' '-mtune=*'
382 -
383 - local cross_target_spec
384 - for cross_target_spec in "${RUST_CROSS_TARGETS[@]}";do
385 - # extracts first element form <LLVM target>:<rust-target>:<CTARGET>
386 - local cross_llvm_target="${cross_target_spec%%:*}"
387 - # extracts toolchain triples, <rust-target>:<CTARGET>
388 - local cross_triples="${cross_target_spec#*:}"
389 - # extracts first element after before : separator
390 - local cross_rust_target="${cross_triples%%:*}"
391 - # extracts last element after : separator
392 - local cross_toolchain="${cross_triples##*:}"
393 - use llvm_targets_${cross_llvm_target} || die "need llvm_targets_${cross_llvm_target} target enabled"
394 - command -v ${cross_toolchain}-gcc > /dev/null 2>&1 || die "need ${cross_toolchain} cross toolchain"
395 -
396 - cat <<- EOF >> "${S}"/config.toml
397 - [target.${cross_rust_target}]
398 - cc = "${cross_toolchain}-gcc"
399 - cxx = "${cross_toolchain}-g++"
400 - linker = "${cross_toolchain}-gcc"
401 - ar = "${cross_toolchain}-ar"
402 - EOF
403 - if use system-llvm; then
404 - cat <<- EOF >> "${S}"/config.toml
405 - llvm-config = "$(get_llvm_prefix "${LLVM_MAX_SLOT}")/bin/llvm-config"
406 - EOF
407 - fi
408 -
409 - # append cross target to "normal" target list
410 - # example 'target = ["powerpc64le-unknown-linux-gnu"]'
411 - # becomes 'target = ["powerpc64le-unknown-linux-gnu","aarch64-unknown-linux-gnu"]'
412 -
413 - rust_targets="${rust_targets},\"${cross_rust_target}\""
414 - sed -i "/^target = \[/ s#\[.*\]#\[${rust_targets}\]#" config.toml || die
415 -
416 - ewarn
417 - ewarn "Enabled ${rust_target} rust target"
418 - ewarn "Using ${cross_toolchain} cross toolchain"
419 - ewarn
420 - if ! has_version -b 'sys-devel/binutils[multitarget]' ; then
421 - ewarn "'sys-devel/binutils[multitarget]' is not installed"
422 - ewarn "'strip' will be unable to strip cross libraries"
423 - ewarn "cross targets will be installed with full debug information"
424 - ewarn "enable 'multitarget' USE flag for binutils to be able to strip object files"
425 - ewarn
426 - ewarn "Alternatively llvm-strip can be used, it supports stripping any target"
427 - ewarn "define STRIP=\"llvm-strip\" to use it (experimental)"
428 - ewarn
429 - fi
430 - done
431 - fi # I_KNOW_WHAT_I_AM_DOING_CROSS
432 -
433 - einfo "Rust configured with the following settings:"
434 - cat "${S}"/config.toml || die
435 -}
436 -
437 -src_compile() {
438 - env $(cat "${S}"/config.env) RUST_BACKTRACE=1\
439 - "${EPYTHON}" ./x.py build -vv --config="${S}"/config.toml -j$(makeopts_jobs) || die
440 -}
441 -
442 -src_test() {
443 - env $(cat "${S}"/config.env) RUST_BACKTRACE=1\
444 - "${EPYTHON}" ./x.py test -vv --config="${S}"/config.toml -j$(makeopts_jobs) --no-doc --no-fail-fast \
445 - src/test/codegen \
446 - src/test/codegen-units \
447 - src/test/compile-fail \
448 - src/test/incremental \
449 - src/test/mir-opt \
450 - src/test/pretty \
451 - src/test/run-fail \
452 - src/test/run-make \
453 - src/test/run-make-fulldeps \
454 - src/test/ui \
455 - src/test/ui-fulldeps || die
456 -}
457 -
458 -src_install() {
459 - env $(cat "${S}"/config.env) DESTDIR="${D}" \
460 - "${EPYTHON}" ./x.py install -vv --config="${S}"/config.toml || die
461 -
462 - # bug #689562, #689160
463 - rm "${D}/etc/bash_completion.d/cargo" || die
464 - rmdir "${D}"/etc{/bash_completion.d,} || die
465 - dobashcomp build/tmp/dist/cargo-image/etc/bash_completion.d/cargo
466 -
467 - mv "${ED}/usr/bin/rustc" "${ED}/usr/bin/rustc-${PV}" || die
468 - mv "${ED}/usr/bin/rustdoc" "${ED}/usr/bin/rustdoc-${PV}" || die
469 - mv "${ED}/usr/bin/rust-gdb" "${ED}/usr/bin/rust-gdb-${PV}" || die
470 - mv "${ED}/usr/bin/rust-gdbgui" "${ED}/usr/bin/rust-gdbgui-${PV}" || die
471 - mv "${ED}/usr/bin/rust-lldb" "${ED}/usr/bin/rust-lldb-${PV}" || die
472 - mv "${ED}/usr/bin/cargo" "${ED}/usr/bin/cargo-${PV}" || die
473 - if use clippy; then
474 - mv "${ED}/usr/bin/clippy-driver" "${ED}/usr/bin/clippy-driver-${PV}" || die
475 - mv "${ED}/usr/bin/cargo-clippy" "${ED}/usr/bin/cargo-clippy-${PV}" || die
476 - fi
477 - if use miri; then
478 - mv "${ED}/usr/bin/miri" "${ED}/usr/bin/miri-${PV}" || die
479 - mv "${ED}/usr/bin/cargo-miri" "${ED}/usr/bin/cargo-miri-${PV}" || die
480 - fi
481 - if use rls; then
482 - mv "${ED}/usr/bin/rls" "${ED}/usr/bin/rls-${PV}" || die
483 - fi
484 - if use rustfmt; then
485 - mv "${ED}/usr/bin/rustfmt" "${ED}/usr/bin/rustfmt-${PV}" || die
486 - mv "${ED}/usr/bin/cargo-fmt" "${ED}/usr/bin/cargo-fmt-${PV}" || die
487 - fi
488 -
489 - # Move public shared libs to abi specific libdir
490 - # Private and target specific libs MUST stay in /usr/lib/rustlib/${rust_target}/lib
491 - if [[ $(get_libdir) != lib ]]; then
492 - dodir /usr/$(get_libdir)
493 - mv "${ED}/usr/lib"/*.so "${ED}/usr/$(get_libdir)/" || die
494 - fi
495 -
496 - dodoc COPYRIGHT
497 - rm "${ED}/usr/share/doc/${P}"/*.old || die
498 - rm "${ED}/usr/share/doc/${P}/LICENSE-APACHE" || die
499 - rm "${ED}/usr/share/doc/${P}/LICENSE-MIT" || die
500 -
501 - # note: eselect-rust adds EROOT to all paths below
502 - cat <<-EOF > "${T}/provider-${P}"
503 - /usr/bin/cargo
504 - /usr/bin/rustdoc
505 - /usr/bin/rust-gdb
506 - /usr/bin/rust-gdbgui
507 - /usr/bin/rust-lldb
508 - EOF
509 - if use clippy; then
510 - echo /usr/bin/clippy-driver >> "${T}/provider-${P}"
511 - echo /usr/bin/cargo-clippy >> "${T}/provider-${P}"
512 - fi
513 - if use miri; then
514 - echo /usr/bin/miri >> "${T}/provider-${P}"
515 - echo /usr/bin/cargo-miri >> "${T}/provider-${P}"
516 - fi
517 - if use rls; then
518 - echo /usr/bin/rls >> "${T}/provider-${P}"
519 - fi
520 - if use rustfmt; then
521 - echo /usr/bin/rustfmt >> "${T}/provider-${P}"
522 - echo /usr/bin/cargo-fmt >> "${T}/provider-${P}"
523 - fi
524 -
525 - insinto /etc/env.d/rust
526 - doins "${T}/provider-${P}"
527 -}
528 -
529 -pkg_postinst() {
530 - eselect rust update --if-unset
531 -
532 - elog "Rust installs a helper script for calling GDB and LLDB,"
533 - elog "for your convenience it is installed under /usr/bin/rust-{gdb,lldb}-${PV}."
534 -
535 - if has_version app-editors/emacs; then
536 - elog "install app-emacs/rust-mode to get emacs support for rust."
537 - fi
538 -
539 - if has_version app-editors/gvim || has_version app-editors/vim; then
540 - elog "install app-vim/rust-vim to get vim support for rust."
541 - fi
542 -
543 - if use elibc_musl; then
544 - ewarn "${PN} on *-musl targets is configured with crt-static"
545 - ewarn ""
546 - ewarn "you will need to set RUSTFLAGS=\"-C target-feature=-crt-static\" in make.conf"
547 - ewarn "to use it with portage, otherwise you may see failures like"
548 - ewarn "error: cannot produce proc-macro for serde_derive v1.0.98 as the target "
549 - ewarn "x86_64-unknown-linux-musl does not support these crate types"
550 - fi
551 -}
552 -
553 -pkg_postrm() {
554 - eselect rust cleanup
555 -}