# -*- 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/brimdata/zed 1.14.0 v
github.tarball_from archive
revision            0

subport zq {}

homepage            https://zed.brimdata.io

description         \
    Tooling for super-structured data: a new and easier way to manipulate data

long_description    \
    {*}${description}. Zed offers a new approach to data that makes \
    it easier to manipulate and manage your data. With Zed's new \
    super-structured data model, messy JSON data can easily be given the \
    fully-typed precision of relational tables without giving up JSON's \
    uncanny ability to represent eclectic data.

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

checksums           rmd160  396308945ccd16d22e0d04a4dc3feb504a3e2641 \
                    sha256  9fbcc8fc5ad21ce75fc7db2590cf85d2cae14f840b29cb57a63762b1f36809ca \
                    size    6272656

# Allow Go to fetch dependencies at build time
go.offline_build no

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

patch {
    reinplace -E {s|VERSION =|VERSION ?=|} ${worksrcpath}/Makefile
}

if {${subport} eq ${name}} {
    destroot {
        foreach zbin {zed zc} {
            xinstall -m 0755 \
                ${worksrcpath}/dist/${zbin} ${destroot}${prefix}/bin/
        }
    }
} else {
    destroot {
        xinstall -m 0755 ${worksrcpath}/dist/zq ${destroot}${prefix}/bin/
    }
}
