1 |
commit: aca73a89121af25876703d0ddcc5f08ddf277933 |
2 |
Author: Dirkjan Ochtman <djc <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Oct 18 09:02:33 2018 +0000 |
4 |
Commit: Dirkjan Ochtman <djc <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Oct 18 09:05:13 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=aca73a89 |
7 |
|
8 |
dev-lang/rust: version bump to 1.29.2 with fixes |
9 |
|
10 |
Fixes: https://bugs.gentoo.org/667286 |
11 |
Fixes: https://bugs.gentoo.org/667966 |
12 |
Bug: https://bugs.gentoo.org/609654 |
13 |
Signed-off-by: Dirkjan Ochtman <djc <AT> gentoo.org> |
14 |
Package-Manager: Portage-2.3.49, Repoman-2.3.11 |
15 |
|
16 |
dev-lang/rust/Manifest | 14 ++ |
17 |
dev-lang/rust/files/1.29.2-clippy-sysroot.patch | 62 +++++ |
18 |
dev-lang/rust/rust-1.29.2.ebuild | 289 ++++++++++++++++++++++++ |
19 |
3 files changed, 365 insertions(+) |
20 |
|
21 |
diff --git a/dev-lang/rust/Manifest b/dev-lang/rust/Manifest |
22 |
index 2cb3a292859..782386dff1b 100644 |
23 |
--- a/dev-lang/rust/Manifest |
24 |
+++ b/dev-lang/rust/Manifest |
25 |
@@ -1,4 +1,18 @@ |
26 |
+DIST rust-1.28.0-aarch64-unknown-linux-gnu.tar.gz 157164971 BLAKE2B 04b6e5d19762aac8137fc2cd4649721808302293a3171750a301a50cc0d51239d589138708ef836674cbc26fb08e5dc1f95a9b914078bfca1fbe3c31482865e6 SHA512 b5ee4eaf18d3c06e73440d2b74012e936f3c6e518f70d40735bf487436d81b4bceecfca08cd9d46e689fa73bc17bea27f6bfac257ff8e943a71fd3bf3f0550fc |
27 |
DIST rust-1.28.0-aarch64-unknown-linux-gnu.tar.xz 98937652 BLAKE2B 836d3dd4e583fa50dd317c3bea56257e6ea19defdb38c16be6debb2854e147c8a92c4832263e4ac314136022a176526fe7d3774a3c5a84cd8d364cd2a1532860 SHA512 8d9acbc90ddaa1e0de0234a21798b19b5365ea371a12f9a143c6ebacbb48f57344da6e827e867513be502bce2801de27a0dbbacdf8618c653aeb58026b6c469c |
28 |
+DIST rust-1.28.0-arm-unknown-linux-gnueabi.tar.gz 162495940 BLAKE2B 98f8a03326cdf006509fea62aa892033117c7f22d6b6e5961afb7229574e7193237d9e0f010bd2c47a88cd0a3cbbc698432fbe2f3d94354a2f783df858ff913e SHA512 f52f78933d4da8252676f480b298ece7bec788106abde4b2075070f3a74fd3a53f6497685e6f481f623a911d4b81dee727b085cddf466e394577bca22e907dd8 |
29 |
+DIST rust-1.28.0-arm-unknown-linux-gnueabihf.tar.gz 162818424 BLAKE2B 41769724609e6847ed6bea7fc246063eec418e36b939cd5aab7cb84aea214baf15cc208211aa432a937c3b263bfe3412e3076c565f85cf1d0e92164c15dfa87d SHA512 c779f168be3c69e612fe4bc597cb95889e43e6100be304e4157cf35ed5651601a8e5e6470671642566979a7c2c9cfbd0c6446e428a4606f7869d3c5f698c0a7b |
30 |
+DIST rust-1.28.0-armv7-unknown-linux-gnueabihf.tar.gz 160016618 BLAKE2B 687d019803af7f6b891fe381eeea45d7cb009c78ae0e45b34ca6fdb91c03e27802de1578f0c0142aa17fbbe7bbf99c1a0a3b4ff32e39aaa3050f4e75019dd83f SHA512 1d26b31499462b5521f2ee798cfb6072516569077e5f9bcac21f9f0de06d1c9df0eec9735c5539048c0f8cb26b1a498eff8f3eed66f8e66bb937cc0e6e6c5c76 |
31 |
+DIST rust-1.28.0-i686-unknown-linux-gnu.tar.gz 223358542 BLAKE2B fa7b691bcfae4cd939848b5994d81efda99bc7482141faa4a557354d341dfbf0257e43d49e894de896947097987dba3df22c6783cd75f6c99d72f76c3226a899 SHA512 40fc0c6e347f60ab3809e95edabafd88e9160f8adaa217562a9c52fea42f540ca142eddd827ba16960bef8faa9401b37a963d29baa235aa84eb760c2a78a2c4f |
32 |
DIST rust-1.28.0-i686-unknown-linux-gnu.tar.xz 136925948 BLAKE2B 85d9239533920c3f16d7c61bada0caeabceceade29032b70bb4562bfd04fa0158cdd85b8a0a1119506416fa5916ade8a0466bf6c10da457299a6319aa25f9dd6 SHA512 ffdfab46db14f07354b553e02fdb9dc6602c2c52b78d8f17c499f4ddb1e257aa53479df836eb3f06a2548d34296b0277cdb6b4c6f3cec57265823df22752c135 |
33 |
+DIST rust-1.28.0-mips-unknown-linux-gnu.tar.gz 165489073 BLAKE2B 14d5f01a02fdc87b508dd214271b5b1f0fde2cbf360faa65cac51f8d3658acb4f1388c894a1451c0a9626e3abffedef0b663caab845ed95573b5567244fd8ed7 SHA512 9663fae3c05e5a393002261a213f08d1efc1426ef06849343475abfef4fcf427ea987b69dee6bc8edb92313c7e31cff79a526948f0934fdbd8ced219cdfe8b25 |
34 |
+DIST rust-1.28.0-mips64-unknown-linux-gnuabi64.tar.gz 164335544 BLAKE2B da043943d2c9429c1626ff233728afacdc360c3705ac4bcafa94d145aef5ca91cdf7763c078cf63439bf6d0d126eabed4f107520a510c9f4cc58445b5b24d47e SHA512 863678828f59d14d83d68555d86ae2c765d227524cd2d0c3b38948cf6da78db3590c4a05c426c19eacdb041aec9d55b12469a0e2bd6a3b0eab6bec5fe12dbbf9 |
35 |
+DIST rust-1.28.0-mipsel-unknown-linux-gnu.tar.gz 163172396 BLAKE2B 3a8f4568d66d82709199b1bb40b53c345628897b4b272f9f86086309a87513ffdd11be3a18698790c1efd0fc879f6a6dffbcc618952f355b38d6d4d1d4ae6aa5 SHA512 cbb05bb0b5024d0d7d4ec7b3f2db8004bb84213fc2bd0be8d820a3224fcbbd4a8245906927353e56c9cc9f09f36d1b1baf026cba2caa22a5873f20dceae6feaf |
36 |
+DIST rust-1.28.0-powerpc-unknown-linux-gnu.tar.gz 166220569 BLAKE2B 516340a78d3e7e52b0997b72d1767bb6481eb443c6ba9f7f52339a66b6b96c473e4023d66b104a147a8a580e54992b3aff81784314e03cc5a150a056b6504413 SHA512 71c10b5cab4b3a60d88c1d9a3463478379d5b5ff86c4c8a3f48da92354fc55490636128781ef71dbf5156f4f558077ffc161616ace614c32f8a43014435dd37f |
37 |
+DIST rust-1.28.0-powerpc64-unknown-linux-gnu.tar.gz 172115039 BLAKE2B d4f808101fd0db3096b7dd69fd77d91111e69965b36cac7c23b7503ec6851f8868f3f00635b2a38a844e28b5e4a6490be50a29836db86d994933688e2ca8c8b7 SHA512 0c48cfefe93258641a5d0f33355719356095b7fc680edc768d7ce1b22cb437f80e99e302356ef00e6e39cd1fe9b042a0f8d60c9814458f9629a36822fea7faa6 |
38 |
+DIST rust-1.28.0-powerpc64le-unknown-linux-gnu.tar.gz 170244391 BLAKE2B 10c54895a9ce9077f2489d9a24f734deeb132227871d6ddf610557629892053b9473146319ca979e9ceb3d861a352dc1fa2e0f529c5675586ed2bb80aad9d0f8 SHA512 ec5e0e85a8a6124f5804e72293fde86e0dae0cd4d044831182610b185f1048cf0bec9b12cf3063a6fba3bac3fca273727364e86a3e5eb8ba0224b29ce2145d6b |
39 |
+DIST rust-1.28.0-s390x-unknown-linux-gnu.tar.gz 159758899 BLAKE2B a692e77fb2538d539f403f7d39898d46160b56a389cee459861a743b4acde96cb48b6776a820c046b27a28ef9997c33d07154f36d70de7473d877ea2680b6ea4 SHA512 a9f0a84d6c80ee3d66a10214a0a229112d4594d849cf51081a722b2c66e5742a199c59215d258f86a7ab362659936a2dd8b6228c18f3065fd43d2edd7d7d6363 |
40 |
+DIST rust-1.28.0-x86_64-unknown-linux-gnu.tar.gz 220419012 BLAKE2B 9db1923cd9f82fe7e13684ff86af30592af2acb348358a27c956ec01e0391b2fae7cf89537a4b23159beb7202ec5349e701b2255e0d188b3894bd985bd1b24a2 SHA512 6bdcb8828e14069e099764b79671579bd24c90a102266fa5ebd9a5da3da7186b3e1d64b53c6c065d2d1a4d71b6c613513fddb38cd21c3d37a4a112b0393542a2 |
41 |
DIST rust-1.28.0-x86_64-unknown-linux-gnu.tar.xz 134120432 BLAKE2B 56fb79a98659d9c8e56b8eef87dea3302ee5901bc4507d1c204628370b20cf34b2875c9586faa0acc2bc2b1a5beedeb9b5ba199cfb85d52f268f084a02f04f27 SHA512 4f427c11a9cd22aedd01bd7ed5bee2ba5e00a27db25af4f596cf8627d88eff8e72625eb83729d2e6c6780aaffd44c0e7065a1c8fa22f4899349b72c726cf6a5f |
42 |
DIST rustc-1.29.1-src.tar.xz 61937676 BLAKE2B 6a60249538e1ec62471f4d0e3fc31c0a648433aa6f85ca7341657ea07772e338eb92a629941685808f4b80e84cb025d78aee9d0d6fa71c6635a1647c61bca9bc SHA512 1ded651b4c460e11e5e44c26de88a80fb13c2000097de2ee1e5af89638e12a7e8f43dd756689d4cc4fad45c52d4d43a3c70dd6a3ae550735b9dad5f8defea6a7 |
43 |
+DIST rustc-1.29.2-src.tar.xz 61888912 BLAKE2B f59b0bf45caa6f6136f92ffbaa612bbc6a340c8694ec69d75aadace9180c36753f985641915524388b52cc108f8f5b71840ee3a6c0b1fcff6decb61d2d8a161e SHA512 d8fa9501764348ace8f60f2069bcd016925abe56c8bbc2b87fb52ff796e4bc7284c1fccbb1671416437bb82fde7d9240eeae875d6099914e27e75cfe050e2d38 |
44 |
|
45 |
diff --git a/dev-lang/rust/files/1.29.2-clippy-sysroot.patch b/dev-lang/rust/files/1.29.2-clippy-sysroot.patch |
46 |
new file mode 100644 |
47 |
index 00000000000..6a527e5a020 |
48 |
--- /dev/null |
49 |
+++ b/dev-lang/rust/files/1.29.2-clippy-sysroot.patch |
50 |
@@ -0,0 +1,62 @@ |
51 |
+--- a/src/tools/clippy/src/driver.rs 2018-10-04 16:30:42.438486058 +0300 |
52 |
++++ b/src/tools/clippy/src/driver.rs 2018-10-04 16:31:45.044484028 +0300 |
53 |
+@@ -20,54 +20,22 @@ |
54 |
+ return; |
55 |
+ } |
56 |
+ |
57 |
+- let sys_root = option_env!("SYSROOT") |
58 |
+- .map(String::from) |
59 |
+- .or_else(|| std::env::var("SYSROOT").ok()) |
60 |
+- .or_else(|| { |
61 |
+- let home = option_env!("RUSTUP_HOME").or(option_env!("MULTIRUST_HOME")); |
62 |
+- let toolchain = option_env!("RUSTUP_TOOLCHAIN").or(option_env!("MULTIRUST_TOOLCHAIN")); |
63 |
+- home.and_then(|home| toolchain.map(|toolchain| format!("{}/toolchains/{}", home, toolchain))) |
64 |
+- }) |
65 |
+- .or_else(|| { |
66 |
+- Command::new("rustc") |
67 |
+- .arg("--print") |
68 |
+- .arg("sysroot") |
69 |
+- .output() |
70 |
+- .ok() |
71 |
+- .and_then(|out| String::from_utf8(out.stdout).ok()) |
72 |
+- .map(|s| s.trim().to_owned()) |
73 |
+- }) |
74 |
+- .expect("need to specify SYSROOT env var during clippy compilation, or use rustup or multirust"); |
75 |
+- |
76 |
+ // Setting RUSTC_WRAPPER causes Cargo to pass 'rustc' as the first argument. |
77 |
+ // We're invoking the compiler programmatically, so we ignore this/ |
78 |
+- let mut orig_args: Vec<String> = env::args().collect(); |
79 |
+- if orig_args.len() <= 1 { |
80 |
++ let mut args: Vec<String> = env::args().collect(); |
81 |
++ if args.len() <= 1 { |
82 |
+ std::process::exit(1); |
83 |
+ } |
84 |
+- if orig_args[1] == "rustc" { |
85 |
++ if args[1] == "rustc" { |
86 |
+ // we still want to be able to invoke it normally though |
87 |
+- orig_args.remove(1); |
88 |
++ args.remove(1); |
89 |
+ } |
90 |
+- // this conditional check for the --sysroot flag is there so users can call |
91 |
+- // `clippy_driver` directly |
92 |
+- // without having to pass --sysroot or anything |
93 |
+- let mut args: Vec<String> = if orig_args.iter().any(|s| s == "--sysroot") { |
94 |
+- orig_args.clone() |
95 |
+- } else { |
96 |
+- orig_args |
97 |
+- .clone() |
98 |
+- .into_iter() |
99 |
+- .chain(Some("--sysroot".to_owned())) |
100 |
+- .chain(Some(sys_root)) |
101 |
+- .collect() |
102 |
+- }; |
103 |
+ |
104 |
+ // this check ensures that dependencies are built but not linted and the final |
105 |
+ // crate is |
106 |
+ // linted but not built |
107 |
+ let clippy_enabled = env::var("CLIPPY_TESTS").ok().map_or(false, |val| val == "true") |
108 |
+- || orig_args.iter().any(|s| s == "--emit=dep-info,metadata"); |
109 |
++ || args.iter().any(|s| s == "--emit=dep-info,metadata"); |
110 |
+ |
111 |
+ if clippy_enabled { |
112 |
+ args.extend_from_slice(&["--cfg".to_owned(), r#"feature="cargo-clippy""#.to_owned()]); |
113 |
|
114 |
diff --git a/dev-lang/rust/rust-1.29.2.ebuild b/dev-lang/rust/rust-1.29.2.ebuild |
115 |
new file mode 100644 |
116 |
index 00000000000..b1d1b8dd282 |
117 |
--- /dev/null |
118 |
+++ b/dev-lang/rust/rust-1.29.2.ebuild |
119 |
@@ -0,0 +1,289 @@ |
120 |
+# Copyright 1999-2018 Gentoo Authors |
121 |
+# Distributed under the terms of the GNU General Public License v2 |
122 |
+ |
123 |
+EAPI=6 |
124 |
+ |
125 |
+PYTHON_COMPAT=( python2_7 python3_{5,6} pypy ) |
126 |
+ |
127 |
+inherit eapi7-ver multiprocessing multilib-build python-any-r1 rust-toolchain toolchain-funcs |
128 |
+ |
129 |
+if [[ ${PV} = *beta* ]]; then |
130 |
+ betaver=${PV//*beta} |
131 |
+ BETA_SNAPSHOT="${betaver:0:4}-${betaver:4:2}-${betaver:6:2}" |
132 |
+ MY_P="rustc-beta" |
133 |
+ SLOT="beta/${PV}" |
134 |
+ SRC="${BETA_SNAPSHOT}/rustc-beta-src.tar.xz" |
135 |
+else |
136 |
+ ABI_VER="$(ver_cut 1-2)" |
137 |
+ SLOT="stable/${ABI_VER}" |
138 |
+ MY_P="rustc-${PV}" |
139 |
+ SRC="${MY_P}-src.tar.xz" |
140 |
+ KEYWORDS="~amd64 ~arm64 ~x86" |
141 |
+fi |
142 |
+ |
143 |
+CHOST_amd64=x86_64-unknown-linux-gnu |
144 |
+CHOST_x86=i686-unknown-linux-gnu |
145 |
+CHOST_arm64=aarch64-unknown-linux-gnu |
146 |
+ |
147 |
+RUST_STAGE0_VERSION="1.$(($(ver_cut 2) - 1)).0" |
148 |
+RUST_STAGE0_amd64="rust-${RUST_STAGE0_VERSION}-${CHOST_amd64}" |
149 |
+RUST_STAGE0_x86="rust-${RUST_STAGE0_VERSION}-${CHOST_x86}" |
150 |
+RUST_STAGE0_arm64="rust-${RUST_STAGE0_VERSION}-${CHOST_arm64}" |
151 |
+ |
152 |
+CARGO_DEPEND_VERSION="0.$(($(ver_cut 2) + 1)).0" |
153 |
+ |
154 |
+DESCRIPTION="Systems programming language from Mozilla" |
155 |
+HOMEPAGE="https://www.rust-lang.org/" |
156 |
+ |
157 |
+SRC_URI="https://static.rust-lang.org/dist/${SRC} -> rustc-${PV}-src.tar.xz |
158 |
+ $(rust_all_arch_uris rust-${RUST_STAGE0_VERSION})" |
159 |
+ |
160 |
+ALL_LLVM_TARGETS=( AArch64 AMDGPU ARM BPF Hexagon Lanai Mips MSP430 |
161 |
+ NVPTX PowerPC Sparc SystemZ X86 XCore ) |
162 |
+ALL_LLVM_TARGETS=( "${ALL_LLVM_TARGETS[@]/#/llvm_targets_}" ) |
163 |
+LLVM_TARGET_USEDEPS=${ALL_LLVM_TARGETS[@]/%/?} |
164 |
+ |
165 |
+LICENSE="|| ( MIT Apache-2.0 ) BSD-1 BSD-2 BSD-4 UoI-NCSA" |
166 |
+ |
167 |
+IUSE="cargo clippy cpu_flags_x86_sse2 debug doc +jemalloc libressl rls rustfmt wasm ${ALL_LLVM_TARGETS[*]}" |
168 |
+ |
169 |
+RDEPEND=">=app-eselect/eselect-rust-0.3_pre20150425 |
170 |
+ jemalloc? ( dev-libs/jemalloc ) |
171 |
+ cargo? ( |
172 |
+ sys-libs/zlib |
173 |
+ !libressl? ( dev-libs/openssl:0= ) |
174 |
+ libressl? ( dev-libs/libressl:0= ) |
175 |
+ net-libs/libssh2 |
176 |
+ net-libs/http-parser:= |
177 |
+ net-misc/curl[ssl] |
178 |
+ )" |
179 |
+DEPEND="${RDEPEND} |
180 |
+ ${PYTHON_DEPS} |
181 |
+ || ( |
182 |
+ >=sys-devel/gcc-4.7 |
183 |
+ >=sys-devel/clang-3.5 |
184 |
+ ) |
185 |
+ cargo? ( !dev-util/cargo ) |
186 |
+ rustfmt? ( !dev-util/rustfmt ) |
187 |
+ dev-util/cmake |
188 |
+" |
189 |
+PDEPEND="!cargo? ( >=dev-util/cargo-${CARGO_DEPEND_VERSION} )" |
190 |
+ |
191 |
+REQUIRED_USE="|| ( ${ALL_LLVM_TARGETS[*]} ) |
192 |
+ x86? ( cpu_flags_x86_sse2 )" |
193 |
+ |
194 |
+S="${WORKDIR}/${MY_P}-src" |
195 |
+ |
196 |
+PATCHES=( "${FILESDIR}"/${PV}-clippy-sysroot.patch ) |
197 |
+ |
198 |
+toml_usex() { |
199 |
+ usex "$1" true false |
200 |
+} |
201 |
+ |
202 |
+src_prepare() { |
203 |
+ local rust_stage0_root="${WORKDIR}"/rust-stage0 |
204 |
+ |
205 |
+ local rust_stage0_name="RUST_STAGE0_${ARCH}" |
206 |
+ local rust_stage0="${!rust_stage0_name}" |
207 |
+ |
208 |
+ "${WORKDIR}/${rust_stage0}"/install.sh --disable-ldconfig --destdir="${rust_stage0_root}" --prefix=/ || die |
209 |
+ |
210 |
+ default |
211 |
+} |
212 |
+ |
213 |
+src_configure() { |
214 |
+ local rust_target="" rust_targets="" rust_target_name arch_cflags |
215 |
+ |
216 |
+ # Collect rust target names to compile standard libs for all ABIs. |
217 |
+ for v in $(multilib_get_enabled_abi_pairs); do |
218 |
+ rust_target_name="CHOST_${v##*.}" |
219 |
+ rust_targets="${rust_targets},\"${!rust_target_name}\"" |
220 |
+ done |
221 |
+ if use wasm; then |
222 |
+ rust_targets="${rust_targets},\"wasm32-unknown-unknown\"" |
223 |
+ fi |
224 |
+ rust_targets="${rust_targets#,}" |
225 |
+ |
226 |
+ local extended="false" tools="" |
227 |
+ if use cargo; then |
228 |
+ extended="true" |
229 |
+ tools="\"cargo\"," |
230 |
+ fi |
231 |
+ if use clippy; then |
232 |
+ extended="true" |
233 |
+ tools="\"clippy\",$tools" |
234 |
+ fi |
235 |
+ if use rls; then |
236 |
+ extended="true" |
237 |
+ tools="\"rls\",\"analysis\",\"src\",$tools" |
238 |
+ fi |
239 |
+ if use rustfmt; then |
240 |
+ extended="true" |
241 |
+ tools="\"rustfmt\",$tools" |
242 |
+ fi |
243 |
+ |
244 |
+ local rust_stage0_root="${WORKDIR}"/rust-stage0 |
245 |
+ |
246 |
+ rust_target_name="CHOST_${ARCH}" |
247 |
+ rust_target="$(rust_abi)" |
248 |
+ |
249 |
+ cat <<- EOF > "${S}"/config.toml |
250 |
+ [llvm] |
251 |
+ optimize = $(toml_usex !debug) |
252 |
+ release-debuginfo = $(toml_usex debug) |
253 |
+ assertions = $(toml_usex debug) |
254 |
+ targets = "${LLVM_TARGETS// /;}" |
255 |
+ [build] |
256 |
+ build = "${rust_target}" |
257 |
+ host = ["${rust_target}"] |
258 |
+ target = [${rust_targets}] |
259 |
+ cargo = "${rust_stage0_root}/bin/cargo" |
260 |
+ rustc = "${rust_stage0_root}/bin/rustc" |
261 |
+ docs = $(toml_usex doc) |
262 |
+ submodules = false |
263 |
+ python = "${EPYTHON}" |
264 |
+ locked-deps = true |
265 |
+ vendor = true |
266 |
+ extended = ${extended} |
267 |
+ tools = [${tools}] |
268 |
+ [install] |
269 |
+ prefix = "${EPREFIX}/usr" |
270 |
+ libdir = "$(get_libdir)/${P}" |
271 |
+ docdir = "share/doc/${P}" |
272 |
+ mandir = "share/${P}/man" |
273 |
+ [rust] |
274 |
+ optimize = $(toml_usex !debug) |
275 |
+ debuginfo = $(toml_usex debug) |
276 |
+ debug-assertions = $(toml_usex debug) |
277 |
+ use-jemalloc = $(toml_usex jemalloc) |
278 |
+ default-linker = "$(tc-getCC)" |
279 |
+ channel = "stable" |
280 |
+ rpath = false |
281 |
+ lld = $(toml_usex wasm) |
282 |
+ EOF |
283 |
+ |
284 |
+ for v in $(multilib_get_enabled_abi_pairs); do |
285 |
+ rust_target=$(get_abi_CHOST ${v##*.}) |
286 |
+ arch_cflags="$(get_abi_CFLAGS ${v##*.})" |
287 |
+ |
288 |
+ cat <<- EOF >> "${S}"/config.env |
289 |
+ CFLAGS_${rust_target}=${arch_cflags} |
290 |
+ EOF |
291 |
+ |
292 |
+ cat <<- EOF >> "${S}"/config.toml |
293 |
+ [target.${rust_target}] |
294 |
+ cc = "$(tc-getBUILD_CC)" |
295 |
+ cxx = "$(tc-getBUILD_CXX)" |
296 |
+ linker = "$(tc-getCC)" |
297 |
+ ar = "$(tc-getAR)" |
298 |
+ EOF |
299 |
+ done |
300 |
+ |
301 |
+ if use wasm; then |
302 |
+ cat <<- EOF >> "${S}"/config.toml |
303 |
+ [target.wasm32-unknown-unknown] |
304 |
+ linker = "rust-lld" |
305 |
+ EOF |
306 |
+ fi |
307 |
+} |
308 |
+ |
309 |
+src_compile() { |
310 |
+ env $(cat "${S}"/config.env)\ |
311 |
+ "${EPYTHON}" ./x.py build --config="${S}"/config.toml -j$(makeopts_jobs) \ |
312 |
+ --exclude src/tools/miri || die # https://github.com/rust-lang/rust/issues/52305 |
313 |
+} |
314 |
+ |
315 |
+src_install() { |
316 |
+ local rust_target abi_libdir |
317 |
+ |
318 |
+ env DESTDIR="${D}" "${EPYTHON}" ./x.py install || die |
319 |
+ |
320 |
+ mv "${D}/usr/bin/rustc" "${D}/usr/bin/rustc-${PV}" || die |
321 |
+ mv "${D}/usr/bin/rustdoc" "${D}/usr/bin/rustdoc-${PV}" || die |
322 |
+ mv "${D}/usr/bin/rust-gdb" "${D}/usr/bin/rust-gdb-${PV}" || die |
323 |
+ mv "${D}/usr/bin/rust-lldb" "${D}/usr/bin/rust-lldb-${PV}" || die |
324 |
+ if use cargo; then |
325 |
+ mv "${D}/usr/bin/cargo" "${D}/usr/bin/cargo-${PV}" || die |
326 |
+ fi |
327 |
+ if use clippy; then |
328 |
+ mv "${D}/usr/bin/clippy-driver" "${D}/usr/bin/clippy-driver-${PV}" || die |
329 |
+ mv "${D}/usr/bin/cargo-clippy" "${D}/usr/bin/cargo-clippy-${PV}" || die |
330 |
+ fi |
331 |
+ if use rls; then |
332 |
+ mv "${D}/usr/bin/rls" "${D}/usr/bin/rls-${PV}" || die |
333 |
+ fi |
334 |
+ if use rustfmt; then |
335 |
+ mv "${D}/usr/bin/rustfmt" "${D}/usr/bin/rustfmt-${PV}" || die |
336 |
+ mv "${D}/usr/bin/cargo-fmt" "${D}/usr/bin/cargo-fmt-${PV}" || die |
337 |
+ fi |
338 |
+ |
339 |
+ # Copy shared library versions of standard libraries for all targets |
340 |
+ # into the system's abi-dependent lib directories because the rust |
341 |
+ # installer only does so for the native ABI. |
342 |
+ for v in $(multilib_get_enabled_abi_pairs); do |
343 |
+ if [ ${v##*.} = ${DEFAULT_ABI} ]; then |
344 |
+ continue |
345 |
+ fi |
346 |
+ abi_libdir=$(get_abi_LIBDIR ${v##*.}) |
347 |
+ rust_target=$(get_abi_CHOST ${v##*.}) |
348 |
+ mkdir -p "${D}/usr/${abi_libdir}" |
349 |
+ cp "${D}/usr/$(get_libdir)/${P}/rustlib/${rust_target}/lib"/*.so \ |
350 |
+ "${D}/usr/${abi_libdir}" || die |
351 |
+ done |
352 |
+ |
353 |
+ dodoc COPYRIGHT |
354 |
+ |
355 |
+ # FIXME: |
356 |
+ # Really not sure if that env is needed, specailly LDPATH |
357 |
+ cat <<-EOF > "${T}"/50${P} |
358 |
+ LDPATH="/usr/$(get_libdir)/${P}" |
359 |
+ MANPATH="/usr/share/${P}/man" |
360 |
+ EOF |
361 |
+ doenvd "${T}"/50${P} |
362 |
+ |
363 |
+ cat <<-EOF > "${T}/provider-${P}" |
364 |
+ /usr/bin/rustdoc |
365 |
+ /usr/bin/rust-gdb |
366 |
+ /usr/bin/rust-lldb |
367 |
+ EOF |
368 |
+ if use cargo; then |
369 |
+ echo /usr/bin/cargo >> "${T}/provider-${P}" |
370 |
+ fi |
371 |
+ if use clippy; then |
372 |
+ echo /usr/bin/clippy-driver >> "${T}/provider-${P}" |
373 |
+ echo /usr/bin/cargo-clippy >> "${T}/provider-${P}" |
374 |
+ fi |
375 |
+ if use rls; then |
376 |
+ echo /usr/bin/rls >> "${T}/provider-${P}" |
377 |
+ fi |
378 |
+ if use rustfmt; then |
379 |
+ echo /usr/bin/rustfmt >> "${T}/provider-${P}" |
380 |
+ echo /usr/bin/cargo-fmt >> "${T}/provider-${P}" |
381 |
+ fi |
382 |
+ dodir /etc/env.d/rust |
383 |
+ insinto /etc/env.d/rust |
384 |
+ doins "${T}/provider-${P}" |
385 |
+} |
386 |
+ |
387 |
+pkg_postinst() { |
388 |
+ eselect rust update --if-unset |
389 |
+ |
390 |
+ elog "Rust installs a helper script for calling GDB and LLDB," |
391 |
+ elog "for your convenience it is installed under /usr/bin/rust-{gdb,lldb}-${PV}." |
392 |
+ |
393 |
+ if has_version app-editors/emacs || has_version app-editors/emacs-vcs; then |
394 |
+ elog "install app-emacs/rust-mode to get emacs support for rust." |
395 |
+ fi |
396 |
+ |
397 |
+ if has_version app-editors/gvim || has_version app-editors/vim; then |
398 |
+ elog "install app-vim/rust-vim to get vim support for rust." |
399 |
+ fi |
400 |
+ |
401 |
+ if has_version 'app-shells/zsh'; then |
402 |
+ elog "install app-shells/rust-zshcomp to get zsh completion for rust." |
403 |
+ fi |
404 |
+} |
405 |
+ |
406 |
+pkg_postrm() { |
407 |
+ eselect rust unset --if-invalid |
408 |
+} |