# -*- 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.2.2.f25c624 v
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from tarball
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  f12badf34f6be07263af85955d1f4e4a6f9e0a6d7023ffaed2a2ccb1374e4182 \
                    rmd160  ff3752c38cef00094e654f7f5e451f7942ab2bc4 \
                    size    510475

# 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
