# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Maintainer: Sören Tempel <soeren+alpine@soeren-tempel.net>
pkgname=zk
pkgver=0.14.1
pkgrel=3
pkgdesc="Plain text note-taking application with CLI interface"
url="https://github.com/zk-org/zk"
arch="all"
license="GPL-3.0-only"
depends="fzf"
makedepends="go"
subpackages="$pkgname-doc"
options="chmod-clean net"
source="https://github.com/zk-org/zk/archive/v$pkgver/zk-$pkgver.tar.gz
	0001-Determine-fixture-path-using-the-current-working-dir.patch"

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

build() {
	make
}

check() {
	make test
}

package() {
	install -Dm755 zk "$pkgdir"/usr/bin/zk
	mkdir -p "$pkgdir"/usr/share/doc/$pkgname
	cp -r docs/* "$pkgdir"/usr/share/doc/$pkgname
}

sha512sums="
8bcf19454168545e53300c9d9f2cc3406c9eae8a6d7aa77eaaf03f1fe2ca5ab70d74635fa43478b93e134a379a74987da77bd7dc9bffcf10d72ee0d8752e2964  zk-0.14.1.tar.gz
095f4af07a1f74e3b68114d56cf90076c601b2cb40ce7d0a1a8cf280035d352eb08b56c539c291407d076b0084cfe36b14923ae4e12f8e40e86d92f54e5d6829  0001-Determine-fixture-path-using-the-current-working-dir.patch
"
