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-bin/
Date: Thu, 11 Feb 2021 23:49:28
Message-Id: 1613086856.c30daacad49381e17cffeb5f536b49a89a86991c.gyakovlev@gentoo
1 commit: c30daacad49381e17cffeb5f536b49a89a86991c
2 Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
3 AuthorDate: Thu Feb 11 21:58:18 2021 +0000
4 Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
5 CommitDate: Thu Feb 11 23:40:56 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c30daaca
7
8 dev-lang/rust-bin: bump to 1.50.0, with aarch64*musl support
9
10 Bug: https://bugs.gentoo.org/767451
11 Package-Manager: Portage-3.0.14, Repoman-3.0.2
12 Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>
13
14 dev-lang/rust-bin/Manifest | 14 +++
15 dev-lang/rust-bin/rust-bin-1.50.0.ebuild | 161 +++++++++++++++++++++++++++++++
16 2 files changed, 175 insertions(+)
17
18 diff --git a/dev-lang/rust-bin/Manifest b/dev-lang/rust-bin/Manifest
19 index f93e96991e0..6b7376500ac 100644
20 --- a/dev-lang/rust-bin/Manifest
21 +++ b/dev-lang/rust-bin/Manifest
22 @@ -54,3 +54,17 @@ DIST rust-1.49.0-powerpc64le-unknown-linux-gnu.tar.xz 169253520 BLAKE2B 4648467a
23 DIST rust-1.49.0-s390x-unknown-linux-gnu.tar.xz 170753008 BLAKE2B a81618240d86d4a70bd27f3e33caf0258868539b3b081a8f8f461a3debf82ab1493fea18dd5a32083d1f34db268f4bff471f5f45fb3d4910dd9559f227dc3aab SHA512 25259ea2e499c89459b14571e2c54f230d642af9cfe539dc2b8be15eff0e23b8c6e60af4c567bcbb6c6c185b4537eaab19c3395fce48b1f6e5ef1234efc31e3a
24 DIST rust-1.49.0-x86_64-unknown-linux-gnu.tar.xz 144752500 BLAKE2B 188fafdbff02cbffae22e8a48d259119c59aa435252477ba3b4f4522cc00c90d9a242bd5ac76e8d8210bd032b8f78538e5f95606fe2c862ffd7477acdfb6e1a7 SHA512 c008aa50e17db6a0134fb85235a958258d345410f5063bc77175f7c28b2e35895427b9e68cd1ac9acb769769c83313cd59fe6465b453e891cf415a2514b7722d
25 DIST rust-1.49.0-x86_64-unknown-linux-musl.tar.xz 217795696 BLAKE2B 264348951db96a9f046e4bec599b92a5ee6d185d961f833f8d2127c1ac4578b91401834d09b5eed421f03d14933ff3b2e85961ff09927d19bf6c701d80eb1b67 SHA512 be165de42e3acd50f6e6a21fe386ea2333fd0f19abedbb059d6eb8ce8c80a8e79257eab8a7775e3b72307596b52e803bd8c4c46330a6e66acbadbe2f63cea42a
26 +DIST rust-1.50.0-aarch64-unknown-linux-gnu.tar.xz 203382140 BLAKE2B c9547661356bfb2eb328992ecbfd488114bc68c00e551cbbeb925fd1650b5a4c0ab33145c6e994184766ef5046cc2881eb0009ac9d9448208cf896317bf47c63 SHA512 e6b409afc8e85a88ecb9ff439a6eb9dcb93d5553e81549fb4f332b9e2d946dce0424319c5092e60aab9435944af70d0117d15c12d54d2059ef73c1fdf36d8273
27 +DIST rust-1.50.0-arm-unknown-linux-gnueabi.tar.xz 193322872 BLAKE2B 2654e604a609f287b2722bbcac325461cc8a84d47e449470da1925f3d21a042d665e55d07f4f268e37630184998ed330b2c2e315485ebeee960c63555550c9cd SHA512 eb3aefa4ff7d2b832a847b6d4fd4427d88885cc72c3a9f97837e2516d202af39da7d523de2d1578fde20aeb76e843a84c37b4ba33f85668caa0b28d63a20968a
28 +DIST rust-1.50.0-arm-unknown-linux-gnueabihf.tar.xz 191287452 BLAKE2B 34958b97d034f6c643036c61d64e25aaedf1c93046ca039e39c9083a54d030d715d17a3174bd69bdad3f9bdb8b89c9b92f977b7d3c29da4eb28efe933402e86b SHA512 7b1f61fd53fbb361fc6b3ee603917f899f3cfc8062df3cadb0751e8014e1e2633f32ba198912e8bca34102543c427f2607e861b724143d60fd1f9682578be70d
29 +DIST rust-1.50.0-armv7-unknown-linux-gnueabihf.tar.xz 194656336 BLAKE2B d02323d9f47d380f4a06e8273b02ac3c9091257400a59b3efd1140ef22aa3bcbb71b4c5e70aaeb2cd118839a84b3513d9c85ff8020b5a1f6e68791ae5d81b8f3 SHA512 c3314436afc4ebed697bf6828b9eacbc12f96838b156241331a3b71e99e1438f8ad82e701615ea302ebfc459464479442fe653232bd319cf824027362438970d
30 +DIST rust-1.50.0-i686-unknown-linux-gnu.tar.xz 222946404 BLAKE2B 38801f395ab8f5aeee1cb709cd7fda6b6573476f9d763931086c76b0064ec0d5dff03415bc2f6f13419fb1a326cb44a0086dd42db99d1e14d520b33c6382e340 SHA512 bff117733d11731f56e8659265d0b47327e2af3f7c46aca494747a92b4f634dd35fa9731a1be59dd69821042f88bded253e1d7b5693ca237c9a167408ca7f898
31 +DIST rust-1.50.0-mips-unknown-linux-gnu.tar.xz 150524936 BLAKE2B 950424444394dd55fd81c6b850798552166d78588fcc2c4dfdd4bbc900600957eed06c4a03c83713f2f820252949f57651d69e4d2a2b78d7de42fd7e0c0404f4 SHA512 849d70b5f4b4364070c5f708e466a86afead7d82d7fde4d1ef7c8800bc1ebcafdd4e1bc69f059e393fd8fce104f2d97201f09ecb3b894676e6ff6db9c949c897
32 +DIST rust-1.50.0-mips64-unknown-linux-gnuabi64.tar.xz 159792596 BLAKE2B a361c13c036d7cc964ace781c34ed815946c976071d38d361110856e889174e2629ad9602dde5f6d5a704044cab670687b67643470b199ee18e95944dbccba16 SHA512 d85c2abff3249ccca63d14abfa85f5320e5d227b17faf7b4b47a5254a4b8ee3a4cf3ccb84e31f13dae7780176411e2a5d04894e2422ae5921f547cc5e07fd1b9
33 +DIST rust-1.50.0-mipsel-unknown-linux-gnu.tar.xz 156597932 BLAKE2B 57bf7d105f6f9d3a50904466439e88e32c99b5fd85f220ef48e82fe91b2c05c28d6783233dd3e9ba7b49e79eeeb358cd1df60369bbd927a9a867a0bdaed471c7 SHA512 019df8180520bc4fd29a258017e2477a59a30338d921f185871f64aa81d8b5499e88676d09d5887f9c6726824ae4bf50f8a9e6fae1f03e9e728f0f08ab0271c4
34 +DIST rust-1.50.0-powerpc-unknown-linux-gnu.tar.xz 168133824 BLAKE2B d2ce955ae8975d667c854fc1f8dab5de8b8a3ecf08e52dab57f40f5a036138b6006554f053616c7d369e054f9ba3dbc502b2fa47ff0463e077f831f75b831c4f SHA512 1411063401432b2aed58f53c7e9c87d70177cb7745753378df052676a6b0ee19bf7e56298584356b77707758ad531e5d4d59140cd6e686bd7cee53488553214a
35 +DIST rust-1.50.0-powerpc64-unknown-linux-gnu.tar.xz 180157804 BLAKE2B 8d3c38cdea4901f38665e66f880301c409d0de4ade5fd931c834680ee21d014fe6efb6928a417bcc747ac10ceeabccf287c0a29c009525e2d2fec92db60bad01 SHA512 d60fa7d029c52403c08722b4cdda8ebcfbbf23f57770db786007b21c8e0590577f58823b8e0b89adb38c351102b6aba0c02afa5c3582eecec5165bccb50b4944
36 +DIST rust-1.50.0-powerpc64le-unknown-linux-gnu.tar.xz 189754060 BLAKE2B 8579349a7d916ee701f29bd66d08a76d8433ad86020571e5484edbc8d9a984088e6942e31b18179698a199ade2fcee3b1b9aed1cc0d5a3b996e763ef2b8e0b33 SHA512 e3dc75ba7dff3a358042542afa398ec8771a23f5f699454a876ddc1f3583d399fe5350696a5da62d71ca97ea882c9ae1fcb60dc2e9fdf76bc7a9af892096371e
37 +DIST rust-1.50.0-s390x-unknown-linux-gnu.tar.xz 190157972 BLAKE2B 4fe8ec73293815ade006e2c383d1a6d541d87d4ebba76b3ace65793f7debfd54d3dc07cac89c43e41947f8d0b69bd0f213dbdca8173f610ca2da03bccdd55ddd SHA512 733513af2a7ef7a782a5ebfbd080071194ac47084022b54b4830de84facef9986d65525f8666a4c226e9878e43b00ebced26d6077e5fb1b7f775ac8f290fba97
38 +DIST rust-1.50.0-x86_64-unknown-linux-gnu.tar.xz 152873328 BLAKE2B b0bb91487186f13a7a1a49edeac28bc347c300911f574aba0e70c37e05b688176f5941c97cc4ad0ceddf32f2fbc0bdda6f8a1fdfa482aeb9682ea1fade28206e SHA512 ab49e3ecb14e4af8e48548845184e9ab3d564ab2341c1e5462b7847347c79d13324211b860988d219ccb646143bf142fb14c3ab03663b06cfe9ca275128d9fa0
39 +DIST rust-1.50.0-x86_64-unknown-linux-musl.tar.xz 242743828 BLAKE2B f20feb709cc07ad43f69e30a7fcefa81b5de94ee4c90cbce2616fcda8af2591a27cfa0770b71138762e21f6e07263bf3c2548bcce1b707831ab544de12ab746a SHA512 68403236e213a4f2c156b36a03ca4dd7866fdb69e87170efc76426d937dcf5cf2c5578aaf73483131b1ce7750302f9d02de1bcbc52e1283b08220d5b22be82ca
40
41 diff --git a/dev-lang/rust-bin/rust-bin-1.50.0.ebuild b/dev-lang/rust-bin/rust-bin-1.50.0.ebuild
42 new file mode 100644
43 index 00000000000..66978919c46
44 --- /dev/null
45 +++ b/dev-lang/rust-bin/rust-bin-1.50.0.ebuild
46 @@ -0,0 +1,161 @@
47 +# Copyright 1999-2021 Gentoo Authors
48 +# Distributed under the terms of the GNU General Public License v2
49 +
50 +EAPI=7
51 +
52 +inherit bash-completion-r1 rust-toolchain toolchain-funcs multilib-minimal
53 +
54 +MY_P="rust-${PV}"
55 +
56 +DESCRIPTION="Systems programming language from Mozilla"
57 +HOMEPAGE="https://www.rust-lang.org/"
58 +SRC_URI="$(rust_all_arch_uris ${MY_P})"
59 +
60 +LICENSE="|| ( MIT Apache-2.0 ) BSD-1 BSD-2 BSD-4 UoI-NCSA"
61 +SLOT="stable"
62 +KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86"
63 +IUSE="clippy cpu_flags_x86_sse2 doc rls rustfmt"
64 +
65 +DEPEND=""
66 +RDEPEND=">=app-eselect/eselect-rust-20190311"
67 +
68 +REQUIRED_USE="x86? ( cpu_flags_x86_sse2 )"
69 +
70 +QA_PREBUILT="
71 + opt/${P}/bin/.*
72 + opt/${P}/lib/.*.so
73 + opt/${P}/libexec/.*
74 + opt/${P}/lib/rustlib/.*/bin/.*
75 + opt/${P}/lib/rustlib/.*/lib/.*
76 +"
77 +
78 +pkg_pretend() {
79 + if [[ "$(tc-is-softfloat)" != "no" ]] && [[ ${CHOST} == armv7* ]]; then
80 + die "${CHOST} is not supported by upstream Rust. You must use a hard float version."
81 + fi
82 +}
83 +
84 +src_unpack() {
85 + default
86 + mv "${WORKDIR}/${MY_P}-$(rust_abi)" "${S}" || die
87 +}
88 +
89 +multilib_src_install() {
90 + if multilib_is_native_abi; then
91 +
92 + # start native abi install
93 + pushd "${S}" >/dev/null || die
94 + local analysis std
95 + analysis="$(grep 'analysis' ./components)"
96 + std="$(grep 'std' ./components)"
97 + local components="rustc,cargo,${std}"
98 + use doc && components="${components},rust-docs"
99 + use clippy && components="${components},clippy-preview"
100 + use rls && components="${components},rls-preview,${analysis}"
101 + use rustfmt && components="${components},rustfmt-preview"
102 + ./install.sh \
103 + --components="${components}" \
104 + --disable-verify \
105 + --prefix="${ED}/opt/${P}" \
106 + --mandir="${ED}/opt/${P}/man" \
107 + --disable-ldconfig \
108 + || die
109 +
110 + local symlinks=(
111 + cargo
112 + rustc
113 + rustdoc
114 + rust-gdb
115 + rust-gdbgui
116 + rust-lldb
117 + )
118 +
119 + use clippy && symlinks+=( clippy-driver cargo-clippy )
120 + use rls && symlinks+=( rls )
121 + use rustfmt && symlinks+=( rustfmt cargo-fmt )
122 +
123 + einfo "installing eselect-rust symlinks and paths"
124 + local i
125 + for i in "${symlinks[@]}"; do
126 + # we need realpath on /usr/bin/* symlink return version-appended binary path.
127 + # so /usr/bin/rustc should point to /opt/rust-bin-<ver>/bin/rustc-<ver>
128 + local ver_i="${i}-bin-${PV}"
129 + ln -v "${ED}/opt/${P}/bin/${i}" "${ED}/opt/${P}/bin/${ver_i}"
130 + dosym "../../opt/${P}/bin/${ver_i}" "/usr/bin/${ver_i}"
131 + done
132 +
133 + # symlinks to switch components to active rust in eselect
134 + dosym "../../../opt/${P}/lib" "/usr/lib/rust/lib-bin-${PV}"
135 + dosym "../../../opt/${P}/man" "/usr/lib/rust/man-bin-${PV}"
136 + dosym "../../opt/${P}/lib/rustlib" "/usr/lib/rustlib-bin-${PV}"
137 + dosym "../../../opt/${P}/share/doc/rust" "/usr/share/doc/${P}"
138 +
139 + # musl logic can be improved a bit, but fine as is for now
140 + cat <<-_EOF_ > "${T}/50${P}"
141 + LDPATH="${EPREFIX}/usr/lib/rust/lib"
142 + MANPATH="${EPREFIX}/usr/lib/rust/man"
143 + $(use amd64 && usex elibc_musl 'CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_RUSTFLAGS="-C target-feature=-crt-static"' '')
144 + $(use arm64 && usex elibc_musl 'CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_RUSTFLAGS="-C target-feature=-crt-static"' '')
145 + _EOF_
146 + doenvd "${T}/50${P}"
147 +
148 + # note: eselect-rust adds EROOT to all paths below
149 + cat <<-_EOF_ > "${T}/provider-${P}"
150 + /usr/bin/cargo
151 + /usr/bin/rustdoc
152 + /usr/bin/rust-gdb
153 + /usr/bin/rust-gdbgui
154 + /usr/bin/rust-lldb
155 + /usr/lib/rustlib
156 + /usr/lib/rust/lib
157 + /usr/lib/rust/man
158 + /usr/share/doc/rust
159 + _EOF_
160 +
161 + if use clippy; then
162 + echo /usr/bin/clippy-driver >> "${T}/provider-${P}"
163 + echo /usr/bin/cargo-clippy >> "${T}/provider-${P}"
164 + fi
165 + if use rls; then
166 + echo /usr/bin/rls >> "${T}/provider-${P}"
167 + fi
168 + if use rustfmt; then
169 + echo /usr/bin/rustfmt >> "${T}/provider-${P}"
170 + echo /usr/bin/cargo-fmt >> "${T}/provider-${P}"
171 + fi
172 +
173 + insinto /etc/env.d/rust
174 + doins "${T}/provider-${P}"
175 + popd >/dev/null || die
176 + #end native abi install
177 +
178 + else
179 + local rust_target
180 + rust_target="$(rust_abi $(get_abi_CHOST ${v##*.}))"
181 + dodir "/opt/${P}/lib/rustlib"
182 + cp -vr "${WORKDIR}/rust-${PV}-${rust_target}/rust-std-${rust_target}/lib/rustlib/${rust_target}"\
183 + "${ED}/opt/${P}/lib/rustlib" || die
184 + fi
185 +
186 + # BUG: installs x86_64 binary on other arches
187 + rm -f "${ED}/opt/${P}/lib/rustlib/"*/bin/rust-llvm-dwp || die
188 +}
189 +
190 +pkg_postinst() {
191 + eselect rust update
192 +
193 + elog "Rust installs a helper script for calling GDB now,"
194 + elog "for your convenience it is installed under /usr/bin/rust-gdb-bin-${PV},"
195 +
196 + if has_version app-editors/emacs; then
197 + elog "install app-emacs/rust-mode to get emacs support for rust."
198 + fi
199 +
200 + if has_version app-editors/gvim || has_version app-editors/vim; then
201 + elog "install app-vim/rust-vim to get vim support for rust."
202 + fi
203 +}
204 +
205 +pkg_postrm() {
206 + eselect rust cleanup
207 +}