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