# -*- 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           makefile 1.0

github.setup        liquidaty zsv 0.3.8-alpha v
github.tarball_from archive
revision            0

description         \
    ${name}: world's fastest (simd) CSV parser, with an extensible CLI


long_description    \
    ${name} is a fast CSV parser library and extensible command-line utility. \
    It achieves high performance using SIMD operations, efficient memory use \
    and other optimization techniques.

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

checksums           rmd160  ec6010586a393075f5c8f9c5d13271c9e6193f0e \
                    sha256  79c89e2b4617624661804a7785ea7f61078215180a6fe6b48d96dd0cc204aa4c \
                    size    7610803

patchfiles-append   patch-app-Makefile-destdir.diff \
                    patch-src-Makefile-destdir.diff

depends_build-append \
                    port:realpath

depends_lib-append  port:jq \
                    port:ncurses

# cc1: error: unrecognized command line option "-std=gnu11"
compiler.c_standard 2011

configure.args-append \
                    --arch=none \
                    --enable-jq

use_configure       yes
use_parallel_build  no

if {$subport eq $name} {

    depends_lib-append \
                    port:libzsv \
                    port:libutf8proc

    build.pre_args  -C app
    build.args      build-cli

    destroot.pre_args-append \
                    -C app

    destroot.args-append \
                    PREFIX=${destroot}${prefix}
}

subport libzsv {

    description     \
        (Library) {*}${description}

    long_description \
        (Library) {*}${long_description}

    build.pre_args  -C src
    build.args      lib

    destroot.pre_args-append \
                    -C src

    destroot.args-append \
                    PREFIX=${destroot}${prefix}
}
