Contents of /trunk/deprecated/cargo/cargo-0.18.0-r1.smage2
Parent Directory | Revision Log
Revision 29518 -
(show annotations)
(download)
Wed Jun 21 13:01:01 2017 UTC (7 years, 3 months ago) by niro
Original Path: trunk/extras/cargo/cargo-0.18.0-r1.smage2
File size: 2118 byte(s)
Wed Jun 21 13:01:01 2017 UTC (7 years, 3 months ago) by niro
Original Path: trunk/extras/cargo/cargo-0.18.0-r1.smage2
File size: 2118 byte(s)
auto added: ver bump to 0.18.0-r1
1 | # $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 | msetfeature "!check" # no check target in makefile |
31 | sminclude mbuild mtools |
32 | |
33 | SRC_URI=( |
34 | https://github.com/rust-lang/${PNAME}/archive/${SRCFILE} |
35 | mirror://${PNAME}/${SRCFILE} |
36 | ) |
37 | |
38 | UP2SEPERATOR="\/" |
39 | UP2DATE="updatecmd https://github.com/rust-lang/cargo/releases | highesttarball gz" |
40 | |
41 | if [[ ${BOOTSTRAP} = 1 ]] |
42 | then |
43 | CARGOBIN_PVER="${PVER}" |
44 | CARGOBIN_SRCFILE_x86_64="cargo-${CARGOBIN_PVER}-x86_64-unknown-linux-gnu.tar.gz" |
45 | CARGOBIN_SRCDIR_x86_64="${BUILDDIR}/cargo-${CARGOBIN_PVER}-x86_64-unknown-linux-gnu" |
46 | CARGOBIN_SRCFILE_x86="cargo-${CARGOBIN_PVER}-i686-unknown-linux-gnu.tar.gz" |
47 | CARGOBIN_SRCDIR_x86="${BUILDDIR}/cargo-${CARGOBIN_PVER}-i686-unknown-linux-gnu" |
48 | CARGOBIN_SRCFILE="$(marchsrcfile CARGOBIN_SRCFILE)" |
49 | CARGOBIN_SRCDIR="$(marchsrcdir CARGOBIN_SRCDIR)" |
50 | |
51 | SRC_URI+=( |
52 | https://static.rust-lang.org/dist/${CARGOBIN_SRCFILE_x86_64} |
53 | https://static.rust-lang.org/dist/${CARGOBIN_SRCFILE_x86} |
54 | ) |
55 | fi |
56 | |
57 | src_prepare() |
58 | { |
59 | munpack ${SRCFILE} || die |
60 | |
61 | if [[ ${BOOTSTRAP} = 1 ]] |
62 | then |
63 | munpack ${CARGOBIN_SRCFILE} || die |
64 | fi |
65 | } |
66 | |
67 | src_compile() |
68 | { |
69 | cd ${SRCDIR} |
70 | |
71 | local myconf |
72 | |
73 | # enforce rust-bin chost |
74 | myconf+=" --host=${ARCH}-unknown-linux-gnu --build=${ARCH}-unknown-linux-gnu" |
75 | |
76 | if [[ ${BOOTSTRAP} = 1 ]] |
77 | then |
78 | myconf+=" --cargo=${CARGOBIN_SRCDIR}/cargo/bin/cargo" |
79 | fi |
80 | |
81 | mconfigure \ |
82 | --release-channel=stable \ |
83 | --enable-optimize \ |
84 | ${myconf} \ |
85 | || die |
86 | |
87 | mmake VERBOSE=1 || die |
88 | } |
89 | |
90 | src_install() |
91 | { |
92 | cd ${SRCDIR} |
93 | make prepare-image-${ARCH}-unknown-linux-gnu IMGDIR_${ARCH}-unknown-linux-gnu=${BINDIR}/usr || die |
94 | |
95 | # remove unnecessary files |
96 | mdelete -r /usr/etc || die |
97 | |
98 | minstalldocs LICENSE-* || die |
99 | } |