# -*- 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.3 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  37953165efac916327b19382070ffc170bb85c20 \
                    sha256  35fde02b7cdc39cf3a53e97187e894c443dcdeb1475bc654250cbb5c22428a80 \
                    size    1062310

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