1 |
commit: 14b3e1eb948eb57b80f4b76eb4ece22f450b84ad |
2 |
Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Oct 13 02:58:34 2020 +0000 |
4 |
Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Oct 13 04:01:11 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=14b3e1eb |
7 |
|
8 |
dev-lang/rust: revbump 1.47.0, a lot of fixes |
9 |
|
10 |
we now completely switch all components for eselect-rust. |
11 |
it now includes: doc, man, lib, rustlib. |
12 |
|
13 |
previously there was no guarantee user gets those components |
14 |
from version eselected system-wide. |
15 |
now all the paths are handled. |
16 |
change src_compile target to 'dist' |
17 |
because of changes to x.py |
18 |
https://blog.rust-lang.org/inside-rust/2020/08/30/changes-to-x-py-defaults.html |
19 |
minor cleanup. |
20 |
|
21 |
Package-Manager: Portage-3.0.8, Repoman-3.0.1 |
22 |
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org> |
23 |
|
24 |
.../{rust-1.47.0.ebuild => rust-1.47.0-r1.ebuild} | 60 +++++++++++++--------- |
25 |
1 file changed, 35 insertions(+), 25 deletions(-) |
26 |
|
27 |
diff --git a/dev-lang/rust/rust-1.47.0.ebuild b/dev-lang/rust/rust-1.47.0-r1.ebuild |
28 |
similarity index 93% |
29 |
rename from dev-lang/rust/rust-1.47.0.ebuild |
30 |
rename to dev-lang/rust/rust-1.47.0-r1.ebuild |
31 |
index 258fc863bc0..d85939ce0ab 100644 |
32 |
--- a/dev-lang/rust/rust-1.47.0.ebuild |
33 |
+++ b/dev-lang/rust/rust-1.47.0-r1.ebuild |
34 |
@@ -247,7 +247,7 @@ src_configure() { |
35 |
|
36 |
rust_target="$(rust_abi)" |
37 |
|
38 |
- cat <<- EOF > "${S}"/config.toml |
39 |
+ cat <<- _EOF_ > "${S}"/config.toml |
40 |
[llvm] |
41 |
optimize = $(toml_usex !debug) |
42 |
release-debuginfo = $(toml_usex debug) |
43 |
@@ -304,40 +304,40 @@ src_configure() { |
44 |
jemalloc = false |
45 |
[dist] |
46 |
src-tarball = false |
47 |
- EOF |
48 |
+ _EOF_ |
49 |
|
50 |
for v in $(multilib_get_enabled_abi_pairs); do |
51 |
rust_target=$(rust_abi $(get_abi_CHOST ${v##*.})) |
52 |
arch_cflags="$(get_abi_CFLAGS ${v##*.})" |
53 |
|
54 |
- cat <<- EOF >> "${S}"/config.env |
55 |
+ cat <<- _EOF_ >> "${S}"/config.env |
56 |
CFLAGS_${rust_target}=${arch_cflags} |
57 |
- EOF |
58 |
+ _EOF_ |
59 |
|
60 |
- cat <<- EOF >> "${S}"/config.toml |
61 |
+ cat <<- _EOF_ >> "${S}"/config.toml |
62 |
[target.${rust_target}] |
63 |
cc = "$(tc-getBUILD_CC)" |
64 |
cxx = "$(tc-getBUILD_CXX)" |
65 |
linker = "$(tc-getCC)" |
66 |
ar = "$(tc-getAR)" |
67 |
- EOF |
68 |
+ _EOF_ |
69 |
# librustc_target/spec/linux_musl_base.rs sets base.crt_static_default = true; |
70 |
if use elibc_musl; then |
71 |
- cat <<- EOF >> "${S}"/config.toml |
72 |
+ cat <<- _EOF_ >> "${S}"/config.toml |
73 |
crt-static = false |
74 |
- EOF |
75 |
+ _EOF_ |
76 |
fi |
77 |
if use system-llvm; then |
78 |
- cat <<- EOF >> "${S}"/config.toml |
79 |
+ cat <<- _EOF_ >> "${S}"/config.toml |
80 |
llvm-config = "$(get_llvm_prefix "${LLVM_MAX_SLOT}")/bin/llvm-config" |
81 |
- EOF |
82 |
+ _EOF_ |
83 |
fi |
84 |
done |
85 |
if use wasm; then |
86 |
- cat <<- EOF >> "${S}"/config.toml |
87 |
+ cat <<- _EOF_ >> "${S}"/config.toml |
88 |
[target.wasm32-unknown-unknown] |
89 |
linker = "$(usex system-llvm lld rust-lld)" |
90 |
- EOF |
91 |
+ _EOF_ |
92 |
fi |
93 |
|
94 |
if [[ -n ${I_KNOW_WHAT_I_AM_DOING_CROSS} ]]; then # whitespace intentionally shifted below |
95 |
@@ -380,17 +380,17 @@ src_configure() { |
96 |
use llvm_targets_${cross_llvm_target} || die "need llvm_targets_${cross_llvm_target} target enabled" |
97 |
command -v ${cross_toolchain}-gcc > /dev/null 2>&1 || die "need ${cross_toolchain} cross toolchain" |
98 |
|
99 |
- cat <<- EOF >> "${S}"/config.toml |
100 |
+ cat <<- _EOF_ >> "${S}"/config.toml |
101 |
[target.${cross_rust_target}] |
102 |
cc = "${cross_toolchain}-gcc" |
103 |
cxx = "${cross_toolchain}-g++" |
104 |
linker = "${cross_toolchain}-gcc" |
105 |
ar = "${cross_toolchain}-ar" |
106 |
- EOF |
107 |
+ _EOF_ |
108 |
if use system-llvm; then |
109 |
- cat <<- EOF >> "${S}"/config.toml |
110 |
+ cat <<- _EOF_ >> "${S}"/config.toml |
111 |
llvm-config = "$(get_llvm_prefix "${LLVM_MAX_SLOT}")/bin/llvm-config" |
112 |
- EOF |
113 |
+ _EOF_ |
114 |
fi |
115 |
|
116 |
# append cross target to "normal" target list |
117 |
@@ -426,7 +426,7 @@ src_compile() { |
118 |
( |
119 |
IFS=$'\n' |
120 |
env $(cat "${S}"/config.env) RUST_BACKTRACE=1\ |
121 |
- "${EPYTHON}" ./x.py build -vv --config="${S}"/config.toml -j$(makeopts_jobs) || die |
122 |
+ "${EPYTHON}" ./x.py dist -vv --config="${S}"/config.toml -j$(makeopts_jobs) || die |
123 |
) |
124 |
} |
125 |
|
126 |
@@ -502,12 +502,12 @@ src_install() { |
127 |
dobashcomp build/tmp/dist/cargo-image/etc/bash_completion.d/cargo |
128 |
|
129 |
local symlinks=( |
130 |
+ cargo |
131 |
rustc |
132 |
rustdoc |
133 |
rust-gdb |
134 |
rust-gdbgui |
135 |
rust-lldb |
136 |
- cargo |
137 |
) |
138 |
|
139 |
use clippy && symlinks+=( clippy-driver cargo-clippy ) |
140 |
@@ -515,20 +515,26 @@ src_install() { |
141 |
use rls && symlinks+=( rls ) |
142 |
use rustfmt && symlinks+=( rustfmt cargo-fmt ) |
143 |
|
144 |
+ einfo "installing eselect-rust symlinks and paths" |
145 |
local i |
146 |
for i in "${symlinks[@]}"; do |
147 |
# we need realpath on /usr/bin/* symlink return version-appended binary path. |
148 |
# so /usr/bin/rustc should point to /usr/lib/rust/<ver>/bin/rustc-<ver> |
149 |
# need to fix eselect-rust to remove this hack. |
150 |
- mv -v "${ED}/usr/lib/${PN}/${PV}/bin/${i}" "${ED}/usr/lib/${PN}/${PV}/bin/${i}-${PV}" || die |
151 |
- ln -v "${ED}/usr/lib/${PN}/${PV}/bin/${i}-${PV}" "${ED}/usr/lib/${PN}/${PV}/bin/${i}" || die |
152 |
- dosym "../lib/${PN}/${PV}/bin/${i}-${PV}" "/usr/bin/${i}-${PV}" |
153 |
+ local ver_i="${i}-${PV}" |
154 |
+ mv -v "${ED}/usr/lib/${PN}/${PV}/bin/${i}" "${ED}/usr/lib/${PN}/${PV}/bin/${ver_i}" || die |
155 |
+ ln -v "${ED}/usr/lib/${PN}/${PV}/bin/${ver_i}" "${ED}/usr/lib/${PN}/${PV}/bin/${i}" || die |
156 |
+ dosym "../lib/${PN}/${PV}/bin/${ver_i}" "/usr/bin/${ver_i}" |
157 |
done |
158 |
+ |
159 |
+ # symlinks to switch components to active rust in eselect |
160 |
dosym "../../lib/${PN}/${PV}/share/doc" "/usr/share/doc/${P}" |
161 |
+ dosym "rust/${PV}/lib/rustlib" "/usr/lib/rustlib-${PV}" |
162 |
+ dosym "${PV}/share/man" "/usr/lib/${PN}/man-${PV}" |
163 |
|
164 |
newenvd - "50${P}" <<-_EOF_ |
165 |
- LDPATH="${EPREFIX}/usr/lib/${PN}/${PV}/lib" |
166 |
- MANPATH="${EPREFIX}/usr/lib/${PN}/${PV}/share/man" |
167 |
+ LDPATH="${EPREFIX}/usr/lib/rust/lib" |
168 |
+ MANPATH="${EPREFIX}/usr/lib/rust/man" |
169 |
$(usex elibc_musl 'CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_RUSTFLAGS="-C target-feature=-crt-static"' '') |
170 |
_EOF_ |
171 |
|
172 |
@@ -536,14 +542,18 @@ src_install() { |
173 |
rm -rf "${ED}/usr/lib/${PN}/${PV}/doc"/*.old || die |
174 |
|
175 |
# note: eselect-rust adds EROOT to all paths below |
176 |
- cat <<-EOF > "${T}/provider-${P}" |
177 |
+ cat <<-_EOF_ > "${T}/provider-${P}" |
178 |
/usr/bin/cargo |
179 |
/usr/bin/rustdoc |
180 |
/usr/bin/rust-gdb |
181 |
/usr/bin/rust-gdbgui |
182 |
/usr/bin/rust-lldb |
183 |
+ /usr/lib/rustlib |
184 |
+ /usr/lib/rust/lib |
185 |
+ /usr/lib/rust/man |
186 |
/usr/share/doc/rust |
187 |
- EOF |
188 |
+ _EOF_ |
189 |
+ |
190 |
if use clippy; then |
191 |
echo /usr/bin/clippy-driver >> "${T}/provider-${P}" |
192 |
echo /usr/bin/cargo-clippy >> "${T}/provider-${P}" |