aboutsummaryrefslogtreecommitdiffstats
path: root/rustc/PKGBUILD
blob: 0adefa9b61de9acd518ae9afdbe0b6410d879015 (plain) (blame)
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
#Maintainer: Zee Eichel  <zee@dracos-linux.org>

pkgname=rustc
pkgver=1.32.0
pkgrel=1
pkgdesc="An Programer to safe, concurrent, practical language"
arch=('x86_64')
url="https://static.rust-lang.org/"
license=('BSD')
depends=('curl' 'libssh2' 'cmake')
makedepends=('python2')
source=("https://static.rust-lang.org/dist/rustc-1.32.0-src.tar.gz")
sha256sums=('4c594c7712a0e7e8eae6526c464bf6ea1d82f77b4f61717c3fc28fb27ba2224a')

prepare() {
  cd "$pkgname"-"$pkgver"-src
  mkdir -pv $pkgdir/opt/rustc             &&
  ln -svfin rustc-1.32.0 $pkgdir/opt/rustc

cat << EOF > config.toml
# see config.toml.example for more possible options
[llvm]
ninja = true
targets = "X86"
experimental-targets = ""

[build]
docs = false
extended = true

[install]
prefix = "/opt/rustc-1.32.0"
docdir = "share/doc/rustc-1.32.0"

[rust]
channel = "stable"
rpath = false
codegen-tests = false
backtrace-on-ice = true
EOF
}

build() {
  cd "$pkgname"-"$pkgver"-src
  export RUSTFLAGS="$RUSTFLAGS -C link-args=-lffi" &&
  python3 ./x.py build --exclude src/tools/miri
}

package() {
  cd "$pkgname"-"$pkgver"-src
  export LIBSSH2_SYS_USE_PKG_CONFIG=1 &&
  DESTDIR=${srcdir}/install python3 ./x.py install &&
  unset LIBSSH2_SYS_USE_PKG_CONFIG
  chown -R root:root install &&
  cp -a install/* $pkgdir/
  install=rustc.install
}