summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a7626040998743460498bbd3ad1dc2f31c216c6f (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
# Maintainer: Colin Arnott <colin@urandom.co.uk>

pkgname=golint-git
pkgver=20210508.6edffad
pkgrel=1
pkgdesc="A linter for Go source code."
arch=('x86_64')
url="https://golang.org/x/lint"
license=('MIT')
conflicts=("${pkgname%-git}")
provides=("${pkgname%-git}")
makedepends=('go')
source=('git://github.com/golang/lint.git')
sha512sums=('SKIP')

pkgver() {
	cd "${srcdir}/lint"
	git log -1 --format='%cd.%h' --date=short | tr -d -
}

build() {
	cd lint

	export CGO_CPPFLAGS="$CPPFLAGS"
	export CGO_CFLAGS="$CFLAGS"
	export CGO_CXXFLAGS="$CXXFLAGS"
	export CGO_LDFLAGS="$LDFLAGS"
	export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw"

	go build -o bin/ "./${pkgname%-git}"
}

package() {
	cd lint
	install -Dm755 -- "bin/${pkgname%-git}" "${pkgdir}/usr/bin/${pkgname%-git}"
	install -Dm644 -- "LICENSE" "${pkgdir}/usr/share/licenses/${pkgname%-git}/LICENSE"
}