Magellan Linux

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