Annotation of /trunk/extras/rust/rust-1.18.0-r1.smage2
Parent Directory
|
Revision Log
Revision 29511 -
(hide annotations)
(download)
Wed Jun 21 07:16:26 2017 UTC (7 years ago) by niro
File size: 3618 byte(s)
Wed Jun 21 07:16:26 2017 UTC (7 years ago) by niro
File size: 3618 byte(s)
auto added: ver bump to 1.18.0-r1
1 | niro | 29509 | # $Id$ |
2 | |||
3 | PNAME="rust" | ||
4 | PVER="1.18.0" | ||
5 | PBUILD="r1" | ||
6 | |||
7 | PCAT="dev-lang" | ||
8 | |||
9 | DESCRIPTION="Systems programming language focused on safety, speed and concurrency." | ||
10 | HOMEPAGE="https://www.rust-lang.org/" | ||
11 | |||
12 | niro | 29510 | # enable bootstrap of rust with prebuild binary rust |
13 | # 0=no, 1=yes | ||
14 | BOOTSTRAP=1 | ||
15 | |||
16 | niro | 29509 | DEPEND=">= sys-libs/llvm-libs-3.9" |
17 | |||
18 | SDEPEND=">= sys-dev/llvm-3.9 | ||
19 | >= dev-lang/perl-5.24 | ||
20 | >= dev-lang/python-2.7 | ||
21 | >= dev-libs/libffi-3.2 | ||
22 | >= dev-libs/jemalloc-5 | ||
23 | >= net-misc/curl-7" | ||
24 | |||
25 | niro | 29510 | if [[ ${BOOTSTRAP} = 0 ]] |
26 | then | ||
27 | SDEPEND=">= dev-lang/rust-1.18" | ||
28 | fi | ||
29 | |||
30 | niro | 29509 | SRCFILE="${PNAME}c-${PVER}-src.tar.gz" |
31 | SRCDIR="${BUILDDIR}/${PNAME}c-${PVER}-src" | ||
32 | |||
33 | sminclude mbuild mtools | ||
34 | |||
35 | SRC_URI=( | ||
36 | https://static.rust-lang.org/dist/${SRCFILE} | ||
37 | mirror://${PNAME}/${SRCFILE} | ||
38 | ) | ||
39 | |||
40 | UP2DATE="updatecmd https://www.rust-lang.org/en-US/other-installers.html | grep 'rustc-.*-src.*' | sed 's:-src::g' | highesttarball gz" | ||
41 | |||
42 | niro | 29510 | if [[ ${BOOTSTRAP} = 1 ]] |
43 | then | ||
44 | # see src/stage0.txt | ||
45 | RUSTBIN_PVER="1.17.0" | ||
46 | RUSTBIN_DATE="2017-04-27" | ||
47 | RUSTBIN_SRCFILE_x86_64="rustc-${RUSTBIN_PVER}-x86_64-unknown-linux-gnu.tar.gz" | ||
48 | RUSTBIN_SRCFILE_x86="rustc-${RUSTBIN_PVER}-i686-unknown-linux-gnu.tar.gz" | ||
49 | RUSTBIN_SRCFILE="$(marchsrcfile RUSTBIN_SRCFILE)" | ||
50 | RUSTSTD_SRCFILE_x86_64="rust-std-${RUSTBIN_PVER}-x86_64-unknown-linux-gnu.tar.gz" | ||
51 | RUSTSTD_SRCFILE_x86="rust-std-${RUSTBIN_PVER}-i686-unknown-linux-gnu.tar.gz" | ||
52 | RUSTSTD_SRCFILE="$(marchsrcfile RUSTSTD_SRCFILE)" | ||
53 | CARGOBIN_PVER="0.18.0" | ||
54 | CARGOBIN_SRCFILE_x86_64="cargo-${CARGOBIN_PVER}-x86_64-unknown-linux-gnu.tar.gz" | ||
55 | CARGOBIN_SRCFILE_x86="cargo-${CARGOBIN_PVER}-i686-unknown-linux-gnu.tar.gz" | ||
56 | CARGOBIN_SRCFILE="$(marchsrcfile CARGOBIN_SRCFILE)" | ||
57 | niro | 29509 | |
58 | niro | 29510 | SRC_URI+=( |
59 | https://static.rust-lang.org/dist/${RUSTBIN_DATE}/${RUSTBIN_SRCFILE_x86_64} | ||
60 | https://static.rust-lang.org/dist/${RUSTBIN_DATE}/${RUSTBIN_SRCFILE_x86} | ||
61 | https://static.rust-lang.org/dist/${RUSTBIN_DATE}/${RUSTSTD_SRCFILE_x86_64} | ||
62 | https://static.rust-lang.org/dist/${RUSTBIN_DATE}/${RUSTSTD_SRCFILE_x86} | ||
63 | https://static.rust-lang.org/dist/${RUSTBIN_DATE}/${CARGOBIN_SRCFILE_x86_64} | ||
64 | https://static.rust-lang.org/dist/${RUSTBIN_DATE}/${CARGOBIN_SRCFILE_x86} | ||
65 | ) | ||
66 | fi | ||
67 | |||
68 | src_prepare() | ||
69 | { | ||
70 | munpack ${SRCFILE} || die | ||
71 | |||
72 | if [[ ${BOOTSTRAP} = 1 ]] | ||
73 | then | ||
74 | install -d ${SRCDIR}/build/cache/${RUSTBIN_DATE} || die | ||
75 | niro | 29511 | ln -snf ${SOURCEDIR}/${PNAME}/${RUSTBIN_SRCFILE} ${SRCDIR}/build/cache/${RUSTBIN_DATE}/ || die |
76 | ln -snf ${SOURCEDIR}/${PNAME}/${RUSTSTD_SRCFILE} ${SRCDIR}/build/cache/${RUSTBIN_DATE}/ || die | ||
77 | ln -snf ${SOURCEDIR}/${PNAME}/${CARGOBIN_SRCFILE} ${SRCDIR}/build/cache/${RUSTBIN_DATE}/ || die | ||
78 | niro | 29510 | fi |
79 | } | ||
80 | |||
81 | niro | 29509 | src_compile() |
82 | { | ||
83 | cd ${SRCDIR} | ||
84 | |||
85 | niro | 29510 | local myconf |
86 | |||
87 | # enforce rust-bin chost | ||
88 | myconf+=" --host=${ARCH}-unknown-linux-gnu --build=${ARCH}-unknown-linux-gnu" | ||
89 | |||
90 | if [[ ${BOOTSTRAP} = 0 ]] | ||
91 | then | ||
92 | myconf+=" --enable-local-rust" | ||
93 | fi | ||
94 | |||
95 | niro | 29509 | mconfigure \ |
96 | --release-channel=stable \ | ||
97 | --llvm-root=/usr \ | ||
98 | --enable-llvm-link-shared \ | ||
99 | niro | 29510 | --jemalloc-root=/usr/$(mlibdir) \ |
100 | niro | 29509 | --disable-codegen-tests \ |
101 | niro | 29510 | ${myconf} \ |
102 | niro | 29509 | || die |
103 | |||
104 | # missing llvm link deps | ||
105 | export RUSTFLAGS="$RUSTFLAGS -C link-args=-lffi" | ||
106 | python2 ./x.py build --verbose || die | ||
107 | } | ||
108 | |||
109 | src_install() | ||
110 | { | ||
111 | cd ${SRCDIR} | ||
112 | mmake DESTDIR=${BINDIR} install || die | ||
113 | |||
114 | # remove unnecessary files | ||
115 | mdelete /usr/$(mlibdir)/rustlib/components || die | ||
116 | mdelete /usr/$(mlibdir)/rustlib/manifest-rustc || die | ||
117 | mdelete /usr/$(mlibdir)/rustlib/rust-installer-version || die | ||
118 | |||
119 | niro | 29510 | # overwrite duplicate solibs with symlinks to safe space |
120 | local i | ||
121 | for i in ${BINDIR}/usr/$(mlibdir)/rustlib/${ARCH}-unknown-linux-gnu/lib/* | ||
122 | do | ||
123 | mlink rustlib/${ARCH}-unknown-linux-gnu/lib/$(basename ${i}) /usr/$(mlibdir)/ || die | ||
124 | done | ||
125 | |||
126 | minstalldocs COPYRIGHT LICENSE-* ChangeLog README* || die | ||
127 | niro | 29509 | } |