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

pkgname=go-exp-git
pkgver=r601.4513512a
pkgrel=1
pkgdesc="Experimental and unreliable tools for the Go programming language."
arch=('any')
url="https://github.com/golang/exp"
license=('BSD')
makedepends=('go')
source=("git+https://go.googlesource.com/exp")
sha512sums=('SKIP')

pkgver() {
	cd exp
	printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
	mkdir -p bin
}

build() {
	cd exp
	go build \
		-o="../bin" \
		-trimpath \
		-buildmode=pie \
		-mod=readonly \
		./...
}

package() {
	install -Dm755 bin/* -t "$pkgdir/usr/bin"
	cd exp
	install -Dm644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname"
	install -Dm644 README.md -t "$pkgdir/usr/share/doc/$pkgname"
}