# -*- 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           github  1.0
PortGroup           cmake   1.1

github.setup        GothenburgBitFactory taskwarrior 3.5.0 v
github.tarball_from releases
revision            0
name                task

categories          office
description         Taskwarrior is a command-line task management tool
long_description    Taskwarrior is a command-line todo list manager \
                    with an interactive interface, GTD features, color themes, \
                    data synchronization, dependencies, custom reports, and \
                    charts.

license             MIT
maintainers         {gmail.com:herby.gillot @herbygillot} \
                    openmaintainer

homepage            https://taskwarrior.org/

distname            task-${github.version}

checksums           rmd160  9bd09746694b764030e439e2c096cc44f066e9fb \
                    sha256  9ea64b411f8314414f440ec765dfdf5a86c9f6159df47e2f60cff3db6b31157a \
                    size    970271

depends_build-append \
                    port:cargo
depends_lib-append  path:lib/pkgconfig/gnutls.pc:gnutls

compiler.cxx_standard 2017

post-destroot {
    # Install bash completions
    xinstall -d ${destroot}${prefix}/share/bash-completion/completions
    xinstall ${worksrcpath}/scripts/bash/task.sh ${destroot}${prefix}/share/bash-completion/completions/task

    # Install zsh completions
    set site-functions ${destroot}${prefix}/share/zsh/site-functions
    xinstall -d ${site-functions}
    xinstall ${worksrcpath}/scripts/zsh/_task ${site-functions}/_task

    # Install fish completion
    set vendor_completions.d ${destroot}${prefix}/share/fish/vendor_completions.d
    xinstall -d ${vendor_completions.d}
    xinstall ${worksrcpath}/scripts/fish/task.fish ${vendor_completions.d}

    # Install vim runtime files
    set vim-files ${destroot}${prefix}/share/vim
    xinstall -d ${vim-files}
    copy ${worksrcpath}/scripts/vim ${vim-files}/vimfiles
    # Delete README with install instructions due to its generic filename
    delete ${vim-files}/vimfiles/README
}
