# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=jql
pkgver=7.1.8
pkgrel=1
pkgdesc="A JSON Query Language CLI tool"
url="https://github.com/yamafaktory/jql"
arch="all"
license="MIT"
makedepends="cargo cargo-auditable"
source="
	https://github.com/yamafaktory/jql/archive/jql-v$pkgver.tar.gz
	cargo-update.patch
	"
options="net" # fetch dependencies
builddir="$srcdir/jql-jql-v$pkgver"

prepare() {
	default_prepare

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

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

check() {
	# core::tests::get_property_as_index seems to be broken
	cargo test --frozen -- \
		--skip core::tests::get_property_as_index
}

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

sha512sums="
4687f1924292d4030a9d50b28cff27ecfaab70d7466fb296b8aa7d9f0ed295ab6e23e614ff01ff276b43b7d6d550d481d8580266aaa1073c1dfb40caea5022ea  jql-v7.1.8.tar.gz
fdd70c51fedbec1aaf7fa78ccd4afc58f37877300ade7cf7432dcda057d34762db67377ba0d6afa62bfe3d60fc03b5e60876e3b19d0bc98216cee945a3c09260  cargo-update.patch
"
