2024-07-07 05:40:51 +00:00

57 lines
1.6 KiB
Plaintext

# Maintainer: Hoang Nguyen <folliekazetani@protonmail.com>
pkgname=cue-cli
pkgver=0.9.2
pkgrel=0
pkgdesc="CLI for CUE configuration and validation language"
url="https://cuelang.org/"
# 32-bit: value out of int range
# s390x: TextExe fails (slice bounds out of range)
arch="all !x86 !armhf !armv7 !s390x"
license="Apache-2.0"
makedepends="go"
subpackages="
$pkgname-bash-completion
$pkgname-fish-completion
$pkgname-zsh-completion
"
options="net"
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="
051a4d15d74123f52f692e8b2f2e311b6356d617e4b22fa9b5d702640fcaafaf1342eb25997ffc4fe32936a61afda9929558c53878e51d2cb38e13bc471d3769 cue-cli-0.9.2.tar.gz
"