# -*- 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.18.0 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  47626b73cb57072a204b6ab6823ef98f3e9797bb \
                    sha256  4499c8a65f9474443bcf9c194cd0406b03887a7c36557a94f22f040a33a95608 \
                    size    488358

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}"
}
