# -*- 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.1 v
go.offline_build    no
revision            0

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  002d968166ea0ccaf8c281bdba370cff343a07d5 \
                    sha256  f13e1d6be1ab4baf725a7fedc4cd240fc7e5c7276af2d92f199e590e1ef33967 \
                    size    510057
