# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=jp
pkgver=0.3.0
pkgrel=2
pkgdesc="CLI for JMESPath query language for JSON (Rust implementation)"
url="https://github.com/jmespath/jmespath.rs"
arch="all"
license="MIT"
provides="jmespath=$pkgver-r$pkgrel"
makedepends="cargo cargo-auditable"
source="https://github.com/jmespath/jmespath.rs/archive/$pkgver/jmespath.rs-$pkgver.tar.gz
	Cargo.lock
	"
builddir="$srcdir/jmespath.rs-$pkgver"

prepare() {
	default_prepare

	# https://github.com/jmespath/jmespath.rs/issues/47
	mv "$srcdir"/Cargo.lock .

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

build() {
	cargo auditable build -p jmespath-cli --frozen --release
}

check() {
	cargo test --frozen
}

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

sha512sums="
0dee5493c89b04a91d40f7b4dd3cd7f3323008dfaf31f1af88369fb5dd39536e92d5280282ead1cb33abe3bbca440be5378927168079675dc7589c459080a590  jmespath.rs-0.3.0.tar.gz
6d6b41065cc0439e4b17aedf144ac64342ca83b8aa3de93fddceaf06573fc8be002ac8b38ab8e4bb8107cb8530cac1179db54930f063a0f0f8ce94b5ef5fbe97  Cargo.lock
"
