| 1 | maintainer="Hoang Nguyen <[email protected]>" |
| 2 | pkgname=cue-cli |
| 3 | pkgver=0.17.1 |
| 4 | pkgrel=0 |
| 5 | pkgdesc="CLI for CUE configuration and validation language" |
| 6 | url="https://cuelang.org/" |
| 7 | arch="all" |
| 8 | license="Apache-2.0" |
| 9 | makedepends="go" |
| 10 | subpackages=" |
| 11 | $pkgname-bash-completion |
| 12 | $pkgname-fish-completion |
| 13 | $pkgname-zsh-completion |
| 14 | " |
| 15 | options="net" # download Go modules |
| 16 | source="$pkgname-$pkgver.tar.gz::https://github.com/cue-lang/cue/archive/refs/tags/v$pkgver.tar.gz |
| 17 | fix-test-ppc64le.patch" |
| 18 | builddir="$srcdir/cue-$pkgver" |
| 19 | |
| 20 | build() { |
| 21 | go build -v -o bin/cue ./cmd/cue/ |
| 22 | |
| 23 | for shell in bash fish zsh; do |
| 24 | ./bin/cue completion $shell > cue.$shell |
| 25 | done |
| 26 | } |
| 27 | |
| 28 | check() { |
| 29 | # Use a directory outside aports repository for test artifacts to pass TestScript test case. |
| 30 | # (the test expects `git VCS not found in any parents of ".+"` message in stderr) |
| 31 | unset GOTMPDIR |
| 32 | |
| 33 | go test -timeout 30m ./... |
| 34 | } |
| 35 | |
| 36 | package() { |
| 37 | install -Dm755 bin/cue -t "$pkgdir"/usr/bin/ |
| 38 | |
| 39 | install -Dm644 cue.bash \ |
| 40 | "$pkgdir"/usr/share/bash-completion/completions/cue |
| 41 | install -Dm644 cue.fish \ |
| 42 | "$pkgdir"/usr/share/fish/vendor_completions.d/cue.fish |
| 43 | install -Dm644 cue.zsh \ |
| 44 | "$pkgdir"/usr/share/zsh/site-functions/_cue |
| 45 | } |
| 46 | |
| 47 | sha512sums=" |
| 48 | 5d0970a8729839a28269ef8bc8948f4992c0c3ebe8e11a431f5b2a7a785cc7496b35b1f46f42aa5158c7ee6fac23480a87a4b609602c32440ac00dbc2789576c cue-cli-0.17.1.tar.gz |
| 49 | add64a27eeb446a67a8f8604205e340c6973ab59ece7c9f46af4fd273dc8b8cc63d9ecf1590ab946fdf2de62d0935ad15cd03d269babb8adc7707ae5ccd05350 fix-test-ppc64le.patch |
| 50 | " |