Gentoo Archives: gentoo-commits

From: Dirkjan Ochtman <djc@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/rust/
Date: Sat, 04 Aug 2018 12:16:08
Message-Id: 1533384953.263a6fb60f9b4c91f299ed7ec1849c0070364443.djc@gentoo
1 commit: 263a6fb60f9b4c91f299ed7ec1849c0070364443
2 Author: Dirkjan Ochtman <djc <AT> gentoo <DOT> org>
3 AuthorDate: Fri Aug 3 12:31:58 2018 +0000
4 Commit: Dirkjan Ochtman <djc <AT> gentoo <DOT> org>
5 CommitDate: Sat Aug 4 12:15:53 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=263a6fb6
7
8 dev-lang/rust: version bump to 1.28.0
9
10 Package-Manager: Portage-2.3.40, Repoman-2.3.9
11
12 dev-lang/rust/Manifest | 4 +
13 dev-lang/rust/rust-1.28.0.ebuild | 269 +++++++++++++++++++++++++++++++++++++++
14 2 files changed, 273 insertions(+)
15
16 diff --git a/dev-lang/rust/Manifest b/dev-lang/rust/Manifest
17 index 4f60e535553..e7a6c0abd82 100644
18 --- a/dev-lang/rust/Manifest
19 +++ b/dev-lang/rust/Manifest
20 @@ -7,6 +7,10 @@ DIST rust-1.25.0-x86_64-unknown-linux-gnu.tar.xz 111059260 BLAKE2B ae982976a735c
21 DIST rust-1.26.2-aarch64-unknown-linux-gnu.tar.xz 90964988 BLAKE2B 7e5de737ff2b4711e0a5b3085f10c3f2918fc5823dcb52bc5f897a5617b65d648d5e59664dbfaa904ff08923d1bbd11aae21349760fefef6ff18ea0e45391e07 SHA512 b565ec988d3b946dabc8902eba60b446070e77b7c27aa98d981b7ba5e9285bda95565627600e6be057970de5006d9640ef77fa920849160f5cf98508b48d1673
22 DIST rust-1.26.2-i686-unknown-linux-gnu.tar.xz 143090096 BLAKE2B 7871fa4e4d0f320ff949cd31cefa116bc7b741927626958e1d10197f05fc9a662b8d6c21ddd4d2910700e6f7273e4fc18738e6ff58cd85b9af4ed25eceea31d9 SHA512 859b5b72c78cca8cd473012599ca12539ef9a5ee38d1aaaad024019fd84220e344e1cd0efd2b027ef333555b158b23529f35ceb5d59d76c35e7946b5fe4a8a52
23 DIST rust-1.26.2-x86_64-unknown-linux-gnu.tar.xz 138609432 BLAKE2B 54507a8ce3ab2676e6e66852b6d3f1a47ca07ad4b56383f6247149309a0f60f67fbf0a6ba27d968c24340c07d7d5074942c6eaccbc1207c5e75fd9a6f47b2481 SHA512 29e474b0eab4dd2ffa0b964d83f52ffce530e75c4193e307410ef6d20ef9ad2b300a4f467bdf06b3311157340e9295cb9b1efdcf08dafee66979b076c2afba7e
24 +DIST rust-1.27.2-aarch64-unknown-linux-gnu.tar.xz 94186748 BLAKE2B 7e8f46128a7638217ef63caf479e1a6d9ebde7a225b7dad55082eb06e0206f0b1a5efa65badb15127a456ddc39702482407bbb9171a11397a31bc7c85d2cbcfa SHA512 84022350f1e8fc34a353a09848333424a557ddea3b9445a1a5fc9d2f2abced942154e80888ab4091174d6d83c6766f583ef240ab2e2233de5d536633d2765040
25 +DIST rust-1.27.2-i686-unknown-linux-gnu.tar.xz 144776012 BLAKE2B 98883f45637adf0920543da8951f29bf5ab11d1f39e9f4154b77e882eadce26ec5e8ed3e9bdcf560f8009fbaab4b7255ba8eb8eeb8beadad39ec6fa74b6dde45 SHA512 e17960120bdd18a527c0783ce8ca8d76cdc9b436f36a73a82fd2ea709b253f33feeb88310fab7a86305bad403eb5dad7ea43d0e5bc5ad1e3847f29e85040303a
26 +DIST rust-1.27.2-x86_64-unknown-linux-gnu.tar.xz 144218956 BLAKE2B 40834086f211dd64ec76be37eb477697ff44783f261f0b9bfc10b46cc340cf3c15adf80d39a9df642b4985ea1239ad7f1d1803a44f3bd3d53f073bdc38a1de0e SHA512 14861392dad81d2c040d0deb64d5dd34652d5cc2875e404609a0f13c8fb6bdc38f9bc7b1e309829365a00c42b610f2b7a73cffa232ecfdf0618b5508a8667198
27 DIST rustc-1.25.0-src.tar.gz 98639156 BLAKE2B 1408d5dd0611d4830de3b6b3d00e3fad4198a47599b639d0ac0bd05aaba401f743056a942e9df04a4d192c6b12e8cfe9a9cdf8cd26e48b72104ce9b423df049e SHA512 7d8886f4d5a621eb794e814deb60be681fa38cf086f87ffa14e5a3500c640b237c549a632de1331a0f1b71963de41f6d31a4df3866b7e597424002316fed81ce
28 DIST rustc-1.26.2-src.tar.xz 54613640 BLAKE2B f361b7a0ed40ccb026750b4a70b99931f1abf52024e907b588e339902de2fbbd15501d237ac048d0537005834b0a2f49935f654a8c75d40ed95c65894f611481 SHA512 a598858ddce0e05d1d431be383400f44fc551eb2e368f37b01670c0b65ea5da6a7d5b2b68bb6ef806d2107cfa0d5007008442ad4d5ddb17d18d04e0ab31600b0
29 DIST rustc-1.27.1-src.tar.xz 55458892 BLAKE2B 9c5cec24760afdcee51fb0ba8d2289b92d34de57e97e57f2e5dc129674edab4a595ab5756c789b5de15bdd5107363f12a517169cedc7c3093fa0241d200ca3ab SHA512 4a8c03476ca1867a1130b825724ecb6bd629b889d704fdd6c3de4e188f73e2d1acdfae413f26e37505d76109d23d8e9ab409b31af3d67d244f8552730ada292d
30 +DIST rustc-1.28.0-src.tar.xz 55838968 BLAKE2B 1ff1f54dbae8c6481a6467d35b7c7dc340eba5e8c34f08ecb7b2300239c98a70c8459dacb8c8932ab6d9b3e2770e5b3508e23db7b01ff6014b7dbc076cf1de94 SHA512 a4885cd42a1006738cca2f0d8c0d5e4fd4014fc4629cbf691935bd36ffb896c553717022e67532359b5f1bd8e5050fc38b9dffed7c45cc76f7089ec134dfb980
31
32 diff --git a/dev-lang/rust/rust-1.28.0.ebuild b/dev-lang/rust/rust-1.28.0.ebuild
33 new file mode 100644
34 index 00000000000..41be6dd5569
35 --- /dev/null
36 +++ b/dev-lang/rust/rust-1.28.0.ebuild
37 @@ -0,0 +1,269 @@
38 +# Copyright 1999-2018 Gentoo Foundation
39 +# Distributed under the terms of the GNU General Public License v2
40 +
41 +EAPI=6
42 +
43 +PYTHON_COMPAT=( python2_7 python3_{5,6} pypy )
44 +
45 +inherit multiprocessing multilib-build python-any-r1 toolchain-funcs versionator
46 +
47 +if [[ ${PV} = *beta* ]]; then
48 + betaver=${PV//*beta}
49 + BETA_SNAPSHOT="${betaver:0:4}-${betaver:4:2}-${betaver:6:2}"
50 + MY_P="rustc-beta"
51 + SLOT="beta/${PV}"
52 + SRC="${BETA_SNAPSHOT}/rustc-beta-src.tar.xz"
53 + KEYWORDS=""
54 +else
55 + ABI_VER="$(get_version_component_range 1-2)"
56 + SLOT="stable/${ABI_VER}"
57 + MY_P="rustc-${PV}"
58 + SRC="${MY_P}-src.tar.xz"
59 + KEYWORDS="~amd64 ~arm64 ~x86"
60 +fi
61 +
62 +CHOST_amd64=x86_64-unknown-linux-gnu
63 +CHOST_x86=i686-unknown-linux-gnu
64 +CHOST_arm64=aarch64-unknown-linux-gnu
65 +
66 +RUST_STAGE0_VERSION="1.$(($(get_version_component_range 2) - 1)).2"
67 +RUST_STAGE0_amd64="rust-${RUST_STAGE0_VERSION}-${CHOST_amd64}"
68 +RUST_STAGE0_x86="rust-${RUST_STAGE0_VERSION}-${CHOST_x86}"
69 +RUST_STAGE0_arm64="rust-${RUST_STAGE0_VERSION}-${CHOST_arm64}"
70 +
71 +CARGO_DEPEND_VERSION="0.$(($(get_version_component_range 2) + 1)).0"
72 +
73 +DESCRIPTION="Systems programming language from Mozilla"
74 +HOMEPAGE="https://www.rust-lang.org/"
75 +
76 +SRC_URI="https://static.rust-lang.org/dist/${SRC} -> rustc-${PV}-src.tar.xz
77 + amd64? ( https://static.rust-lang.org/dist/${RUST_STAGE0_amd64}.tar.xz )
78 + x86? ( https://static.rust-lang.org/dist/${RUST_STAGE0_x86}.tar.xz )
79 + arm64? ( https://static.rust-lang.org/dist/${RUST_STAGE0_arm64}.tar.xz )
80 +"
81 +
82 +ALL_LLVM_TARGETS=( AArch64 AMDGPU ARM BPF Hexagon Lanai Mips MSP430
83 + NVPTX PowerPC Sparc SystemZ X86 XCore )
84 +ALL_LLVM_TARGETS=( "${ALL_LLVM_TARGETS[@]/#/llvm_targets_}" )
85 +LLVM_TARGET_USEDEPS=${ALL_LLVM_TARGETS[@]/%/?}
86 +
87 +LICENSE="|| ( MIT Apache-2.0 ) BSD-1 BSD-2 BSD-4 UoI-NCSA"
88 +
89 +IUSE="cargo debug doc +jemalloc rls rustfmt wasm ${ALL_LLVM_TARGETS[*]}"
90 +
91 +RDEPEND=">=app-eselect/eselect-rust-0.3_pre20150425
92 + jemalloc? ( dev-libs/jemalloc )"
93 +DEPEND="${RDEPEND}
94 + ${PYTHON_DEPS}
95 + || (
96 + >=sys-devel/gcc-4.7
97 + >=sys-devel/clang-3.5
98 + )
99 + cargo? ( !dev-util/cargo )
100 + rustfmt? ( !dev-util/rustfmt )
101 + dev-util/cmake
102 +"
103 +PDEPEND="!cargo? ( >=dev-util/cargo-${CARGO_DEPEND_VERSION} )"
104 +
105 +REQUIRED_USE="|| ( ${ALL_LLVM_TARGETS[*]} )"
106 +
107 +S="${WORKDIR}/${MY_P}-src"
108 +
109 +toml_usex() {
110 + usex "$1" true false
111 +}
112 +
113 +src_prepare() {
114 + local rust_stage0_root="${WORKDIR}"/rust-stage0
115 +
116 + local rust_stage0_name="RUST_STAGE0_${ARCH}"
117 + local rust_stage0="${!rust_stage0_name}"
118 +
119 + "${WORKDIR}/${rust_stage0}"/install.sh --disable-ldconfig --destdir="${rust_stage0_root}" --prefix=/ || die
120 +
121 + default
122 +}
123 +
124 +src_configure() {
125 + local rust_target="" rust_targets="" rust_target_name arch_cflags
126 +
127 + # Collect rust target names to compile standard libs for all ABIs.
128 + for v in $(multilib_get_enabled_abi_pairs); do
129 + rust_target_name="CHOST_${v##*.}"
130 + rust_targets="${rust_targets},\"${!rust_target_name}\""
131 + done
132 + if use wasm; then
133 + rust_targets="${rust_targets},\"wasm32-unknown-unknown\""
134 + fi
135 + rust_targets="${rust_targets#,}"
136 +
137 + local extended="false" tools=""
138 + if use cargo; then
139 + extended="true"
140 + tools="\"cargo\","
141 + fi
142 + if use rls; then
143 + extended="true"
144 + tools="\"rls\",$tools"
145 + fi
146 + if use rustfmt; then
147 + extended="true"
148 + tools="\"rustfmt\",$tools"
149 + fi
150 +
151 + local rust_stage0_root="${WORKDIR}"/rust-stage0
152 +
153 + rust_target_name="CHOST_${ARCH}"
154 + rust_target="${!rust_target_name}"
155 +
156 + cat <<- EOF > "${S}"/config.toml
157 + [llvm]
158 + optimize = $(toml_usex !debug)
159 + release-debuginfo = $(toml_usex debug)
160 + assertions = $(toml_usex debug)
161 + targets = "${LLVM_TARGETS// /;}"
162 + [build]
163 + build = "${rust_target}"
164 + host = ["${rust_target}"]
165 + target = [${rust_targets}]
166 + cargo = "${rust_stage0_root}/bin/cargo"
167 + rustc = "${rust_stage0_root}/bin/rustc"
168 + docs = $(toml_usex doc)
169 + submodules = false
170 + python = "${EPYTHON}"
171 + locked-deps = true
172 + vendor = true
173 + extended = ${extended}
174 + tools = [${tools}]
175 + [install]
176 + prefix = "${EPREFIX}/usr"
177 + libdir = "$(get_libdir)"
178 + docdir = "share/doc/${P}"
179 + mandir = "share/${P}/man"
180 + [rust]
181 + optimize = $(toml_usex !debug)
182 + debuginfo = $(toml_usex debug)
183 + debug-assertions = $(toml_usex debug)
184 + use-jemalloc = $(toml_usex jemalloc)
185 + default-linker = "$(tc-getCC)"
186 + rpath = false
187 + lld = $(toml_usex wasm)
188 + EOF
189 +
190 + for v in $(multilib_get_enabled_abi_pairs); do
191 + rust_target=$(get_abi_CHOST ${v##*.})
192 + arch_cflags="$(get_abi_CFLAGS ${v##*.})"
193 +
194 + cat <<- EOF >> "${S}"/config.env
195 + CFLAGS_${rust_target}=${arch_cflags}
196 + EOF
197 +
198 + cat <<- EOF >> "${S}"/config.toml
199 + [target.${rust_target}]
200 + cc = "$(tc-getBUILD_CC)"
201 + cxx = "$(tc-getBUILD_CXX)"
202 + linker = "$(tc-getCC)"
203 + ar = "$(tc-getAR)"
204 + EOF
205 + done
206 +
207 + if use wasm; then
208 + cat <<- EOF >> "${S}"/config.toml
209 + [target.wasm32-unknown-unknown]
210 + linker = "lld"
211 + EOF
212 + fi
213 +}
214 +
215 +src_compile() {
216 + env $(cat "${S}"/config.env)\
217 + ./x.py build --config="${S}"/config.toml -j$(makeopts_jobs) \
218 + --exclude src/tools/miri || die # https://github.com/rust-lang/rust/issues/52305
219 +}
220 +
221 +src_install() {
222 + local rust_target abi_libdir
223 +
224 + env DESTDIR="${D}" ./x.py install || die
225 +
226 + mv "${D}/usr/bin/rustc" "${D}/usr/bin/rustc-${PV}" || die
227 + mv "${D}/usr/bin/rustdoc" "${D}/usr/bin/rustdoc-${PV}" || die
228 + mv "${D}/usr/bin/rust-gdb" "${D}/usr/bin/rust-gdb-${PV}" || die
229 + mv "${D}/usr/bin/rust-lldb" "${D}/usr/bin/rust-lldb-${PV}" || die
230 + if use cargo; then
231 + mv "${D}/usr/bin/cargo" "${D}/usr/bin/cargo-${PV}" || die
232 + fi
233 + if use rls; then
234 + mv "${D}/usr/bin/rls" "${D}/usr/bin/rls-${PV}" || die
235 + fi
236 + if use rustfmt; then
237 + mv "${D}/usr/bin/rustfmt" "${D}/usr/bin/rustfmt-${PV}" || die
238 + mv "${D}/usr/bin/cargo-fmt" "${D}/usr/bin/cargo-fmt-${PV}" || die
239 + fi
240 +
241 + # Copy shared library versions of standard libraries for all targets
242 + # into the system's abi-dependent lib directories because the rust
243 + # installer only does so for the native ABI.
244 + for v in $(multilib_get_enabled_abi_pairs); do
245 + if [ ${v##*.} = ${DEFAULT_ABI} ]; then
246 + continue
247 + fi
248 + abi_libdir=$(get_abi_LIBDIR ${v##*.})
249 + rust_target=$(get_abi_CHOST ${v##*.})
250 + mkdir -p "${D}/usr/${abi_libdir}"
251 + cp "${D}/usr/$(get_libdir)/rustlib/${rust_target}/lib"/*.so \
252 + "${D}/usr/${abi_libdir}" || die
253 + done
254 +
255 + dodoc COPYRIGHT
256 +
257 + # FIXME:
258 + # Really not sure if that env is needed, specailly LDPATH
259 + cat <<-EOF > "${T}"/50${P}
260 + LDPATH="/usr/$(get_libdir)/${P}"
261 + MANPATH="/usr/share/${P}/man"
262 + EOF
263 + doenvd "${T}"/50${P}
264 +
265 + cat <<-EOF > "${T}/provider-${P}"
266 + /usr/bin/rustdoc
267 + /usr/bin/rust-gdb
268 + /usr/bin/rust-lldb
269 + EOF
270 + if use cargo; then
271 + echo /usr/bin/cargo >> "${T}/provider-${P}"
272 + fi
273 + if use rls; then
274 + echo /usr/bin/rls >> "${T}/provider-${P}"
275 + fi
276 + if use rustfmt; then
277 + echo /usr/bin/rustfmt >> "${T}/provider-${P}"
278 + echo /usr/bin/cargo-fmt >> "${T}/provider-${P}"
279 + fi
280 + dodir /etc/env.d/rust
281 + insinto /etc/env.d/rust
282 + doins "${T}/provider-${P}"
283 +}
284 +
285 +pkg_postinst() {
286 + eselect rust update --if-unset
287 +
288 + elog "Rust installs a helper script for calling GDB and LLDB,"
289 + elog "for your convenience it is installed under /usr/bin/rust-{gdb,lldb}-${PV}."
290 +
291 + if has_version app-editors/emacs || has_version app-editors/emacs-vcs; then
292 + elog "install app-emacs/rust-mode to get emacs support for rust."
293 + fi
294 +
295 + if has_version app-editors/gvim || has_version app-editors/vim; then
296 + elog "install app-vim/rust-vim to get vim support for rust."
297 + fi
298 +
299 + if has_version 'app-shells/zsh'; then
300 + elog "install app-shells/rust-zshcomp to get zsh completion for rust."
301 + fi
302 +}
303 +
304 +pkg_postrm() {
305 + eselect rust unset --if-invalid
306 +}