# Contributor: Tuan Anh Tran <me@tuananh.org>
# Maintainer: Tuan Anh Tran <me@tuananh.org>
pkgname=nom
pkgver=2.8.0
pkgrel=3
pkgdesc="RSS reader for the terminal"
url="https://github.com/guyfedwards/nom"
arch="all"
depends="glow"
license="GPL-3.0-or-later"
makedepends="go"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/guyfedwards/nom/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/nom-$pkgver/"

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

build() {
	msg "Building nom"
	go build -o nom cmd/nom/main.go
}

check() {
	go test -v ./internal/...
}

package() {
	install -Dm0755 nom -t "$pkgdir"/usr/bin/
	install -Dm644 -t "$pkgdir"/usr/share/doc/"$pkgname" README.md
}

sha512sums="
7cb7477c16788bfc9dec4ecd6e61fd0f9d5a55b2dd6426feae5f05e79e428f69975256d8647c043663a4c9bdebfc15f4fec906e91425235ba3844176a2709845  nom-2.8.0.tar.gz
"
