mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-08-05 13:27:09 +02:00
https://github.com/open-policy-agent/opa/releases/tag/v1.6.0 https://github.com/open-policy-agent/opa/releases/tag/v1.5.1 https://github.com/open-policy-agent/opa/releases/tag/v1.5.0 Rebase `update-wasmtime-go.patch` for 1.6.0.
87 lines
2.6 KiB
Plaintext
87 lines
2.6 KiB
Plaintext
maintainer="Hoang Nguyen <folliekazetani@protonmail.com>"
|
|
pkgname=opa
|
|
pkgver=1.6.0
|
|
pkgrel=0
|
|
pkgdesc="Open source, general-purpose policy engine"
|
|
url="https://www.openpolicyagent.org/"
|
|
arch="x86_64 aarch64" # blocked by wasmtime
|
|
license="Apache-2.0"
|
|
makedepends="go wasmtime-dev"
|
|
checkdepends="tzdata"
|
|
subpackages="
|
|
$pkgname-doc
|
|
$pkgname-bash-completion
|
|
$pkgname-fish-completion
|
|
$pkgname-zsh-completion
|
|
"
|
|
source="
|
|
$pkgname-$pkgver.tar.gz::https://github.com/open-policy-agent/opa/archive/refs/tags/v$pkgver.tar.gz
|
|
update-wasmtime-go.patch
|
|
fix-prometheus-test.patch
|
|
"
|
|
options="net" # go mod vendor
|
|
|
|
# secfixes:
|
|
# 1.4.2-r0:
|
|
# - CVE-2025-46569
|
|
|
|
export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
|
|
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
|
|
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"
|
|
|
|
prepare() {
|
|
default_prepare
|
|
|
|
# Do this to keep our wasmtime patch small, until upstream resolves the issue
|
|
go mod vendor
|
|
}
|
|
|
|
build() {
|
|
# report.ExternalServiceURL is left blank to disable telemetry
|
|
# - "opa version -c" errors out
|
|
# - "opa run" fails the version check process silently in the background
|
|
# this is intended :)
|
|
local goldflags="
|
|
-X github.com/open-policy-agent/opa/version.Version=$pkgver
|
|
-X github.com/open-policy-agent/opa/version.Hostname=AlpineLinux
|
|
-X github.com/open-policy-agent/opa/version.Vcs=0000000000000000000000000000000000000000
|
|
-X github.com/open-policy-agent/opa/version.Timestamp=$(date -u "+%Y-%m-%dT%H:%M:%SZ" ${SOURCE_DATE_EPOCH:+-d @$SOURCE_DATE_EPOCH})
|
|
-X github.com/open-policy-agent/opa/internal/report.ExternalServiceURL=
|
|
"
|
|
|
|
export CGO_CFLAGS="$CFLAGS"
|
|
export CGO_LDFLAGS="$LDFLAGS -L/usr/lib -lwasmtime"
|
|
|
|
go build -v -ldflags "$goldflags" -tags opa_wasm
|
|
|
|
mkdir -p man/
|
|
go run build/generate-man/generate.go man/
|
|
|
|
for shell in bash fish zsh; do
|
|
./opa completion $shell > opa.$shell
|
|
done
|
|
}
|
|
|
|
check() {
|
|
go test ./...
|
|
}
|
|
|
|
package() {
|
|
install -Dm755 opa -t "$pkgdir"/usr/bin/
|
|
|
|
install -Dm644 man/*.1 -t "$pkgdir"/usr/share/man/man1/
|
|
|
|
install -Dm644 opa.bash \
|
|
"$pkgdir"/usr/share/bash-completion/completions/opa
|
|
install -Dm644 opa.fish \
|
|
"$pkgdir"/usr/share/fish/vendor_completions.d/opa.fish
|
|
install -Dm644 opa.zsh \
|
|
"$pkgdir"/usr/share/zsh/site-functions/_opa
|
|
}
|
|
|
|
sha512sums="
|
|
303aa22aa10b009b3e10053576cfd9d8b3c8e129fa477773f41cafab8c8a8b851354261a7c9cac74d3f2d8b1d3604ac5d35329e545bbfd40ffd0ab962431d995 opa-1.6.0.tar.gz
|
|
2cf0049bf56e17c112cbe0002f89129093d9fcaeaf41c591d9e9f9f1f365f693fc1ba16e4bd24578163f0106cc75be905ae6f4be7222226444a5b908e77d01aa update-wasmtime-go.patch
|
|
8c187062f3b762ff1574c1640c40a3eca8fc844f65f1c3e5ce742e7fff8906b91d1181f0373712ee4d1398cbbf752f8933b17d415814b7d47b12544dea8bd4e2 fix-prometheus-test.patch
|
|
"
|