Magellan Linux

Annotation of /trunk/extras/cargo/cargo-0.18.0-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


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