# -*- 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        argtable argtable3 3.3.0.116da6c v
github.tarball_from archive
version             [join [lrange [split ${version} .] 0 [llength [split ${version} .] ]-2 ] .]
revision            0
categories          devel
license             BSD
maintainers         {i0ntempest @i0ntempest} openmaintainer

description         ANSI C library for parsing GNU style command line arguments
long_description    ${name} is an open source ANSI C library that parses GNU-style command-line \
                    options with the getopt library.

checksums           sha256  7c24a61d4ba780ce150adb33f9e815f8b45d65a1a709e63a9bc94ae201490cd2 \
                    rmd160  77032bf0ef0784d0c055015408f0943fc6f8d08b \
                    size    572924

# https://github.com/argtable/argtable3/issues/88
if {[string match *gcc-4.* ${configure.compiler}]} {
    patchfiles-append \
                    patch-gcc-4.diff
}

configure.args-append \
                    -DBUILD_SHARED_LIBS=ON

# Needed to run tests:
configure.pre_args-replace \
                    -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=ON \
                    -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF

test.run            yes
