# -*- 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/wtfutil/wtf 0.47.0 v
name                wtfutil
revision            0

homepage            https://wtfutil.com

description         A personal terminal-based dashboard utility, designed for \
                    displaying infrequently-needed, but very important, daily \
                    data.

long_description    {*}${description}

categories          sysutils
installs_libs       no
license             MPL-2
maintainers         {gmail.com:herby.gillot @herbygillot} \
                    openmaintainer

checksums           rmd160  c4bc30a3a4a2a45d92542cd1a4ae17e42410077e \
                    sha256  b6c02be79bd6f9a69da612e5a4b99b43d010859f0144085ddfea6a1c60b5bc60 \
                    size    2688446

build.args          -o ${name}

# FIXME: This port currently can't be built without allowing go mod to fetch
# dependencies during the build phase. See
# https://trac.macports.org/ticket/61192
go.offline_build no

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

    xinstall -m 0644 \
        {*}[glob ${worksrcpath}/_sample_configs/*] \
        ${destroot}${prefix}/share/${name}/sample_configs
}

notes "
Examples of configuration for wtfutil can be found in:

${prefix}/share/${name}/sample_configs
"
