# -*- 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/cheat/cheat 4.4.2
revision            0

description         create and view interactive cheatsheets on the command-line

long_description    ${name} allows you to {*}${description}. It was designed \
                    to help remind *nix system administrators of options for \
                    commands that they use frequently, but not frequently \
                    enough to remember.

categories          devel
installs_libs       no
license             MIT
maintainers         {gmail.com:herby.gillot @herbygillot} \
                    openmaintainer

checksums           rmd160  328be24605d527c213e0fa808e57973495bd0b76 \
                    sha256  6968ffdebb7c2a8390dea45f97884af3c623cda6c2d36c4c04443ed2454da431 \
                    size    3131874

# This project uses vendored sources, which cannot be used with Go modules
# turned off.  So remove the environment setting GO111MODULE=off.
build.env-delete    GO111MODULE=off

build.pre_args-append \
     -ldflags="-s -w" -mod vendor -trimpath
build.args          ./cmd/${name}

destroot {
    xinstall -m 0755 ${worksrcpath}/${name} ${destroot}${prefix}/bin/
    xinstall -m 0755 ${worksrcpath}/scripts/git/cheatsheets \
        ${destroot}${prefix}/bin/

    xinstall -d ${destroot}${prefix}/share/man/man1/
    xinstall -m 0644 ${worksrcpath}/doc/${name}.1 \
        ${destroot}${prefix}/share/man/man1/

    set compsrcdir ${worksrcpath}/scripts/

    xinstall -d ${destroot}${prefix}/share/bash-completion/completions
    xinstall -m 0644 ${compsrcdir}/${name}.bash \
        ${destroot}${prefix}/share/bash-completion/completions/${name}

    xinstall -d  ${destroot}${prefix}/share/zsh/site-functions
    xinstall -m 0644 ${compsrcdir}/${name}.zsh \
        ${destroot}${prefix}/share/zsh/site-functions/_${name}

    xinstall -d ${destroot}${prefix}/share/fish/vendor_completions.d
    xinstall -m 0644 ${compsrcdir}/${name}.fish \
        ${destroot}${prefix}/share/fish/vendor_completions.d/${name}.fish
}
