summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 3d52389098f068c9d7e62ef1d77311258398567f (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
# Maintainer: Vomitblood <tohyouxuan@gmail.com>

pkgname=rustmon-git
pkgdesc="Pokemon Colorscripts written in Rust"
_gitname=rustmon
pkgver=r53.104b4eb
pkgrel=1
arch=('x86_64')
url="https://github.com/Vomitblood/$_gitname"
license=('GPL')
depends=('glibc' 'gcc-libs' 'base-devel')
makedepends=('git' 'cargo')
provides=("$_gitname")
source=("git+$url.git")
md5sums=('SKIP')
options=(!debug)
PKGEXT='.pkg.tar'

pkgver() {
  cd "$_gitname"
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

build() {
  # fix linking errors
  export CFLAGS="-fPIE"
  cd "$srcdir/$_gitname"
  # build main program
  cargo build --release --bin rustmon
  # build mini program
  cargo build --release --bin minimon
}

package() {
  cd "$srcdir/$_gitname"
  install -Dm755 target/release/rustmon "$pkgdir/usr/bin/rustmon"
  install -Dm755 target/release/minimon "$pkgdir/usr/bin/minimon"
}