diff options
Diffstat (limited to 'community/staticcheck/APKBUILD')
-rw-r--r-- | community/staticcheck/APKBUILD | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/community/staticcheck/APKBUILD b/community/staticcheck/APKBUILD index ebdc9ad39ee..67052b15674 100644 --- a/community/staticcheck/APKBUILD +++ b/community/staticcheck/APKBUILD @@ -1,14 +1,15 @@ # Contributor: Clayton Craft <clayton@craftyguy.net> # Maintainer: Clayton Craft <clayton@craftyguy.net> pkgname=staticcheck -pkgver=2021.1.1 -pkgrel=1 +pkgver=2023.1.7 +pkgrel=2 pkgdesc="advanced Go linter" url="https://github.com/dominikh/go-tools" arch="all" license="MIT" makedepends="go" -source="$pkgname-$pkgver.tar.gz::https://github.com/dominikh/go-tools/archive/$pkgver.tar.gz" +options="net" +source="$pkgname-$pkgver.tar.gz::https://github.com/dominikh/go-tools/archive/refs/tags/$pkgver.tar.gz" builddir="$srcdir/go-tools-$pkgver" case "$CARCH" in @@ -16,25 +17,41 @@ case "$CARCH" in s390x|x86|armhf|armv7) options="!check" ;; esac +# Without this, linking fails on ppc64le. If this persists after +# Go 1.18.1 is released then report this upstream. +# +# See https://github.com/golang/go/issues/51787 +case "$CARCH" in + ppc64le) export GOFLAGS="$GOFLAGS -ldflags=-linkmode=external" ;; +esac + +export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}" +export GOTMPDIR="${GOTMPDIR:-"$srcdir"}" +export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}" + build() { export CGO_CPPFLAGS="$CPPFLAGS" export CGO_CFLAGS="$CFLAGS" export CGO_CXXFLAGS="$CXXFLAGS" export CGO_LDFLAGS="$LDFLAGS" - go build -o bin/staticcheck ./cmd/staticcheck + + mkdir -p bin + go build -o ./bin ./... } check() { + GOROOT="/usr/lib/go" \ go test ./... } package() { - install -p -Dm755 bin/staticcheck "$pkgdir/usr/bin/staticcheck" + install -p -Dm755 -t "$pkgdir/usr/bin/" bin/* + install -Dm644 "LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE" install -Dm644 "LICENSE-THIRD-PARTY" \ "$pkgdir/usr/share/licenses/$pkgname/LICENSE-THIRD-PARTY" } sha512sums=" -3fb5442eae444809ffa8b5a676e752569708add03989955f117190645dcb39c163b8438ba4911b6d80c4e2dd737b83d4cc03b05d9a079e1d4e39ca3ef0bd8b72 staticcheck-2021.1.1.tar.gz +1a45decc0082d4c8428a401a5919c23dc3da8cd74f553d3dc8f5402fa86d3e360239ecc5604f62ff73774a1c40443ab8a865cb4cf9e2512b189889bbd4c4b3ee staticcheck-2023.1.7.tar.gz " |