1 |
commit: e1a0d1ade3ea7d342557e6dd81c7d230a666f058 |
2 |
Author: Patrick McLean <chutzpah <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Dec 8 20:00:36 2018 +0000 |
4 |
Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Dec 8 20:05:27 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e1a0d1ad |
7 |
|
8 |
dev-lang/rust: Version bump to 1.31.0 (bug #672646) |
9 |
|
10 |
Closes: https://bugs.gentoo.org/672646 |
11 |
Package-Manager: Portage-2.3.52, Repoman-2.3.12 |
12 |
Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org> |
13 |
|
14 |
dev-lang/rust/Manifest | 14 ++ |
15 |
dev-lang/rust/rust-1.31.0.ebuild | 297 +++++++++++++++++++++++++++++++++++++++ |
16 |
2 files changed, 311 insertions(+) |
17 |
|
18 |
diff --git a/dev-lang/rust/Manifest b/dev-lang/rust/Manifest |
19 |
index 7ee673aefe7..857f32cd4f8 100644 |
20 |
--- a/dev-lang/rust/Manifest |
21 |
+++ b/dev-lang/rust/Manifest |
22 |
@@ -24,6 +24,20 @@ DIST rust-1.29.2-powerpc64-unknown-linux-gnu.tar.xz 103432092 BLAKE2B ed700d2987 |
23 |
DIST rust-1.29.2-powerpc64le-unknown-linux-gnu.tar.xz 106607384 BLAKE2B de19f341dcc1cc580e68865d3b0034f781ed4ca0ac1b07c89352409684670c7d0fd5c95ea6018fc7de4fbfacf4f7d0ebeec34c036c0062ca7f776403511df7dd SHA512 b9181da601a467f46713f2f438fc7ad69c46fc310e62a8d45f665744c8578491d832b8624ff454c19c94f1694fa406846a82289250241030a70b2cb4b88913d1 |
24 |
DIST rust-1.29.2-s390x-unknown-linux-gnu.tar.xz 99114900 BLAKE2B 08e9251bd8e9c9ac6352ab81735b720052b3288b5fd344f6ba69205c7971f362270f0acce7dbd3763b20d3b1e976ff5404151253acb9c29708f36038d23299f1 SHA512 f76a030257edbdd993d7a4e83da895c8b4749904fb2252a125b3e4ef4331a1cb2c389ec54a372bea413718e3dad987e4b17eb29d301c29ba330222502e6b9b75 |
25 |
DIST rust-1.29.2-x86_64-unknown-linux-gnu.tar.xz 148275708 BLAKE2B bd7c974f5c8cf78a1fbfc73544ecdab97b7f9ab28ed9ab66759eca3e0fa085fdb2689ba5dfc6dccc6746bab91b6b0b544c44cb729e493dddde2f9ed84c96a247 SHA512 8bc05942a72b186ea1765831bea6921f734e2dd58790a8e427a6d63a2db0d9064937d3198ca3febffeba73b1cc3bef716155ef6cb32127ddeef29ac884cde4b8 |
26 |
+DIST rust-1.30.1-aarch64-unknown-linux-gnu.tar.xz 114223904 BLAKE2B ca3f93d8cb59f5ecc8680ab018f8666a5c0df1bf671af4220c39178a946ce77a05588d91709facd42a1d693120c46c472c4d6dc0b6a5e7d3330b9f0807ff3fcc SHA512 5fb9cb0281cd76b1995bcd6c4dd824f8a4d4c1ffc61a0a54f62b45340b98a7b41cf5ec3d4a8ec370c2603c14f9dc5451ae1a47ea96ebbd520770dfd22cf0ffdc |
27 |
+DIST rust-1.30.1-arm-unknown-linux-gnueabi.tar.xz 120865688 BLAKE2B 18934c592882ad3608b82ab9aac68412790d02c148c2af0a37a5027ebe059ff697a8556c4dcbf0ac5cf37c6fbd37c51abbf88a3f0ce274742ff1d7ec94f96f04 SHA512 871e0b036273ec62e28712fe1d5d1c74b061eabb59f9cc852e8924df1aaa3797af28d51dde643010920321fa71382ddd70f2d97d25c06999d5663f5209ffc6b7 |
28 |
+DIST rust-1.30.1-arm-unknown-linux-gnueabihf.tar.xz 121114868 BLAKE2B 6410c16e3019b67d2e299b06527db6d7291a1426c4606012234bd8e93b3e3738dda5907aa6d9e48ac25f2a7e06a441f7e42095ec81de01408c235577e0df2df5 SHA512 73ac63f81a86b70ea0378e859b6a913f3f6e2044f1ddcb056c53a18d3f32011a47abf29bf2a84f3a9d6732bec348741662448104e320bcaebf2a3667209fcedb |
29 |
+DIST rust-1.30.1-armv7-unknown-linux-gnueabihf.tar.xz 122390768 BLAKE2B 39c38b9bf96e94023b9c6d81fce8c341e789f182b59bf1b540a6d22be24e0498c638d0d3aa1433f49e52048795f91f5f4ca707dd8fcb998ea51caa932537b74e SHA512 88f9f23f431cc34d6b7ddc51c2321905df03dc714aab0b3a5e067390de5092b472f8092ba25a5c09666ad9b138efc2f4b625ca86dbe10ddeea213b8e9d70c9b3 |
30 |
+DIST rust-1.30.1-i686-unknown-linux-gnu.tar.xz 143689500 BLAKE2B 0b654570e295c785b074625c8fe7649e1841327fba790e38e08e912ad0602440e08a205318e637c903989bd19bab4c0a726583f2ab457d75ff71e96524251aa0 SHA512 66c56107fd8c83f9c1948137aee09c67633f6f472823696719a22b5f0b0e28925b0a6b6545b8fe4d741b8473ddc49db30fe112fc5b0e6fc63439901ff5462a86 |
31 |
+DIST rust-1.30.1-mips-unknown-linux-gnu.tar.xz 112662912 BLAKE2B ded8631f76ac5fc16cae298f5a7afdb8c451ff95af03c827959bd19484d513066ac387e956577f5ee42369fc5d68c1e2cbf4cfc72c364739eea31643844ba936 SHA512 8a1681f054a57d62050a2d11ae3109e7be4f6638319b059d10612f0be073de63f2dffea79bb29452763fad8a64274367d9bbe5ca0636e78c34a6cdce542118a0 |
32 |
+DIST rust-1.30.1-mips64-unknown-linux-gnuabi64.tar.xz 117355424 BLAKE2B fcc583d99a6b17e1d38d26a48d39768b09c52e6a6fa3cd36d9513bd9385fd4560d06c3a737b69c396b5bb465ae261321dbbaf7bda4378d7e4be165bc889d8b2d SHA512 c18cd513021753d2b8e1a9ea2bf0bd73817e2c81dcf246993b52c7055b3b18d9f20c935dec4281acbd2792a6964dbfb0c05b5cb2075703aaa444352ef8f06d50 |
33 |
+DIST rust-1.30.1-mipsel-unknown-linux-gnu.tar.xz 114622708 BLAKE2B 5d62f6744cb1bf69d7047bb18e246623ee98c94bfa083fd5269bdcf8dd1c2c0824747dd641f703931f0b22fd513ee8a65a4dec103bf479f6a00e72098541a1aa SHA512 3d084c5c986ba379a3213c9662bc6a0e24c9d3a1c4ae4e28c3f807841eacb15dd8fb42bcb190967ba4a9e8e5397b63e6bbd3990bd9826d52a127bd71ac5b361e |
34 |
+DIST rust-1.30.1-powerpc-unknown-linux-gnu.tar.xz 110375696 BLAKE2B 6ffa7b6b7ae569c7ebf6b0ab43287421e4a5e2ea8654638902e61df42f7e3de7f14c14f2e585d7b3e140f2ebc7a0e1149b814fd5a6d6c0374f9d8059ff3369c3 SHA512 ebbd2c2b160e6e36a03eee205a333cddf0a36cd0ce42135a7e4119469be41b76cedda143cf9e9491ae0d9aaf65e2e927550e2e0358401fc5f657ee02b37959b4 |
35 |
+DIST rust-1.30.1-powerpc64-unknown-linux-gnu.tar.xz 118698168 BLAKE2B 58905ab6c62d4b7fca8954fc507f9105537cdfc2a55a6585b4784a41ce721046c41606eae6066a173a548c4d065db497e187b2e8c9c6cbc0ee589e7731c8f106 SHA512 7eddabec2e1e01ddbc8c7b0c55f2753e506786867f78e79e47d4f273e7c02170caa24470e0f2ecf6c473cfc8c023e189017454e2ad0f3faa96465fdd22bdfd6d |
36 |
+DIST rust-1.30.1-powerpc64le-unknown-linux-gnu.tar.xz 121569444 BLAKE2B d4d390ea24298cd88d224efe3c1a1dc3a802b678d977bc0aa26197e291547a6ca823a0fe5e35491204a649cb6a5419343a825ef32408aa2638d057b209b1c15c SHA512 b4595f031a006335ac778ec6a07c398fd6cce78ed3c0ed5730a5c06fa3a390dbab1afda0468756330783baa86dafb2f0c7ca7c75b735eb532c268027e22975e6 |
37 |
+DIST rust-1.30.1-s390x-unknown-linux-gnu.tar.xz 124025168 BLAKE2B b4a8df333b093ae111136a6b9005aca7f424f209d629041c4fce1efc7e19b176f6e6325bf3552e8de93faa311ebf065ad4b9f104de3ee412b2a3fda70156c2b0 SHA512 592764d3d5b4d8a2a7628f4969ba5204da4ea63ca92efc17d4f9339274fce00aecc4d1ebb1f4d0499da8559375ad205054b26e12775af622a7112b20b8c8d4fb |
38 |
+DIST rust-1.30.1-x86_64-unknown-linux-gnu.tar.xz 145148116 BLAKE2B e70d667d880656209c036b72f619b1bd29679878ff4b8865f0453c064c4a8a53a96e73994509637312032e1260eeb0e53f7372ca1526760b1631846ed6a4c571 SHA512 05238b65b5184e3df81dbcf1cc1035a03054ef09a8563fe60877e4f078d0d2cad71aec73c1451196171f39f8e729059e91c7eed7b1402e03801c0b7e81815885 |
39 |
DIST rustc-1.29.1-src.tar.xz 61937676 BLAKE2B 6a60249538e1ec62471f4d0e3fc31c0a648433aa6f85ca7341657ea07772e338eb92a629941685808f4b80e84cb025d78aee9d0d6fa71c6635a1647c61bca9bc SHA512 1ded651b4c460e11e5e44c26de88a80fb13c2000097de2ee1e5af89638e12a7e8f43dd756689d4cc4fad45c52d4d43a3c70dd6a3ae550735b9dad5f8defea6a7 |
40 |
DIST rustc-1.29.2-src.tar.xz 61888912 BLAKE2B f59b0bf45caa6f6136f92ffbaa612bbc6a340c8694ec69d75aadace9180c36753f985641915524388b52cc108f8f5b71840ee3a6c0b1fcff6decb61d2d8a161e SHA512 d8fa9501764348ace8f60f2069bcd016925abe56c8bbc2b87fb52ff796e4bc7284c1fccbb1671416437bb82fde7d9240eeae875d6099914e27e75cfe050e2d38 |
41 |
DIST rustc-1.30.1-src.tar.xz 96086232 BLAKE2B 170767b64efe670086e7c4e73838b489a155a72c703148f83cad29d401a825a94a1def3aa462ba527e1bd08181c7a9be0e404c25f012906541c3d739eb57e9e5 SHA512 e466db81b9a82239670c48b876dc7390fcdda28c6390308691ddf2e0c12a39b57bd5ddb18322d1b4cd58165f69a666c7d83bee6573049da3b94e401657459bf5 |
42 |
+DIST rustc-1.31.0-src.tar.xz 96914112 BLAKE2B 5e4c5d7724033c756f57794bda273f5c6b481a4a310afc73cafa6a67c2fe3e56cf08ca828e822d91890a6fda917e4c05d4b20f598e50805431d2926a4f1add9c SHA512 38fb8c759a517defd64ca75a22d5deb1fa543fc13f127c73010741c40bc00935bf3b46743a95a22e98e37df5aa21d72203acabaecf8c0b23439e3b5c68f2fbec |
43 |
|
44 |
diff --git a/dev-lang/rust/rust-1.31.0.ebuild b/dev-lang/rust/rust-1.31.0.ebuild |
45 |
new file mode 100644 |
46 |
index 00000000000..1b215c0ac90 |
47 |
--- /dev/null |
48 |
+++ b/dev-lang/rust/rust-1.31.0.ebuild |
49 |
@@ -0,0 +1,297 @@ |
50 |
+# Copyright 1999-2018 Gentoo Authors |
51 |
+# Distributed under the terms of the GNU General Public License v2 |
52 |
+ |
53 |
+EAPI=6 |
54 |
+ |
55 |
+PYTHON_COMPAT=( python2_7 python3_{5,6} pypy ) |
56 |
+ |
57 |
+inherit check-reqs eapi7-ver estack flag-o-matic llvm multiprocessing multilib-build python-any-r1 rust-toolchain toolchain-funcs |
58 |
+ |
59 |
+if [[ ${PV} = *beta* ]]; then |
60 |
+ betaver=${PV//*beta} |
61 |
+ BETA_SNAPSHOT="${betaver:0:4}-${betaver:4:2}-${betaver:6:2}" |
62 |
+ MY_P="rustc-beta" |
63 |
+ SLOT="beta/${PV}" |
64 |
+ SRC="${BETA_SNAPSHOT}/rustc-beta-src.tar.xz" |
65 |
+else |
66 |
+ ABI_VER="$(ver_cut 1-2)" |
67 |
+ SLOT="stable/${ABI_VER}" |
68 |
+ MY_P="rustc-${PV}" |
69 |
+ SRC="${MY_P}-src.tar.xz" |
70 |
+ KEYWORDS="~amd64 ~arm64 ~x86" |
71 |
+fi |
72 |
+ |
73 |
+RUST_STAGE0_VERSION="1.$(($(ver_cut 2) - 1)).1" |
74 |
+ |
75 |
+DESCRIPTION="Systems programming language from Mozilla" |
76 |
+HOMEPAGE="https://www.rust-lang.org/" |
77 |
+ |
78 |
+SRC_URI="https://static.rust-lang.org/dist/${SRC} -> rustc-${PV}-src.tar.xz |
79 |
+ $(rust_all_arch_uris rust-${RUST_STAGE0_VERSION})" |
80 |
+ |
81 |
+ALL_LLVM_TARGETS=( AArch64 AMDGPU ARM BPF Hexagon Lanai Mips MSP430 |
82 |
+ NVPTX PowerPC Sparc SystemZ X86 XCore ) |
83 |
+ALL_LLVM_TARGETS=( "${ALL_LLVM_TARGETS[@]/#/llvm_targets_}" ) |
84 |
+LLVM_TARGET_USEDEPS=${ALL_LLVM_TARGETS[@]/%/?} |
85 |
+ |
86 |
+LICENSE="|| ( MIT Apache-2.0 ) BSD-1 BSD-2 BSD-4 UoI-NCSA" |
87 |
+ |
88 |
+IUSE="clippy cpu_flags_x86_sse2 debug doc +jemalloc libressl rls rustfmt system-llvm wasm ${ALL_LLVM_TARGETS[*]}" |
89 |
+ |
90 |
+COMMON_DEPEND=">=app-eselect/eselect-rust-0.3_pre20150425 |
91 |
+ jemalloc? ( dev-libs/jemalloc ) |
92 |
+ sys-libs/zlib |
93 |
+ !libressl? ( dev-libs/openssl:0= ) |
94 |
+ libressl? ( dev-libs/libressl:0= ) |
95 |
+ net-libs/libssh2 |
96 |
+ net-libs/http-parser:= |
97 |
+ net-misc/curl[ssl] |
98 |
+ system-llvm? ( >=sys-devel/llvm-6:= )" |
99 |
+DEPEND="${COMMON_DEPEND} |
100 |
+ ${PYTHON_DEPS} |
101 |
+ || ( |
102 |
+ >=sys-devel/gcc-4.7 |
103 |
+ >=sys-devel/clang-3.5 |
104 |
+ ) |
105 |
+ dev-util/cmake" |
106 |
+RDEPEND="${COMMON_DEPEND} |
107 |
+ !dev-util/cargo |
108 |
+ rustfmt? ( !dev-util/rustfmt )" |
109 |
+REQUIRED_USE="|| ( ${ALL_LLVM_TARGETS[*]} ) |
110 |
+ x86? ( cpu_flags_x86_sse2 )" |
111 |
+ |
112 |
+S="${WORKDIR}/${MY_P}-src" |
113 |
+ |
114 |
+PATCHES=( "${FILESDIR}"/1.30.1-clippy-sysroot.patch ) |
115 |
+ |
116 |
+toml_usex() { |
117 |
+ usex "$1" true false |
118 |
+} |
119 |
+ |
120 |
+pre_build_checks() { |
121 |
+ CHECKREQS_DISK_BUILD="7G" |
122 |
+ CHECKREQS_MEMORY="4G" |
123 |
+ eshopts_push -s extglob |
124 |
+ if is-flagq '-g?(gdb)?([1-9])'; then |
125 |
+ CHECKREQS_DISK_BUILD="10G" |
126 |
+ CHECKREQS_MEMORY="16G" |
127 |
+ fi |
128 |
+ eshopts_pop |
129 |
+ check-reqs_pkg_setup |
130 |
+} |
131 |
+ |
132 |
+pkg_pretend() { |
133 |
+ pre_build_checks |
134 |
+} |
135 |
+ |
136 |
+pkg_setup() { |
137 |
+ pre_build_checks |
138 |
+ python-any-r1_pkg_setup |
139 |
+ if use system-llvm; then |
140 |
+ llvm_pkg_setup |
141 |
+ fi |
142 |
+} |
143 |
+ |
144 |
+src_prepare() { |
145 |
+ local rust_stage0_root="${WORKDIR}"/rust-stage0 |
146 |
+ |
147 |
+ local rust_stage0="rust-${RUST_STAGE0_VERSION}-$(rust_abi)" |
148 |
+ |
149 |
+ "${WORKDIR}/${rust_stage0}"/install.sh --disable-ldconfig --destdir="${rust_stage0_root}" --prefix=/ || die |
150 |
+ |
151 |
+ default |
152 |
+} |
153 |
+ |
154 |
+src_configure() { |
155 |
+ local rust_target="" rust_targets="" arch_cflags |
156 |
+ |
157 |
+ # Collect rust target names to compile standard libs for all ABIs. |
158 |
+ for v in $(multilib_get_enabled_abi_pairs); do |
159 |
+ rust_targets="${rust_targets},\"$(rust_abi $(get_abi_CHOST ${v##*.}))\"" |
160 |
+ done |
161 |
+ if use wasm; then |
162 |
+ rust_targets="${rust_targets},\"wasm32-unknown-unknown\"" |
163 |
+ fi |
164 |
+ rust_targets="${rust_targets#,}" |
165 |
+ |
166 |
+ local extended="true" tools="\"cargo\"," |
167 |
+ if use clippy; then |
168 |
+ tools="\"clippy\",$tools" |
169 |
+ fi |
170 |
+ if use rls; then |
171 |
+ tools="\"rls\",\"analysis\",\"src\",$tools" |
172 |
+ fi |
173 |
+ if use rustfmt; then |
174 |
+ tools="\"rustfmt\",$tools" |
175 |
+ fi |
176 |
+ |
177 |
+ local rust_stage0_root="${WORKDIR}"/rust-stage0 |
178 |
+ |
179 |
+ rust_target="$(rust_abi)" |
180 |
+ |
181 |
+ cat <<- EOF > "${S}"/config.toml |
182 |
+ [llvm] |
183 |
+ optimize = $(toml_usex !debug) |
184 |
+ release-debuginfo = $(toml_usex debug) |
185 |
+ assertions = $(toml_usex debug) |
186 |
+ targets = "${LLVM_TARGETS// /;}" |
187 |
+ link-shared = $(toml_usex system-llvm) |
188 |
+ [build] |
189 |
+ build = "${rust_target}" |
190 |
+ host = ["${rust_target}"] |
191 |
+ target = [${rust_targets}] |
192 |
+ cargo = "${rust_stage0_root}/bin/cargo" |
193 |
+ rustc = "${rust_stage0_root}/bin/rustc" |
194 |
+ docs = $(toml_usex doc) |
195 |
+ submodules = false |
196 |
+ python = "${EPYTHON}" |
197 |
+ locked-deps = true |
198 |
+ vendor = true |
199 |
+ extended = ${extended} |
200 |
+ tools = [${tools}] |
201 |
+ [install] |
202 |
+ prefix = "${EPREFIX}/usr" |
203 |
+ libdir = "$(get_libdir)/${P}" |
204 |
+ docdir = "share/doc/${P}" |
205 |
+ mandir = "share/${P}/man" |
206 |
+ [rust] |
207 |
+ optimize = $(toml_usex !debug) |
208 |
+ debuginfo = $(toml_usex debug) |
209 |
+ debug-assertions = $(toml_usex debug) |
210 |
+ use-jemalloc = $(toml_usex jemalloc) |
211 |
+ default-linker = "$(tc-getCC)" |
212 |
+ channel = "stable" |
213 |
+ rpath = false |
214 |
+ lld = $(toml_usex wasm) |
215 |
+ EOF |
216 |
+ |
217 |
+ for v in $(multilib_get_enabled_abi_pairs); do |
218 |
+ rust_target=$(rust_abi $(get_abi_CHOST ${v##*.})) |
219 |
+ arch_cflags="$(get_abi_CFLAGS ${v##*.})" |
220 |
+ |
221 |
+ cat <<- EOF >> "${S}"/config.env |
222 |
+ CFLAGS_${rust_target}=${arch_cflags} |
223 |
+ EOF |
224 |
+ |
225 |
+ cat <<- EOF >> "${S}"/config.toml |
226 |
+ [target.${rust_target}] |
227 |
+ cc = "$(tc-getBUILD_CC)" |
228 |
+ cxx = "$(tc-getBUILD_CXX)" |
229 |
+ linker = "$(tc-getCC)" |
230 |
+ ar = "$(tc-getAR)" |
231 |
+ EOF |
232 |
+ if use system-llvm; then |
233 |
+ cat <<- EOF >> "${S}"/config.toml |
234 |
+ llvm-config = "$(get_llvm_prefix)/bin/llvm-config" |
235 |
+ EOF |
236 |
+ fi |
237 |
+ done |
238 |
+ |
239 |
+ if use wasm; then |
240 |
+ cat <<- EOF >> "${S}"/config.toml |
241 |
+ [target.wasm32-unknown-unknown] |
242 |
+ linker = "rust-lld" |
243 |
+ EOF |
244 |
+ fi |
245 |
+} |
246 |
+ |
247 |
+src_compile() { |
248 |
+ env $(cat "${S}"/config.env)\ |
249 |
+ "${EPYTHON}" ./x.py build --config="${S}"/config.toml -j$(makeopts_jobs) \ |
250 |
+ --exclude src/tools/miri || die # https://github.com/rust-lang/rust/issues/52305 |
251 |
+} |
252 |
+ |
253 |
+src_install() { |
254 |
+ local rust_target abi_libdir |
255 |
+ |
256 |
+ env DESTDIR="${D}" "${EPYTHON}" ./x.py install || die |
257 |
+ |
258 |
+ mv "${D}/usr/bin/rustc" "${D}/usr/bin/rustc-${PV}" || die |
259 |
+ mv "${D}/usr/bin/rustdoc" "${D}/usr/bin/rustdoc-${PV}" || die |
260 |
+ mv "${D}/usr/bin/rust-gdb" "${D}/usr/bin/rust-gdb-${PV}" || die |
261 |
+ mv "${D}/usr/bin/rust-lldb" "${D}/usr/bin/rust-lldb-${PV}" || die |
262 |
+ mv "${D}/usr/bin/cargo" "${D}/usr/bin/cargo-${PV}" || die |
263 |
+ if use clippy; then |
264 |
+ mv "${D}/usr/bin/clippy-driver" "${D}/usr/bin/clippy-driver-${PV}" || die |
265 |
+ mv "${D}/usr/bin/cargo-clippy" "${D}/usr/bin/cargo-clippy-${PV}" || die |
266 |
+ fi |
267 |
+ if use rls; then |
268 |
+ mv "${D}/usr/bin/rls" "${D}/usr/bin/rls-${PV}" || die |
269 |
+ fi |
270 |
+ if use rustfmt; then |
271 |
+ mv "${D}/usr/bin/rustfmt" "${D}/usr/bin/rustfmt-${PV}" || die |
272 |
+ mv "${D}/usr/bin/cargo-fmt" "${D}/usr/bin/cargo-fmt-${PV}" || die |
273 |
+ fi |
274 |
+ |
275 |
+ # Copy shared library versions of standard libraries for all targets |
276 |
+ # into the system's abi-dependent lib directories because the rust |
277 |
+ # installer only does so for the native ABI. |
278 |
+ for v in $(multilib_get_enabled_abi_pairs); do |
279 |
+ if [ ${v##*.} = ${DEFAULT_ABI} ]; then |
280 |
+ continue |
281 |
+ fi |
282 |
+ abi_libdir=$(get_abi_LIBDIR ${v##*.}) |
283 |
+ rust_target=$(rust_abi $(get_abi_CHOST ${v##*.})) |
284 |
+ mkdir -p "${D}/usr/${abi_libdir}" |
285 |
+ cp "${D}/usr/$(get_libdir)/${P}/rustlib/${rust_target}/lib"/*.so \ |
286 |
+ "${D}/usr/${abi_libdir}" || die |
287 |
+ done |
288 |
+ |
289 |
+ dodoc COPYRIGHT |
290 |
+ |
291 |
+ # FIXME: |
292 |
+ # Really not sure if that env is needed, specailly LDPATH |
293 |
+ cat <<-EOF > "${T}"/50${P} |
294 |
+ LDPATH="/usr/$(get_libdir)/${P}" |
295 |
+ MANPATH="/usr/share/${P}/man" |
296 |
+ EOF |
297 |
+ doenvd "${T}"/50${P} |
298 |
+ |
299 |
+ cat <<-EOF > "${T}/provider-${P}" |
300 |
+ /usr/bin/rustdoc |
301 |
+ /usr/bin/rust-gdb |
302 |
+ /usr/bin/rust-lldb |
303 |
+ EOF |
304 |
+ echo /usr/bin/cargo >> "${T}/provider-${P}" |
305 |
+ if use clippy; then |
306 |
+ echo /usr/bin/clippy-driver >> "${T}/provider-${P}" |
307 |
+ echo /usr/bin/cargo-clippy >> "${T}/provider-${P}" |
308 |
+ fi |
309 |
+ if use rls; then |
310 |
+ echo /usr/bin/rls >> "${T}/provider-${P}" |
311 |
+ fi |
312 |
+ if use rustfmt; then |
313 |
+ echo /usr/bin/rustfmt >> "${T}/provider-${P}" |
314 |
+ echo /usr/bin/cargo-fmt >> "${T}/provider-${P}" |
315 |
+ fi |
316 |
+ dodir /etc/env.d/rust |
317 |
+ insinto /etc/env.d/rust |
318 |
+ doins "${T}/provider-${P}" |
319 |
+} |
320 |
+ |
321 |
+pkg_postinst() { |
322 |
+ eselect rust update --if-unset |
323 |
+ |
324 |
+ elog "Rust installs a helper script for calling GDB and LLDB," |
325 |
+ elog "for your convenience it is installed under /usr/bin/rust-{gdb,lldb}-${PV}." |
326 |
+ |
327 |
+ ewarn "cargo is now installed from dev-lang/rust{,-bin} instead of dev-util/cargo." |
328 |
+ ewarn "This might have resulted in a dangling symlink for /usr/bin/cargo on some" |
329 |
+ ewarn "systems. This can be resolved by calling 'sudo eselect rust set ${P}'." |
330 |
+ |
331 |
+ if has_version app-editors/emacs || has_version app-editors/emacs-vcs; then |
332 |
+ elog "install app-emacs/rust-mode to get emacs support for rust." |
333 |
+ fi |
334 |
+ |
335 |
+ if has_version app-editors/gvim || has_version app-editors/vim; then |
336 |
+ elog "install app-vim/rust-vim to get vim support for rust." |
337 |
+ fi |
338 |
+ |
339 |
+ if has_version 'app-shells/zsh'; then |
340 |
+ elog "install app-shells/rust-zshcomp to get zsh completion for rust." |
341 |
+ fi |
342 |
+} |
343 |
+ |
344 |
+pkg_postrm() { |
345 |
+ eselect rust unset --if-invalid |
346 |
+} |