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