summaryrefslogtreecommitdiff
path: root/testing/ko/APKBUILD
blob: d2870456b3628b6b2cca9328786b2c4f3d35c11c (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
41
42
43
# Maintainer: Ariadne Conill <ariadne@dereferenced.org>
pkgname=ko
pkgver=0.13.0
pkgrel=4
pkgdesc="Build containers from Go projects"
url="https://ko.build/"
arch="all"
license="Apache-2.0"
makedepends="go"
subpackages="
	$pkgname-bash-completion
	$pkgname-fish-completion
	$pkgname-zsh-completion
	"
source="https://github.com/ko-build/ko/archive/v$pkgver/ko-$pkgver.tar.gz"

export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

build() {
	go build -v -ldflags "-X github.com/google/ko/pkg/commands.Version=$pkgver"

	for i in bash fish zsh; do
		./ko completion $i > ko.$i
	done
}

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

package() {
	install -Dm755 ko -t "$pkgdir"/usr/bin/

	install -Dm644 ko.bash "$pkgdir"/usr/share/bash-completion/completions/ko
	install -Dm644 ko.fish "$pkgdir"/usr/share/fish/vendor_completions.d/ko.fish
	install -Dm644 ko.zsh "$pkgdir"/usr/share/zsh/site-functions/_ko
}

sha512sums="
bb20fbdf8a8f14d76d6363b557711bdc3e4068c51bce702024af9090632d0d9ed32c6c4fd26181e68db9fbd783ed8e12dfd7de2b52eafcfee6999643feb76fc4  ko-0.13.0.tar.gz
"