# -*- 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.2 v
go.offline_build    no
revision            0

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  27206a732612738910a417a7cb0515cff5f8682e \
                    sha256  c9a5cd7a4d4c7e07575df15892f7223a0d378e3e3d2f595486ac56dc188841ca \
                    size    1060424

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