# -*- 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/charmbracelet/glow 2.1.0 v
go.offline_build    no
revision            1

description         Render markdown on the CLI, with pizzazz!

long_description    {*}${description} Glow is a terminal based markdown \
                    reader designed from the ground up to bring out the \
                    beauty—and power—of the CLI.  Use it to discover markdown \
                    files, read documentation directly on the command line \
                    and stash markdown files to your own private collection \
                    so you can read them anywhere. Glow will find local \
                    markdown files in subdirectories or a local Git \
                    repository. By the way, all data stashed is encrypted \
                    end-to-end: only you can decrypt it.

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

build.args-append   -ldflags=\"-X 'main.Version=${version}'\"

destroot {
    xinstall -m 0755 ${worksrcpath}/${name} ${destroot}${prefix}/bin/
    # All supported shells: bash, fish, powershell, zsh
    set comp_path(bash) ${destroot}${prefix}/share/bash-completion/completions/${name}
    set comp_path(fish) ${destroot}${prefix}/share/fish/completions/${name}.fish
    set comp_path(zsh)  ${destroot}${prefix}/share/zsh/site-functions/_${name}
    foreach shell {bash fish zsh} {
        xinstall -d [file dirname $comp_path(${shell})]
        system -W ${worksrcpath} "./${name} completion ${shell} > $comp_path(${shell})"
    }
    system -W ${worksrcpath} "./${name} man > ${name}.1"
    xinstall -m 0644 ${worksrcpath}/${name}.1 ${destroot}${prefix}/share/man/man1
}

checksums           rmd160  ab5d65d2d84a773d9d6febf16effccd8561937f6 \
                    sha256  f1875a73ed81e5d8e6c81443e9a9d18bd9d1489c563c9fa2ff5425f2f8e2af6f \
                    size    509457
