# -*- 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/johnkerl/miller 6.21.0 v
go.offline_build    no
go.toolchain_min    1.25.0
revision            0

homepage            https://johnkerl.org/miller/doc

description         \
    Miller is like awk, sed, cut, join, and sort for name-indexed data such \
    as CSV, TSV, and tabular JSON

long_description    \
    {*}${description}.  You get to work with your data using named fields, \
    without needing to count positional column indices. It operates on \
    key-value-pair data while the familiar Unix tools operate on \
    integer-indexed fields: if the natural data structure for the latter is \
    the array, then Miller’s natural data structure is the insertion-ordered \
    hash map. This encompasses a variety of data formats, including but not \
    limited to the familiar CSV, TSV, and JSON. (Miller can handle \
    positionally-indexed data as a special case.)

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

set bin_name        mlr

build.target        ./cmd/${bin_name}

notes "miller is installed as ${bin_name}"

github.livecheck.regex \
                    {([0-9.]+)}

destroot {
    # binary
    xinstall -m 0755 ${worksrcpath}/${bin_name} ${destroot}${prefix}/bin/
    # man page
    xinstall -m 0444 \
        ${worksrcpath}/man/${bin_name}.1 ${destroot}${prefix}/share/man/man1/

    # misc files
    xinstall -d ${destroot}${prefix}/share/${name}/
    xinstall -m 0755 \
        ${worksrcpath}/README.md ${destroot}${prefix}/share/${name}/

    # vim config & syntax
    copy ${worksrcpath}/vim ${destroot}${prefix}/share/${name}/

    xinstall -d ${destroot}${prefix}/share/vim/vimfiles/ftdetect/
    ln -sf ${prefix}/share/${name}/vim/ftdetect/${bin_name}.vim \
        ${destroot}${prefix}/share/vim/vimfiles/ftdetect/

    xinstall -d ${destroot}${prefix}/share/vim/vimfiles/syntax/
    ln -sf ${prefix}/share/${name}/vim/syntax/${bin_name}.vim \
        ${destroot}${prefix}/share/vim/vimfiles/syntax/
}

checksums           ${distname}${extract.suffix} \
                    rmd160  11aaec8f407b2cfc72264b3212d904f3924c4dd8 \
                    sha256  f92366ed67ffdbc75e8daf99a5087bcaa786c50f7c0eec08a8846e14fe7b2e5d \
                    size    12652536
