git/grrs/main
pkg/grrs-git/PKGBUILD
48 lines1 KB last change raw · history
# Maintainer: Myn <hello@myn.sh>

pkgname=grrs-git
pkgver=r42.d2ecef4
pkgrel=1
pkgdesc="A minimal TUI for Gensokyo Radio"
arch=('x86_64')
url="https://git.myn.sh/grrs"
license=('Unlicense')
depends=('gcc-libs' 'glibc' 'mpv')
makedepends=('cargo' 'git' 'cmake')
options=('!lto' '!debug')
provides=('grrs')
conflicts=('grrs')
source=("grrs::git+https://git.myn.sh/grrs.git")
sha256sums=('SKIP')

pkgver() {
  cd "$srcdir/grrs"
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
}

prepare() {
  cd "$srcdir/grrs"
  export RUSTUP_TOOLCHAIN=stable
  cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
}

build() {
  cd "$srcdir/grrs"
  export RUSTUP_TOOLCHAIN=stable
  export CARGO_TARGET_DIR=target
  cargo build --frozen --release
}

check() {
  cd "$srcdir/grrs"
  export RUSTUP_TOOLCHAIN=stable
  cargo test --frozen
}

package() {
  cd "$srcdir/grrs"
  install -Dm755 "target/release/grrs" "$pkgdir/usr/bin/grrs"
  install -Dm644 "assets/grrs.desktop" "$pkgdir/usr/share/applications/grrs.desktop"
  install -Dm644 "LICENSE" "$pkgdir/usr/share/licenses/${pkgname}/LICENSE"
}