# -*- 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/air-verse/air 1.65.0 v
go.offline_build    no
revision            1

description         Live reload for Go apps

long_description    {*}${description}. Just ${name} in your project root \
                    directory, leave it alone, and focus on your code.

categories          devel
installs_libs       no
license             GPL-3
maintainers         {gmail.com:herby.gillot @herbygillot} \
                    openmaintainer

checksums           rmd160  e5d34ef0e642980675af3fc41f28fbcbba7328a7 \
                    sha256  4322f6f331b2f8e62c7b2afb4b94c903d09cfbb710098cb2020ebdcfb162ccc1 \
                    size    1055505

pre-build {
    set go_ver [exec ${go.bin} version]
    regexp {go version go(\S+)} ${go_ver} -> go_compiler_ver
    build.pre_args-append -ldflags=\" \
        -X main.airVersion=${github.tag_prefix}${version} \
        -X main.goVersion=${go_compiler_ver} \
    \"
}

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