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

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  04fa96b1a07b96a9e6b8f5b6be95095a44237efc \
                        sha256  3fe628547293f1c70c70593961277e3e27940c4968a6115304251a0b494acd30 \
                        size    12549860

