Annotation of /trunk/deprecated/cargo/cargo-0.18.0-r1.smage2
Parent Directory | Revision Log
Revision 29513 -
(hide annotations)
(download)
Wed Jun 21 12:21:25 2017 UTC (7 years, 3 months ago) by niro
Original Path: trunk/extras/cargo/cargo-0.18.0-r1.smage2
File size: 1717 byte(s)
Wed Jun 21 12:21:25 2017 UTC (7 years, 3 months ago) by niro
Original Path: trunk/extras/cargo/cargo-0.18.0-r1.smage2
File size: 1717 byte(s)
auto added: ver bump to 0.18.0-r1
1 | niro | 29513 | # $Id$ |
2 | |||
3 | PNAME="cargo" | ||
4 | PVER="0.18.0" | ||
5 | PBUILD="r1" | ||
6 | |||
7 | PCAT="dev-util" | ||
8 | |||
9 | DESCRIPTION="Systems programming language focused on safety, speed and concurrency." | ||
10 | HOMEPAGE="https://crates.io/" | ||
11 | |||
12 | # enable bootstrap of cargo with prebuild binary cargo | ||
13 | # 0=no, 1=yes | ||
14 | BOOTSTRAP=1 | ||
15 | |||
16 | DEPEND=">= dev-lang/rust-1.18 | ||
17 | >= net-misc/curl-7" | ||
18 | |||
19 | SDEPEND=">= dev-util/cmake-3.6 | ||
20 | >= dev-lang/python-2.7" | ||
21 | |||
22 | if [[ ${BOOTSTRAP} = 0 ]] | ||
23 | then | ||
24 | SDEPEND=">= dev-util/cargo-0.18" | ||
25 | fi | ||
26 | |||
27 | SRCFILE="${PVER}.tar.gz" | ||
28 | SRCDIR="${BUILDDIR}/${PNAME}-${PVER}" | ||
29 | |||
30 | sminclude mbuild mtools | ||
31 | |||
32 | SRC_URI=( | ||
33 | https://github.com/rust-lang/${PNAME}/archive/${SRCFILE} | ||
34 | mirror://${PNAME}/${SRCFILE} | ||
35 | ) | ||
36 | |||
37 | UP2SEPERATOR="\/" | ||
38 | UP2DATE="updatecmd https://github.com/rust-lang/cargo/releases | highesttarball gz" | ||
39 | |||
40 | if [[ ${BOOTSTRAP} = 1 ]] | ||
41 | then | ||
42 | CARGOBIN_PVER="${PVER}" | ||
43 | CARGOBIN_SRCFILE_x86_64="cargo-${CARGOBIN_PVER}-x86_64-unknown-linux-gnu.tar.gz" | ||
44 | CARGOBIN_SRCFILE_x86="cargo-${CARGOBIN_PVER}-i686-unknown-linux-gnu.tar.gz" | ||
45 | CARGOBIN_SRCFILE="$(marchsrcfile CARGOBIN_SRCFILE)" | ||
46 | |||
47 | SRC_URI+=( | ||
48 | https://static.rust-lang.org/dist/${CARGOBIN_SRCFILE_x86_64} | ||
49 | https://static.rust-lang.org/dist/${CARGOBIN_SRCFILE_x86} | ||
50 | ) | ||
51 | fi | ||
52 | |||
53 | src_compile() | ||
54 | { | ||
55 | cd ${SRCDIR} | ||
56 | |||
57 | local myconf | ||
58 | |||
59 | # enforce rust-bin chost | ||
60 | myconf+=" --host=${ARCH}-unknown-linux-gnu --build=${ARCH}-unknown-linux-gnu" | ||
61 | |||
62 | if [[ ${BOOTSTRAP} = 1 ]] | ||
63 | then | ||
64 | myconf+=" --cargo=${CARGOBIN_SRCDIR}/cargo/bin/cargo" | ||
65 | fi | ||
66 | |||
67 | mconfigure \ | ||
68 | --release-channel=stable \ | ||
69 | --enable-optimize | ||
70 | ${myconf} \ | ||
71 | || die | ||
72 | |||
73 | mmake || die | ||
74 | } | ||
75 | |||
76 | src_install() | ||
77 | { | ||
78 | cd ${SRCDIR} | ||
79 | make prepare-image-${ARCH}-unknown-linux-gnu IMGDIR_${ARCH}-unknown-linux-gnu=${BINDIR}/usr || die | ||
80 | |||
81 | # remove unnecessary files | ||
82 | mdelete -r /usr/etc || die | ||
83 | |||
84 | minstalldocs LICENSE-* || die | ||
85 | } |