2025-02-09 17:40:32 +01:00

55 lines
1.5 KiB
Plaintext

maintainer="Hoang Nguyen <folliekazetani@protonmail.com>"
pkgname=cue-cli
pkgver=0.12.0
pkgrel=1
pkgdesc="CLI for CUE configuration and validation language"
url="https://cuelang.org/"
arch="all"
license="Apache-2.0"
makedepends="go"
subpackages="
$pkgname-bash-completion
$pkgname-fish-completion
$pkgname-zsh-completion
"
options="net" # download Go modules
source="$pkgname-$pkgver.tar.gz::https://github.com/cue-lang/cue/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/cue-$pkgver"
export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"
build() {
go build -v -o bin/cue \
-ldflags "-X cuelang.org/go/cmd/cue/cmd.version=v$pkgver" \
./cmd/cue/
for shell in bash fish zsh; do
./bin/cue completion $shell > cue.$shell
done
}
check() {
# Use a directory outside aports repository for test artifacts to pass TestScript test case.
# (the test expects `git VCS not found in any parents of ".+"` message in stderr)
unset GOTMPDIR
go test ./...
}
package() {
install -Dm755 bin/cue -t "$pkgdir"/usr/bin/
install -Dm644 cue.bash \
"$pkgdir"/usr/share/bash-completion/completions/cue
install -Dm644 cue.fish \
"$pkgdir"/usr/share/fish/vendor_completions.d/cue.fish
install -Dm644 cue.zsh \
"$pkgdir"/usr/share/zsh/site-functions/_cue
}
sha512sums="
d00f40b69ce865aeaf17c9e5dd7870aa6305936590e6075ffce656ede0adc0612191669f4103095906aba84e765fedfade7f3a586899c41857d372b84a3fda30 cue-cli-0.12.0.tar.gz
"