Contents of /trunk/extras/rust/rust-1.23.0-r1.smage2
Parent Directory | Revision Log
Revision 30450 -
(show annotations)
(download)
Tue Jan 23 09:21:08 2018 UTC (6 years, 3 months ago) by niro
File size: 4258 byte(s)
Tue Jan 23 09:21:08 2018 UTC (6 years, 3 months ago) by niro
File size: 4258 byte(s)
auto added: ver bump to 1.23.0-r1
1 | # $Id$ |
2 | |
3 | PNAME="rust" |
4 | PVER="1.23.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 | # enable bootstrap of rust with prebuild binary rust |
13 | # 0=no, 1=yes |
14 | BOOTSTRAP=1 |
15 | |
16 | DEPEND=">= sys-libs/llvm-libs-5.0" |
17 | |
18 | SDEPEND=">= sys-dev/llvm-5.0 |
19 | >= dev-lang/perl-5.26 |
20 | >= dev-lang/python-2.7 |
21 | >= dev-libs/libffi-3.2 |
22 | >= dev-libs/jemalloc-5 |
23 | >= net-misc/curl-7" |
24 | |
25 | if [[ ${BOOTSTRAP} = 0 ]] |
26 | then |
27 | SDEPEND+=" |
28 | >= dev-lang/rust-1.21" |
29 | fi |
30 | |
31 | SRCFILE="${PNAME}c-${PVER}-src.tar.gz" |
32 | SRCDIR="${BUILDDIR}/${PNAME}c-${PVER}-src" |
33 | |
34 | msetfeature "!check" |
35 | sminclude mbuild mtools |
36 | |
37 | SRC_URI=( |
38 | https://static.rust-lang.org/dist/${SRCFILE} |
39 | mirror://${PNAME}/${SRCFILE} |
40 | mirror://${PNAME}/${PNAME}-${PVER}-thinlto-llvm5-fixes.patch |
41 | ) |
42 | |
43 | UP2DATE="updatecmd https://www.rust-lang.org/en-US/other-installers.html | grep 'rustc-.*-src.*' | sed 's:-src::g' | highesttarball gz" |
44 | |
45 | if [[ ${BOOTSTRAP} = 1 ]] |
46 | then |
47 | # see src/stage0.txt |
48 | RUSTBIN_PVER="1.21.0" |
49 | RUSTBIN_DATE="2017-10-12" |
50 | RUSTBIN_SRCFILE_x86_64="rustc-${RUSTBIN_PVER}-x86_64-unknown-linux-gnu.tar.gz" |
51 | RUSTBIN_SRCFILE_x86="rustc-${RUSTBIN_PVER}-i686-unknown-linux-gnu.tar.gz" |
52 | RUSTBIN_SRCFILE="$(marchsrcfile RUSTBIN_SRCFILE)" |
53 | RUSTSTD_SRCFILE_x86_64="rust-std-${RUSTBIN_PVER}-x86_64-unknown-linux-gnu.tar.gz" |
54 | RUSTSTD_SRCFILE_x86="rust-std-${RUSTBIN_PVER}-i686-unknown-linux-gnu.tar.gz" |
55 | RUSTSTD_SRCFILE="$(marchsrcfile RUSTSTD_SRCFILE)" |
56 | CARGOBIN_PVER="0.22.0" |
57 | CARGOBIN_SRCFILE_x86_64="cargo-${CARGOBIN_PVER}-x86_64-unknown-linux-gnu.tar.gz" |
58 | CARGOBIN_SRCFILE_x86="cargo-${CARGOBIN_PVER}-i686-unknown-linux-gnu.tar.gz" |
59 | CARGOBIN_SRCFILE="$(marchsrcfile CARGOBIN_SRCFILE)" |
60 | |
61 | SRC_URI+=( |
62 | https://static.rust-lang.org/dist/${RUSTBIN_DATE}/${RUSTBIN_SRCFILE_x86_64} |
63 | https://static.rust-lang.org/dist/${RUSTBIN_DATE}/${RUSTBIN_SRCFILE_x86} |
64 | https://static.rust-lang.org/dist/${RUSTBIN_DATE}/${RUSTSTD_SRCFILE_x86_64} |
65 | https://static.rust-lang.org/dist/${RUSTBIN_DATE}/${RUSTSTD_SRCFILE_x86} |
66 | https://static.rust-lang.org/dist/${RUSTBIN_DATE}/${CARGOBIN_SRCFILE_x86_64} |
67 | https://static.rust-lang.org/dist/${RUSTBIN_DATE}/${CARGOBIN_SRCFILE_x86} |
68 | ) |
69 | fi |
70 | |
71 | src_prepare() |
72 | { |
73 | munpack ${SRCFILE} || die |
74 | |
75 | if [[ ${BOOTSTRAP} = 1 ]] |
76 | then |
77 | install -d ${SRCDIR}/build/cache/${RUSTBIN_DATE} || die |
78 | ln -snf ${SOURCEDIR}/${PNAME}/${RUSTBIN_SRCFILE} ${SRCDIR}/build/cache/${RUSTBIN_DATE}/ || die |
79 | ln -snf ${SOURCEDIR}/${PNAME}/${RUSTSTD_SRCFILE} ${SRCDIR}/build/cache/${RUSTBIN_DATE}/ || die |
80 | ln -snf ${SOURCEDIR}/${PNAME}/${CARGOBIN_SRCFILE} ${SRCDIR}/build/cache/${RUSTBIN_DATE}/ || die |
81 | fi |
82 | |
83 | cd ${SRCDIR} |
84 | |
85 | # apply llvm5 thinLTO fixes |
86 | # see: https://github.com/rust-lang/rust/pull/45301, https://github.com/rust-lang/rust/pull/45301/files |
87 | mpatch ${PNAME}-${PVER}-thinlto-llvm5-fixes.patch || die |
88 | } |
89 | |
90 | src_compile() |
91 | { |
92 | cd ${SRCDIR} |
93 | |
94 | local myconf |
95 | |
96 | # enforce rust-bin chost |
97 | local myARCH |
98 | [[ ${ARCH} = i*86 ]] && myARCH=i686 |
99 | myconf+=" --host=${myARCH}-unknown-linux-gnu --build=${myARCH}-unknown-linux-gnu" |
100 | |
101 | if [[ ${BOOTSTRAP} = 0 ]] |
102 | then |
103 | myconf+=" --enable-local-rust" |
104 | fi |
105 | |
106 | # configure nor working after rewrite, duplicate options are not accepted anymore |
107 | # not working atm due bug: |
108 | # --infodir=/usr/share/info |
109 | # --localstatedir=/var/lib |
110 | # --datadir=/usr/share |
111 | ./configure \ |
112 | --prefix=/usr \ |
113 | --mandir=/usr/share/man \ |
114 | --sysconfdir=/etc \ |
115 | --libdir=/usr/$(mlibdir) \ |
116 | --release-channel=stable \ |
117 | --llvm-root=/usr \ |
118 | --enable-llvm-link-shared \ |
119 | --jemalloc-root=/usr/$(mlibdir) \ |
120 | --disable-codegen-tests \ |
121 | ${myconf} \ |
122 | || die |
123 | |
124 | # missing llvm link deps |
125 | export RUSTFLAGS="$RUSTFLAGS -C link-args=-lffi" |
126 | python2 ./x.py build --verbose || die |
127 | } |
128 | |
129 | src_install() |
130 | { |
131 | cd ${SRCDIR} |
132 | mmake DESTDIR=${BINDIR} install || die |
133 | |
134 | # remove unnecessary files |
135 | mdelete /usr/$(mlibdir)/rustlib/components || die |
136 | mdelete /usr/$(mlibdir)/rustlib/manifest-rustc || die |
137 | mdelete /usr/$(mlibdir)/rustlib/rust-installer-version || die |
138 | |
139 | # overwrite duplicate solibs with symlinks to safe space |
140 | local i |
141 | for i in ${BINDIR}/usr/$(mlibdir)/rustlib/${ARCH}-unknown-linux-gnu/lib/* |
142 | do |
143 | mlink rustlib/${ARCH}-unknown-linux-gnu/lib/$(basename ${i}) /usr/$(mlibdir)/ || die |
144 | done |
145 | |
146 | minstalldocs COPYRIGHT LICENSE-* ChangeLog README* || die |
147 | } |