Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


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