Magellan Linux

Contents of /smage/trunk/extras/cargo/cargo-0.19.0-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


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