# Maintainer: Anas Elgarhy <anas.elgarhy.dev@gmail.com>
pkgname=cmus-rpc-rs
pkgver=0.2.0
pkgrel=1
epoch=
pkgdesc="A Discord Rich Presence for cmus player using rust 🦀💙"
arch=(x86_64)
url="https://github.com/anas-elgarhy/cmus-rpc-rs"
license=('MIT')
groups=()
depends=(cmus)
makedepends=(cargo)
checkdepends=()
optdepends=()
provides=(cmus-rpc-rs)
conflicts=()
replaces=(cmus-rpc-rs)
backup=()
options=()
install=
changelog=
source=("$pkgname-$pkgver.tar.gz::https://static.crates.io/crates/$pkgname/$pkgname-$pkgver.crate")
noextract=()

prepare() {
  cd "$pkgname-$pkgver"
  cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
}

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

check() {
  cd "$pkgname-$pkgver"
	export RUSTUP_TOOLCHAIN=stable
  cargo test --frozen --all-features
}

package() {
  cd "$pkgname-$pkgver"
  sudo install -Dm0755 -t "/usr/bin/" "target/release/$pkgname"
}
sha256sums=('c95ee1e06f0fca3383deeae16aaf2fcd98d2ee3593c4843e2c61e87600ca004f')
