summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: d5cec5bc7d19e9dda76d7c4df2ee60c449a0ffaf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Contributor: Isak Karlsson <isak.karlsson@gmail.com>
# Maintainer: Stefan Husmann <stefan-husmann@t-online.de>

pkgbase=rust-nightly
pkgname=('rust-nightly' 'rust-nightly-doc')
pkgver=1.22.0.2017.09.09
pkgrel=1
arch=('i686' 'x86_64')
pkgdesc='A safe, concurrent, practical language'
url='http://www.rust-lang.org/'
license=('MIT' 'Apache')
makedepends=('libffi' 'perl' 'python2' 'curl' 'llvm' 'jemalloc')
source=("http://static.rust-lang.org/dist/rustc-nightly-src.tar.gz")
options=('staticlibs' '!strip' '!emptydirs' '!makeflags')
conflicts=('rust')
provides=('rust')
md5sums=('8ede6ee2dcce23024b8c60069f5423b3')
export RUSTFLAGS="$RUSTFLAGS -C link-args=-lffi"

build() {
  cd rustc-nightly-src
 ./configure \
    --prefix=/usr \
    --release-channel=stable \
    --llvm-root=/usr \
    --disable-codegen-tests \
    --jemalloc-root=/usr/lib \
    --disable-rpath \
    --disable-compiler-docs 
}

package_rust-nightly() {
  depends=('shared-mime-info')
  provides=('rust')
  conflicts=('rust')
  cd rustc-nightly-src

  DESTDIR="$pkgdir" python2 ./x.py install
  rm -fr "$pkgdir"/usr/share/doc/rust/html
  rm -f "$pkgdir"/usr/lib/rustlib/{components,manifest-rustc,manifest-rust-docs,rust-installer-version,install.log,uninstall.sh}

  install -d "$pkgdir"/usr/share/licenses/rust-nightly/
  install -m644 COPYRIGHT LICENSE-* "$pkgdir"/usr/share/licenses/rust-nightly/
}

package_rust-nightly-doc() {
  pkgdesc="A safe, concurrent, practical language from Mozilla. (Language and API documentation)"
  arch=('any')
  optdepends=('rust-nightly: to compile and run the programs you can write using this documentation')
  provides=('rust-doc')
  conflicts=('rust-doc')

  cd rustc-nightly-src/src
  _docdir="$pkgdir"/usr/share/doc/rust
  install -d "$_docdir"
  cp -r doc/* "$_docdir"/ || true

  chmod -R 644 "$_docdir"
  find "$_docdir" -type d -exec chmod 755 {} +
  for ext in aux out log toc; do
          rm -f "$_docdir"/*."$ext"
  done
  cd ..
  install -d "$pkgdir"/usr/share/licenses/rust-nightly-doc/
  install -m644 COPYRIGHT LICENSE-* "$pkgdir"/usr/share/licenses/rust-nightly-doc/
}