# Maintainer: Mario Finelli pkgname=go-yq pkgver=4.13.3 pkgrel=1 pkgdesc="portable command-line YAML processor" arch=(x86_64) url=https://github.com/mikefarah/yq license=(MIT) depends=(glibc) makedepends=(go) conflicts=(yq) source=(https://github.com/mikefarah/yq/archive/v${pkgver}/yq-${pkgver}.tar.gz) sha256sums=('4b1f9e204375abf7c3d6c9f66d0c2bf5a64d00f6fdc8b2828168394431a1a2f7') prepare() { cd yq-$pkgver export GOPATH="$srcdir/gopath" go mod vendor } check() { cd yq-$pkgver go test ./... } build() { cd yq-$pkgver export GOPATH="$srcdir/gopath" export CGO_CPPFLAGS="${CPPFLAGS}" export CGO_CFLAGS="${CFLAGS}" export CGO_CXXFLAGS="${CXXFLAGS}" export CGO_LDFLAGS="${LDFLAGS}" export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw" go build -o yq } package() { cd yq-$pkgver install -Dm0755 yq "$pkgdir/usr/bin/yq" install -Dm0644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE" install -Dm0644 README.md "$pkgdir/usr/share/doc/$pkgname/README.md" ./yq shell-completion bash | install -Dm0644 /dev/stdin \ "$pkgdir/usr/share/bash-completion/completions/yq" ./yq shell-completion zsh | install -Dm0644 /dev/stdin \ "$pkgdir/usr/share/zsh/site-functions/_yq" ./yq shell-completion fish | install -Dm0644 /dev/stdin \ "$pkgdir/usr/share/fish/vendor_completions.d/yq.fish" } # vim: set ts=2 sw=2 et: