# Maintainer: Hoang Nguyen pkgname=terraform-ls pkgver=0.31.2 pkgrel=1 pkgdesc="Terraform language server" url="https://github.com/hashicorp/terraform-ls" # upstream doesn't support the others arch="x86_64 x86 aarch64 armv7" license="MPL-2.0" makedepends="go" subpackages="$pkgname-doc" source="$pkgname-$pkgver.tar.gz::https://github.com/hashicorp/terraform-ls/archive/refs/tags/v$pkgver.tar.gz" export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}" export GOTMPDIR="${GOTMPDIR:-"$srcdir"}" export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}" build() { echo "$pkgver" > version/VERSION # TODO: find a way to run `go generate ./internal/schemas` successfully # (without being rate-limited by Terraform's registry API, bloating the binary size or failing tests) # Ref: https://github.com/hashicorp/terraform-ls/issues/1085 go build -v } check() { # walker/testdata/ contains lock files with hashes only for linux_amd64 provider binaries. # shellcheck disable=2046 go test $(go list ./... | grep -v /internal/walker) } package() { install -Dm755 $pkgname -t "$pkgdir"/usr/bin/ install -Dm644 docs/*.md -t "$pkgdir"/usr/share/doc/$pkgname/ } sha512sums=" 6e429ea92bbab27ed7eff5afec70f9c219b091708eff4f4c6ce1b4115f8b46309f53eeb50f2e4b14321addc1eb957b8be4b10c26e7071891381d21bab0637310 terraform-ls-0.31.2.tar.gz "