Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


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