# -*- 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.51.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  077e4d875fe03883eeb8611eab149e7805cbae04 \
                    sha256  f34f37f01e44db4b60ae0ec56524ffb8420b037d3f7ca6515b177a0b9b7789c2 \
                    size    2671780

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
go.toolchain_min    1.26.4

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
"
