summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 997275420e84243722382d77e2495a57ceee4333 (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
# Maintainer: Axel Navarro <navarroaxel gmail>
pkgname=dum
pkgver=0.1.19
pkgrel=1
pkgdesc='An npm scripts runner written in Rust.'
arch=('x86_64')
url="https://github.com/egoist/$pkgname"
license=('MIT')
makedepends=('rust')
source=(${pkgname}-${pkgver}.tar.gz::https://github.com/egoist/$pkgname/archive/v$pkgver.tar.gz)
sha256sums=('94af37a8f9a0689ea27d7f338b495793349b75f56b516c17cd207e7c47c52c4f')

prepare() {
  # Assist chroot builds with a persistent cargo cache (hat tip @ccorn for this patch)
  if [ -d "$startdir/.cargo" ]; then
    export CARGO_HOME="${CARGO_HOME:-$startdir/.cargo}"
  else
    msg2 "NOTE : If you're building in a (clean) chroot and want a persistant cargo cache folder specific for this package, you can create an empty '.cargo' directory next to the 'PKGBUILD'. This will be recognized and used as CARGO_HOME (except when CARGO_HOME is already set)."
  fi
}

build() {
  cd "$pkgname-$pkgver"
  cargo build --release --locked
}

package() {
  cd "$pkgname-$pkgver"
  install -Dm755 "target/release/$pkgname" -t "$pkgdir/usr/bin/"
  install -Dm644 README.md -t"$pkgdir/usr/share/doc/$pkgname/"
  install -Dm644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/"
}