1 # Maintainer: Christian Rebischke <chris.rebischke@archlinux.org>
6 pkgdesc="Build and deploy Go applications on Kubernetes"
8 url="https://github.com/google/ko"
10 makedepends=('go' 'git')
12 source=("${pkgname}-${pkgver}.tar.gz::https://github.com/google/ko/archive/refs/tags/v${pkgver}.tar.gz")
13 sha512sums=('bb20fbdf8a8f14d76d6363b557711bdc3e4068c51bce702024af9090632d0d9ed32c6c4fd26181e68db9fbd783ed8e12dfd7de2b52eafcfee6999643feb76fc4')
14 b2sums=('de770f240810c5ae9477ccb4fc03eeb61eab138d5d0b0b98fc18886818aa0096c4efdfed549432fc1bfe9b2217d8fd0f35998f5f37f2e5691542f796955fa695')
17 cd "${pkgname}-${pkgver}"
18 export CGO_CPPFLAGS="${CPPFLAGS}"
19 export CGO_CFLAGS="${CFLAGS}"
20 export CGO_CXXFLAGS="${CXXFLAGS}"
21 export CGO_LDFLAGS="${LDFLAGS}"
22 export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw"
23 go build -ldflags="-w -s -linkmode=external" .
28 cd "${pkgname}-${pkgver}"
34 cd "${pkgname}-${pkgver}"
35 install -Dsm755 ./ko "${pkgdir}/usr/bin/ko"
36 mkdir -p "${pkgdir}/usr/share/bash-completion/completions/"
37 mkdir -p "${pkgdir}/usr/share/zsh/site-functions/"
38 mkdir -p "${pkgdir}/usr/share/fish/vendor_completions.d/"
39 ./ko completion > "${pkgdir}/usr/share/bash-completion/completions/ko"
40 ./ko completion zsh > "${pkgdir}/usr/share/zsh/site-functions/_ko"
41 ./ko completion completion fish > "${pkgdir}/usr/share/fish/vendor_completions.d/ko.fish"