# Contributor: omni <omni+alpine@hack.org>
# Maintainer: Edd Salkield <edd@salkield.uk>
pkgname=wormhole-william
pkgver=1.0.7
pkgrel=8
pkgdesc="Go implementation of Magic Wormhole"
arch="all"
url="https://github.com/psanford/wormhole-william"
license="MIT"
makedepends="go"
source="$pkgname-$pkgver.tar.gz::https://github.com/psanford/wormhole-william/archive/v$pkgver.tar.gz
	update-go-mod.patch"

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

build() {
	go build -v .
}

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

package() {
	install -Dm755 $pkgname "$pkgdir"/usr/bin/$pkgname
	ln -s /usr/bin/wormhole-william "$pkgdir"/usr/bin/wormhole
}

sha512sums="
1b0b152b7739207ea021bc7999fce7e59b5155b5019004d82aef22951f3678fbac9302a6f5af846793ed7b23670d17a142be0764424495f41a0c3d4bf14931ad  wormhole-william-1.0.7.tar.gz
6c1b5336ba78a3f307e12b9520c7c02adec6c8255959acfcd7506e9df84db9a8e1c7665db3605da00a197492fb253a46a2c895224eb92759ef9215cfce585378  update-go-mod.patch
"
