summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ffd0a49882e25d431a4a6c277fcb245f50c4a6d8 (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
# Maintainer: Luca Carlon <carlon.luca@gmail.com>

pkgname=cgrc
pkgver=2.0.5
pkgrel=0
pkgdesc='Generic log formatter'
arch=(any)
url='https://github.com/carlonluca/cgrc'
license=(GPL)
makedepends=(git cargo)
source=(git+https://github.com/carlonluca/cgrc.git#tag=v$pkgver)
md5sums=('SKIP')

prepare() {
  export RUSTUP_TOOLCHAIN=stable
  git submodule update --init
  cd "$srcdir/$pkgname/cgrc-rust"
  cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
}

build() {
  export RUSTUP_TOOLCHAIN=stable
  export CARGO_TARGET_DIR=target
  cd "$srcdir/$pkgname/cgrc-rust"
  cargo build --frozen --release --all-features
}

check() {
  export RUSTUP_TOOLCHAIN=stable
  cd "$srcdir/$pkgname/cgrc-rust"
  cargo test --frozen --all-features
}

package() {
  cd "$srcdir/$pkgname/cgrc-rust"
  install -Dm0755 -t "$pkgdir/usr/bin/" "target/release/$pkgname"
}