# -*- 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.1 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  ae5e5552233b105719f7d6ba4b49246c5ae7981e \
                    sha256  1d10184b57b3fa51ae71e6f444235a0fdf883fa132ca749282c9bcc29534b249 \
                    size    1058266

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