diff --git a/testing/regal/APKBUILD b/testing/regal/APKBUILD new file mode 100644 index 0000000000000000000000000000000000000000..2f0a840e550dbbec556528ad4d4ca2baf5f95c5f --- /dev/null +++ b/testing/regal/APKBUILD @@ -0,0 +1,55 @@ +# Maintainer: Hoang Nguyen <folliekazetani@protonmail.com> +pkgname=regal +pkgver=0.15.0 +pkgrel=0 +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 CGO_ENABLED=0 +export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}" +export GOTMPDIR="${GOTMPDIR:-"$srcdir"}" +export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}" + +build() { + 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 + " + + go build -v -ldflags "$_goldflags" . + + for shell in bash fish zsh; do + ./regal completion $shell > regal.$shell + done +} + +check() { + go test ./... +} + +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=" +d3eb34483dbd8c80de3883cb9b05544b7a9187727d4ec9ec32eef5fda03a3a8e4dc3771f75f1b909024f96dddf3ab895affdeaed561b61ffa8a9eadb8279acd1 regal-0.15.0.tar.gz +"