Contents of /trunk/extras/cargo/cargo-0.24.0-r1.smage2
Parent Directory | Revision Log
Revision 30460 -
(show annotations)
(download)
Wed Jan 24 09:23:17 2018 UTC (6 years, 8 months ago) by niro
File size: 1999 byte(s)
Wed Jan 24 09:23:17 2018 UTC (6 years, 8 months ago) by niro
File size: 1999 byte(s)
auto added: ver bump to 0.24.0-r1
1 | # $Id$ |
2 | |
3 | PNAME="cargo" |
4 | PVER="0.24.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.23 |
17 | >= net-misc/curl-7 |
18 | >= net-libs/libssh2-1.8 |
19 | >= dev-libs/openssl-1.1 |
20 | >= sys-libs/zlib-1.2" |
21 | |
22 | SDEPEND=">= dev-util/cmake-3.6 |
23 | >= dev-lang/python-2.7" |
24 | |
25 | if [[ ${BOOTSTRAP} = 0 ]] |
26 | then |
27 | SDEPEND="${SDEPEND} |
28 | >= dev-util/cargo-0.23" |
29 | fi |
30 | |
31 | SRCFILE="${PVER}.tar.gz" |
32 | SRCDIR="${BUILDDIR}/${PNAME}-${PVER}" |
33 | |
34 | msetfeature "!check" # no check target in makefile |
35 | sminclude mbuild mtools |
36 | |
37 | SRC_URI=( |
38 | https://github.com/rust-lang/${PNAME}/archive/${SRCFILE} |
39 | mirror://${PNAME}/${SRCFILE} |
40 | ) |
41 | |
42 | UP2SEPERATOR="\/" |
43 | UP2DATE="updatecmd https://github.com/rust-lang/cargo/releases | highesttarball gz" |
44 | |
45 | if [[ ${BOOTSTRAP} = 1 ]] |
46 | then |
47 | CARGOBIN_PVER="${PVER}" |
48 | CARGOBIN_SRCFILE_x86_64="cargo-${CARGOBIN_PVER}-x86_64-unknown-linux-gnu.tar.gz" |
49 | CARGOBIN_SRCDIR_x86_64="${BUILDDIR}/cargo-${CARGOBIN_PVER}-x86_64-unknown-linux-gnu" |
50 | CARGOBIN_SRCFILE_x86="cargo-${CARGOBIN_PVER}-i686-unknown-linux-gnu.tar.gz" |
51 | CARGOBIN_SRCDIR_x86="${BUILDDIR}/cargo-${CARGOBIN_PVER}-i686-unknown-linux-gnu" |
52 | CARGOBIN_SRCFILE="$(marchsrcfile CARGOBIN_SRCFILE)" |
53 | CARGOBIN_SRCDIR="$(marchsrcdir CARGOBIN_SRCDIR)" |
54 | |
55 | SRC_URI+=( |
56 | https://static.rust-lang.org/dist/${CARGOBIN_SRCFILE_x86_64} |
57 | https://static.rust-lang.org/dist/${CARGOBIN_SRCFILE_x86} |
58 | ) |
59 | fi |
60 | |
61 | src_prepare() |
62 | { |
63 | munpack ${SRCFILE} || die |
64 | |
65 | if [[ ${BOOTSTRAP} = 1 ]] |
66 | then |
67 | munpack ${CARGOBIN_SRCFILE} || die |
68 | fi |
69 | } |
70 | |
71 | src_compile() |
72 | { |
73 | cd ${SRCDIR} |
74 | |
75 | local cargo |
76 | if [[ ${BOOTSTRAP} = 1 ]] |
77 | then |
78 | cargo="${CARGOBIN_SRCDIR}/cargo/bin/cargo" |
79 | else |
80 | cargo="/usr/bin/cargo" |
81 | fi |
82 | |
83 | ${cargo} build --release --verbose || die |
84 | } |
85 | |
86 | src_install() |
87 | { |
88 | cd ${SRCDIR} |
89 | |
90 | minstallexec target/release/cargo || die |
91 | minstallman src/etc/man/* || die |
92 | minstalldocs ARCHITECTURE* CONTRIBUTING* LICENSE* README* || die |
93 | } |