# -*- 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/pranshuparmar/witr 0.3.3 v
set git-commit      86831e80c59c54e19c74cdbd126ed7ff6bcad756
# This line is for displaying commit in CLI only
revision            0
categories          sysutils
license             Apache-2
maintainers         {i0ntempest @i0ntempest} openmaintainer

description         Why is this running?
long_description    ${name} exists to answer a single question: {*}${description}\
                    It explains where a running thing came from, how it was started,\
                    and what chain of systems is responsible for it existing right now,\
                    in a single, human-readable output or an interactive TUI dashboard.

checksums           rmd160  42886477ec7963ac8f753ba0d94c7c0173505d7a \
                    sha256  af94fe23b01f4b7c672278228efb4a2df622170e0a4ef0e475be337bad11146a \
                    size    2944954

go.offline_build    no
go.toolchain_min    1.25

set time [clock format [clock seconds] -gmt true -format "%Y-%m-%dT%H:%M:%SZ"]
build.args          -o ./${name}
build.post_args     -ldflags="-s -w \
                              -X '${go.package}/internal/version.Version=${github.tag_prefix}${version}' \
                              -X '${go.package}/internal/version.Commit=${git-commit}' \
                              -X '${go.package}/internal/version.BuildDate=${time}'"

destroot {
    xinstall -m 0755 ${worksrcpath}/${name} ${destroot}${prefix}/bin/
    xinstall -m 0644 ${worksrcpath}/docs/cli/${name}.1 ${destroot}${prefix}/share/man/man1
}
