aboutsummaryrefslogtreecommitdiffstats
path: root/community/staticcheck/APKBUILD
blob: 5eb966b230c06fd2d56e0c71a598ba3ba9890373 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Contributor: Clayton Craft <clayton@craftyguy.net>
# Maintainer: Clayton Craft <clayton@craftyguy.net>
pkgname=staticcheck
pkgver=2021.1.2
pkgrel=1
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"
builddir="$srcdir/go-tools-$pkgver"

case "$CARCH" in
	# tests run out of memory in CI on these platforms:
	s390x|x86|armhf|armv7) options="!check" ;;
esac

build() {
	export CGO_CPPFLAGS="$CPPFLAGS"
	export CGO_CFLAGS="$CFLAGS"
	export CGO_CXXFLAGS="$CXXFLAGS"
	export CGO_LDFLAGS="$LDFLAGS"
	go build -o bin/staticcheck ./cmd/staticcheck
}

check() {
	go test ./...
}

package() {
	install -p -Dm755 bin/staticcheck "$pkgdir/usr/bin/staticcheck"
	install -Dm644 "LICENSE"  "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
	install -Dm644 "LICENSE-THIRD-PARTY" \
		"$pkgdir/usr/share/licenses/$pkgname/LICENSE-THIRD-PARTY"
}

sha512sums="
f77fc8e50ebbd5c0ccbd761df46076917f8d11722a3422e7e0f839282900b4537d4e8219f39a18f0c4f979a2726c16c8c7081eaff9f6bafb77484d38bbf7cee0  staticcheck-2021.1.2.tar.gz
"