# Contributor: Michał Polański <michal@polanski.me>
# Maintainer: Michał Polański <michal@polanski.me>
pkgname=gojq
pkgver=0.12.17
pkgrel=5
pkgdesc="Pure Go implementation of jq"
url="https://github.com/itchyny/gojq"
license="MIT"
arch="all"
makedepends="go"
subpackages="$pkgname-zsh-completion"
source="https://github.com/itchyny/gojq/archive/v$pkgver/gojq-$pkgver.tar.gz"
options="net"

export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

build() {
	go build ./cmd/gojq
}

check() {
	go test ./...
}

package() {
	install -Dm755 gojq -t "$pkgdir"/usr/bin/

	install -Dm644 _gojq -t "$pkgdir"/usr/share/zsh/site-functions/
}

sha512sums="
e90fbf337c4390ac5664024fa64666f878ac509f0b844efea42169c6e19e3e90af5f22b32c15babfc4ca05ee734b23ce3ee5b7b1d179db28d6877b62ce7d0a00  gojq-0.12.17.tar.gz
"
