blob: 223c50f26f330f3566f386d481d5d3a4de5e55dd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/rust.asc
inherit shell-completion verify-sig
DESCRIPTION="Common files shared between multiple slots of Rust"
HOMEPAGE="https://www.rust-lang.org/"
if [[ ${PV} = *9999* ]]; then
inherit git-r3
# In case cargo is not in sync we'll fetch it as a submodule
# Nightly users will probably already have the repo cloned and up-to-date anyway.
EGIT_REPO_URI="https://github.com/rust-lang/rust.git"
EGIT_SUBMODULES=( "-*" "src/tools/cargo" )
elif [[ ${PV} == *beta* ]]; then
# Identify the snapshot date of the beta release:
# curl -Ls static.rust-lang.org/dist/channel-rust-beta.toml | grep beta-src.tar.xz
MY_PV=beta
betaver=${PV//*beta}
BETA_SNAPSHOT="${betaver:0:4}-${betaver:4:2}-${betaver:6:2}"
SRC_URI="https://static.rust-lang.org/dist/${BETA_SNAPSHOT}/rustc-beta-src.tar.xz -> rustc-${PV}-src.tar.xz
verify-sig? ( https://static.rust-lang.org/dist/${BETA_SNAPSHOT}/rustc-beta-src.tar.xz.asc
-> rustc-${PV}-src.tar.xz.asc )
"
S="${WORKDIR}/rustc-${MY_PV}-src"
else
MY_PV=${PV}
SRC_URI="https://static.rust-lang.org/dist/rustc-${PV}-src.tar.xz
verify-sig? ( https://static.rust-lang.org/dist/rustc-${PV}-src.tar.xz.asc )
"
S="${WORKDIR}/rustc-${MY_PV}-src"
KEYWORDS="~amd64 ~arm ~arm64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86"
fi
LICENSE="|| ( MIT Apache-2.0 ) BSD BSD-1 BSD-2 BSD-4"
SLOT="0"
# Legacy non-slotted versions bash completions will collide.
RDEPEND="
!dev-lang/rust:stable
!dev-lang/rust-bin:stable
"
BDEPEND="verify-sig? ( sec-keys/openpgp-keys-rust )"
src_unpack() {
if [[ ${PV} == *9999* ]]; then
git-r3_src_unpack
else
if use verify-sig ; then
verify-sig_verify_detached "${DISTDIR}"/rustc-${PV}-src.tar.xz "${DISTDIR}"/rustc-${PV}-src.tar.xz.asc
fi
# Avoid unpacking the whole tarball which would need check-reqs
tar -xf "${DISTDIR}"/rustc-${PV}-src.tar.xz "rustc-${MY_PV}-src/src/tools/cargo/src/etc/"{_cargo,cargo.bashcomp.sh} || die
fi
}
src_configure() {
:
}
src_compile() {
:
}
src_install() {
newbashcomp src/tools/cargo/src/etc/cargo.bashcomp.sh cargo
dozshcomp src/tools/cargo/src/etc/_cargo
}
|