# Contributor: Daniele Debernardi <drebrez@gmail.com>
# Maintainer: Daniele Debernardi <drebrez@gmail.com>
pkgname=apk-file
pkgver=0.3.6
pkgrel=27
pkgdesc="Command line front end for pkgs.alpinelinux.org"
options="chmod-clean"
url="https://github.com/genuinetools/apk-file"
arch="all"
license="MIT"
makedepends="go bash"
# go-mod.patch: upgrade golang.org/x/{sys/net} to support loongarch64
source="$pkgname-$pkgver.tar.gz::https://github.com/genuinetools/apk-file/archive/v$pkgver.tar.gz
	go-mod.patch
	"

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

build() {
	export GOPATH="$srcdir/go"
	make
}

check() {
	export GOPATH="$srcdir/go"
	make test
}

package() {
	install -Dm755 "$builddir/apk-file" \
		"$pkgdir/usr/bin/apk-file"
}

sha512sums="
8da3f693ce85e1ab8a9cefb8b5baf83e096770703e5ccda89ec05161e8b4db54a973e54540e5f1737ce6d22cc5cdca10ab22553182de0c1c3cf824fe34d43318  apk-file-0.3.6.tar.gz
59889a17bd48fa201e2fddd134c59cef682ac48a593c274073aff4ea8ce18fc35adb60721c9e89d1cfb1eac869196b69eab3cb3fba84878793c65ad08c0757b9  go-mod.patch
"
