# -*- 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/mickael-menu/zk 0.14.1 v
revision            0

categories          office
license             MIT
maintainers         {judaew @judaew} openmaintainer

description         A plain text note-taking assistant
long_description    zk is a command-line tool helping you to maintain a plain \
                    text Zettelkasten or personal wiki.

checksums           rmd160  5724a33f796406991cb86a43cd3760d51a44f6d6 \
                    sha256  563331e1f5a03b4dd3a4ff642cc205cc7b6c3c350c98f627a3273067e7ec234c \
                    size    639890

# Suppress build date for reproducible builds
# Switch to SOURCE_DATE_EPOCH approach in the future
# See https://trac.macports.org/ticket/59672
set build_date      SUPPRESSED

# FIXME: This port currently can't be built without allowing go mod to fetch
go.offline_build no

build.cmd           make
build.pre_args      VERSION=${version} BUILD=${build_date}
build.args          build

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

    xinstall -d ${destroot}${prefix}/share/doc/${name}
    xinstall -m 0644 {*}[glob ${worksrcpath}/docs/*.md] \
        ${destroot}${prefix}/share/doc/${name}
}
