summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 829d1564b8f7bc1b88116f7053b85dcea4e8f2a8 (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
67
68
69
70
71
72
73
74
75
76
77
# Contributor: Isak Karlsson <isak.karlsson@gmail.com>
# Contributor: Stefan Husmann <stefan-husmann@t-online.de>
# Maintainer: Abuzer Rafey <arafey@vyvygen.org>

pkgbase=rust-nightly
pkgname=('rust-nightly' 'rust-nightly-doc')
pkgver=1.41.0_2019.11.18
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' 'cargo')
_src="https://static.rust-lang.org/dist/rustc-nightly-src.tar.xz"
source=($_src)
options=('staticlibs' '!strip' '!emptydirs' '!makeflags')
conflicts=('rust')
provides=('rust')
sha256sums=("$(curl -sL $_src.sha256 | cut -d\  -f1)")

export RUSTFLAGS="$RUSTFLAGS -C link-args=-lffi"

pkgver() {
  cd ${srcdir}/rustc-nightly-src
  ver="$(expr "$(cat version)" : '\(.*\)-nightly')"
  date="$(expr "$(cat version)" : '.* \(.*\))')"
  echo "${ver}_${date//\-/.}"
}

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

package_rust-nightly() {
  depends=('shared-mime-info')
  optdepends=('rust-doc-git: language and API documentation')
  provides=('rust')
  conflicts=('rust')
  cd rustc-nightly-src

  DESTDIR="$pkgdir" python2 ./x.py install
  rm -fr "$pkgdir"/usr/share/doc/rust/html
  rm "$pkgdir"/usr/share/doc/rust/README.md
  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/
}