mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-04-27 14:08:17 +02:00
57 lines
1.8 KiB
Text
57 lines
1.8 KiB
Text
maintainer="Hoang Nguyen <folliekazetani@protonmail.com>"
|
|
pkgname=regal
|
|
pkgver=0.29.2
|
|
pkgrel=4
|
|
pkgdesc="Linter for Rego files"
|
|
url="https://docs.styra.com/regal"
|
|
arch="all"
|
|
license="Apache-2.0"
|
|
makedepends="go"
|
|
subpackages="
|
|
$pkgname-bash-completion
|
|
$pkgname-fish-completion
|
|
$pkgname-zsh-completion
|
|
"
|
|
source="$pkgname-$pkgver.tar.gz::https://github.com/StyraInc/regal/archive/refs/tags/v$pkgver.tar.gz"
|
|
options="net" # download Go modules
|
|
|
|
export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
|
|
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
|
|
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"
|
|
|
|
build() {
|
|
# The flag for open-policy-agent is to prevent telemetry report
|
|
local _goldflags="
|
|
-X github.com/styrainc/regal/pkg/version.Version=v$pkgver
|
|
-X github.com/styrainc/regal/pkg/version.Commit=AlpineLinux
|
|
-X github.com/styrainc/regal/pkg/version.Timestamp=$(date -u "+%Y-%m-%dT%H:%M:%S%z" ${SOURCE_DATE_EPOCH:+-d @$SOURCE_DATE_EPOCH})
|
|
-X github.com/styrainc/regal/pkg/version.Hostname=alpinelinux.org
|
|
-X github.com/open-policy-agent/opa/internal/report.ExternalServiceURL=
|
|
"
|
|
|
|
go build -v -ldflags "$_goldflags" .
|
|
|
|
for shell in bash fish zsh; do
|
|
./regal completion $shell > regal.$shell
|
|
done
|
|
}
|
|
|
|
check() {
|
|
# lsp tests easily times out listening to diagnostic events in slow builds (.e.g riscv64)
|
|
go test -timeout 30m ./...
|
|
}
|
|
|
|
package() {
|
|
install -Dm755 regal -t "$pkgdir"/usr/bin/
|
|
|
|
install -Dm644 regal.bash \
|
|
"$pkgdir"/usr/share/bash-completion/completions/regal
|
|
install -Dm644 regal.fish \
|
|
"$pkgdir"/usr/share/fish/vendor_completions.d/regal.fish
|
|
install -Dm644 regal.zsh \
|
|
"$pkgdir"/usr/share/zsh/site-functions/_regal
|
|
}
|
|
|
|
sha512sums="
|
|
c9610544697fcded438b69b8c59e0aa8f374bb42dcaeaf6be69a425c481d23515aa64f20bc46cf1dd74d94b02d02c191119aae15708d1b43ac1e14b26ae9e7fe regal-0.29.2.tar.gz
|
|
"
|