1 # Author: Taras Shpot <mrshpot@gmail.com>
6 pkgdesc="A safe, concurrent, practical language from Mozilla."
8 url="http://www.rust-lang.org/"
11 makedepends=('git' 'gcc'
12 'libffi' 'python2' # for LLVM
14 optdepends=('pandoc: to build rust.pdf'
15 'llnextgen: for build-time grammar verification'
16 'naturaldocs: to build library doc')
18 _gitroot="git://github.com/mozilla/rust.git"
23 msg "Connecting to git server...."
25 if [ -d $_gitname ] ; then
26 cd $_gitname && git pull origin
27 msg "The local files are updated."
29 git clone $_gitroot $_gitname
32 msg "git checkout done or server timeout"
34 rm -rf "$srcdir/$_gitname-build"
35 git clone "$srcdir/$_gitname" "$srcdir/$_gitname-build"
36 cd "$srcdir/$_gitname-build"
38 git submodule update --init --recursive
39 ./configure --prefix=/usr
40 msg 's/python$/python2/'
41 find . -executable -exec grep -qe 'env python$' '{}' ';' -exec sed -i 's/env python$/env python2/' '{}' ';' -print
43 msg "Starting make..."
47 make install DESTDIR="$pkgdir/usr/"
49 _docdir=$pkgdir/usr/share/doc/rust
51 for _doc in rust.pdf rust.html tutorial.html rust.css core std rust.md ; do
52 if ! [ -e "doc/$_doc" ] ; then continue ; fi
53 cp -r "doc/$_doc" "$_docdir/"
54 chmod -R 644 "$_docdir/$_doc"
55 chown -R root:root "$_docdir/$_doc"
57 find "$_docdir" -type d -exec chmod 755 '{}' ';'