# Maintainer: Cody Schafer pkgname=grpcurl pkgver=1.8.9 pkgrel=1 pkgdesc="Like cURL, but for gRPC: Command-line tool for interacting with gRPC servers" arch=(x86_64) url="https://github.com/fullstorydev/grpcurl" license=('MIT') makedepends=('go') source=( "$pkgname-$pkgver.tar.gz::https://github.com/fullstorydev/grpcurl/archive/v$pkgver.tar.gz" ) sha384sums=('a76fbb5e7af03bbe63eb74ba9c42df092e51a53dccd9920d50f25a4e5b4f518b5dc391a869dde3729b2e12979e5fd099') # really, `grpcurl-bin` should be conflicting with us instead of the oposite conflicts=('grpcurl-bin') prepare() { cd "$pkgname-$pkgver" mkdir -p build } build() { cd "$pkgname-$pkgver" 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 build ./cmd/... } check() { cd "$pkgname-$pkgver" go test ./... } package() { cd "$pkgname-$pkgver" install -Dm755 build/grpcurl "${pkgdir}/usr/bin/grpcurl" install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" }