# -*- 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/golang/tools 0.36.0 v
go.offline_build    no
epoch               7
revision            0

name                go-tools
categories          devel
license             BSD
maintainers         {ciserlohn @ci42} \
                    {@enckse voidedtech.com:enckse} \
                    {gmail.com:herby.gillot @herbygillot} \
                    openmaintainer
description         Various packages and tools that support the Go programming language.
long_description    {*}${description}

checksums           rmd160  571e63d0382ba494894771653495c2d8801a8378 \
                    sha256  299d2320e8f6adb5b53fb1a32e613b00cd2263237c2c4f8f3a68885040b2cfb9 \
                    size    9079404

build.cmd           \
    sh -c \"${go.bin} build -o ./bin/ ./cmd/... && \
        cd ./cmd/auth && ${go.bin} build -o ../../bin ./...\"

destroot {
    set dp_bin ${destroot}${prefix}/bin
    xinstall -m 0755 {*}[glob ${worksrcpath}/bin/*] ${dp_bin}

    # Rename bundle binary to avoid conflict with Ruby
    # See: https://trac.macports.org/ticket/57787
    move ${dp_bin}/bundle ${dp_bin}/gotools-bundle
}

notes "
    The go-tools bundle binary is available as gotools-bundle
"
