# -*- 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               cmake 1.1
PortGroup               github 1.0

github.setup            libcheck check 0.15.2
revision                1

categories              devel
license                 LGPL-2.1+
homepage                https://libcheck.github.io/check
maintainers             {sethm.id.au:dev @McDaMastR} \
                        openmaintainer

description             C unit testing framework
long_description        Check is a unit test framework for C.  It features a \
                        simple interface for defining unit tests, putting \
                        little in the way of the developer.  Tests are run in \
                        a separate address space, so Check can catch both \
                        assertion failures and code errors that cause \
                        segmentation faults or other signals.  The output \
                        from unit tests can be used within source code editors \
                        and IDEs.

# dist_subdir can be removed next version update
dist_subdir             ${name}/${version}_1

checksums               rmd160 5b429880821d056b3e49b753fcd34b51f464bafd \
                        sha256 a8de4e0bacfb4d76dd1c618ded263523b53b85d92a146d8835eb1a52932fa20a \
                        size   774985

compiler.c_standard     1999

configure.args-append   -DBUILD_TESTING=ON
# Remove once subunit is ported to MacPorts
configure.args-append   -DHAVE_SUBUNIT=OFF

test.run                yes

post-destroot {
    set destdocdir  ${destroot}${prefix}/share/doc/${name}

    xinstall -d ${destdocdir}
    xinstall -W ${cmake.source_dir} -m 644 \
        AUTHORS \
        COPYING.LESSER \
        NEWS \
        README \
        THANKS \
        TODO \
        ${destdocdir}
}
