# -*- 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/Equationzhao/g 0.31.2 v
name                    g-ls
revision                0
categories              sysutils
license                 MIT
platforms               {darwin >= 21}
installs_libs           no
maintainers             {@TheRealKeto gmail.com:therealketo} openmaintainer

description             Powerful and cross-platform ls
long_description        {*}${description}. Built for the modern terminal.

homepage                https://equationzhao.github.io/g/

checksums               rmd160  792fec563d2abb19a4c0e77c5692c612fe5fc580 \
                        sha256  a1ef8a6872fa80625287c19167152081b833abc4db88910ab145b35b3bbc6da3 \
                        size    1614267

# Vendored libraries cause failure, fetch them at build time
go.offline_build        no

build.args-append       -ldflags \"-s -w\"

destroot {
    xinstall -m 755 ${worksrcpath}/g ${destroot}${prefix}/bin/g
    xinstall -m 644 ${worksrcpath}/man/g.1.gz ${destroot}${prefix}/share/man/man1

    set zsh_comp_path ${destroot}${prefix}/share/zsh/site-functions
    xinstall -d ${zsh_comp_path}
    xinstall -m 644 ${worksrcpath}/completions/zsh/_g ${zsh_comp_path}

    set bash_comp_path ${destroot}${prefix}/share/bash-completion/completions
    xinstall -d ${bash_comp_path}
    xinstall -m 644 ${worksrcpath}/completions/bash/g-completion.bash ${bash_comp_path}/g

    set fish_comp_path ${destroot}${prefix}/share/fish/vendor_completions.d
    xinstall -d ${fish_comp_path}
    xinstall -m 644 ${worksrcpath}/completions/fish/g.fish ${fish_comp_path}
}
