# -*- 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/twpayne/chezmoi 2.65.0 v
go.offline_build    no
revision            0

homepage            https://chezmoi.io

description         Manage your dotfiles across multiple machines, securely.

long_description    ${name} helps you manage your personal configuration \
                    files (dotfiles, like ~/.bashrc) across multiple machines.

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

checksums           rmd160  2e3abac8dc2ee4cd31c3bdaf1e922da785a56813 \
                    sha256  b36fde3d020f120de7791a9258eb799ed4defbd4fa5b75c0e52b9d756d14c997 \
                    size    2580602

build.cmd           make
build.pre_args-append \
                    BUILT_BY=macports \
                    VERSION="${github.tag_prefix}${version}"
build.args          build

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

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

    # Install zsh completion
    xinstall -d  ${destroot}${prefix}/share/zsh/site-functions
    xinstall -m 0644 ${worksrcpath}/completions/${name}.zsh \
        ${destroot}${prefix}/share/zsh/site-functions/_${name}

    # Install fish completion
    xinstall -d ${destroot}${prefix}/share/fish/vendor_completions.d
    xinstall -m 0644 ${worksrcpath}/completions/${name}.fish \
        ${destroot}${prefix}/share/fish/vendor_completions.d/${name}.fish
}
