# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem          1.0
PortGroup           golang 1.0

go.setup            github.com/ko-build/ko 0.17.1 v
go.offline_build    no
revision            0

homepage            https://ko.build/

description         Build and deploy Go applications

long_description    \
    ${name} is a simple, fast container image builder for Go applications. \
    It\'s ideal for use cases where your image contains a single Go \
    application without any\/many dependencies on the OS base image \(e.g., \
    no cgo, no OS package dependencies\). ${name} builds images by \
    effectively executing go build on your local machine, and as such \
    doesn\'t require docker to be installed. This can make it a good fit for \
    lightweight CI\/CD use cases.

categories          devel sysutils
installs_libs       no
license             Apache-2.0
maintainers         {gmail.com:herby.gillot @herbygillot} \
                    openmaintainer

depends_run-append  bin:go:go

checksums           rmd160  24b9493c4e3c5c48d10dcddc033fef1ce5ec45db \
                    sha256  cc45d71db67186022e0587d81fa50d82f0da05fac2723be1f188e5caf3655107 \
                    size    479579

build.pre_args-append -v

destroot {
    xinstall -m 0755 ${worksrcpath}/${name} ${destroot}${prefix}/bin/

    xinstall -d ${destroot}${prefix}/share/bash-completion/completions
    system -W ${destroot} \
        ".${prefix}/bin/${name} completion bash > \
         .${prefix}/share/bash-completion/completions/${name}"

    xinstall -d ${destroot}${prefix}/share/fish/vendor_completions.d
    system -W ${destroot} \
        ".${prefix}/bin/${name} completion fish > \
         .${prefix}/share/fish/vendor_completions.d/${name}.fish"

    xinstall -d ${destroot}${prefix}/share/zsh/site-functions
    system -W ${destroot} \
        ".${prefix}/bin/${name} completion zsh > \
         .${prefix}/share/zsh/site-functions/_${name}"
}
