aports/testing/buf/APKBUILD
Natanael Copa b2e68866a3 Reapply "testing/*: rebuild against Go 1.25.5"
This reverts commit 424a28d17bb5ae46472399d96c9204eb12745f22.
2025-12-03 16:54:46 +01:00

70 lines
2.3 KiB
Plaintext

maintainer="Hoang Nguyen <folliekazetani@protonmail.com>"
pkgname=buf
pkgver=1.59.0
pkgrel=1
pkgdesc="CLI to work with Protocol Buffers"
url="https://buf.build/"
# 32bit: fail tests with int overflow
arch="all !x86 !armhf !armv7"
license="Apache-2.0"
makedepends="go"
checkdepends="git-daemon protobuf-dev protoc-gen-go"
subpackages="
$pkgname-bash-completion
$pkgname-fish-completion
$pkgname-zsh-completion
$pkgname-protoc-plugins:_protoc
"
source="$pkgname-$pkgver.tar.gz::https://github.com/bufbuild/buf/archive/refs/tags/v$pkgver.tar.gz
remove-deprecated-testcorpus-field.patch
"
options="net" # download Go modules
build() {
go build -v -o "$builddir" ./cmd/...
for shell in bash fish zsh; do
./buf completion $shell > buf.$shell
done
# These programs are required for check phase
# See https://github.com/bufbuild/buf/blob/main/make/buf/all.mk for the list of binaries needed to be built
mkdir -p "$builddir"/bin
go build -v -o bin/ \
./cmd/buf/internal/command/generate/internal/protoc-gen-top-level-type-names-yaml \
./cmd/buf/internal/command/alpha/protoc/internal/... \
./private/bufpkg/bufcheck/internal/cmd/...
}
check() {
export PATH="$PATH:$builddir/bin"
# TestWorkspaceGit checks the project root whether it is a git repo
# TestRunLintCustomWasmPlugins, TestRunBreakingPolicyLocal, TestRunLintPolicyLocal rely on buf-plugin-suffix.wasm file we can't produce with -buildmode=pie
go test -skip 'Test(WorkspaceGit|RunLintCustomWasmPlugins|RunBreakingPolicyLocal|RunLintPolicyLocal)' ./...
}
package() {
install -Dm755 buf protoc-gen-buf-breaking protoc-gen-buf-lint \
-t "$pkgdir"/usr/bin/
install -Dm644 buf.bash \
"$pkgdir"/usr/share/bash-completion/completions/buf
install -Dm644 buf.fish \
"$pkgdir"/usr/share/fish/vendor_completions.d/buf.fish
install -Dm644 buf.zsh \
"$pkgdir"/usr/share/zsh/site-functions/_buf
}
_protoc() {
pkgdesc="$pkgdesc (protoc plugins)"
depends="protoc"
amove usr/bin/protoc-gen-buf-*
}
sha512sums="
769a455ebe44697d9b9222bf0237ce7a57d152eaf6231a0e019423cef01e4e184aec58203fc5e311212ce2ae57735ab64a48d1006000217ce6eedda176cf90e6 buf-1.59.0.tar.gz
0fa6fef80d2eba7d59344c458ecf5ddaa448dee338c3bc4d24d4a29748eedd98ab2046847ddbf96e09f8c99b7c0dcb1ecb69389e344c042169c838a6a91b8ea9 remove-deprecated-testcorpus-field.patch
"