# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=irust
pkgver=1.71.21
pkgrel=1
pkgdesc="Cross-platform Rust REPL"
url="https://github.com/sigmaSd/IRust"
arch="all"
license="MIT"
depends="cargo rust"
makedepends="cargo cargo-auditable"
source="https://github.com/sigmaSd/IRust/archive/irust@$pkgver/irust-$pkgver.tar.gz
cargo-update.patch
"
builddir="$srcdir/IRust-irust-$pkgver"
options="!check"  # FIXME: tests don't run on CI (require TTY)

prepare() {
	default_prepare

	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build --frozen --release
}

check() {
	cargo test --frozen
}

package() {
	install -D -m755 target/release/$pkgname -t "$pkgdir"/usr/bin/
}

sha512sums="
cf3390aeff1bf8c2c52d8ab904e387e26d643680ebe847aedfd42cb50f12b961ae4a035dbfe321999045883aa7fe12aa9f5ca0b3de20a264807afa6ad75bf26a  irust-1.71.21.tar.gz
2b8670b935bacb111c99ae8bf9c90bfdc664413fa29d4b4f45bec96d558f2b7984ae401d1a01ed97bb6eacd8639aafa941ff308477f96d90005a630bc6359fbb  cargo-update.patch
"
