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

name                cmocka
version             2.0.2
categories          devel
maintainers         {@raybellis isc.org:ray} openmaintainer
license             Apache-2

description         cmocka unit testing framework
long_description    cmocka is an elegant unit testing framework for C with support for mock objects. \
                    It only requires the standard C library, works on a range of computing platforms \
                    (including embedded) and with different compilers.

use_xz              yes

compiler.blacklist-append *gcc-4.* *gcc-3.*

# strsignal cannot be used on macOS <10.7 unless _DARWIN_C_SOURCE flag is set
if {${os.platform} eq "darwin" && ${os.major} < 11} {
    configure.cflags-append \
                    -D_DARWIN_C_SOURCE
}

homepage            https://cmocka.org/
# fetching distfiles may be broken due to protection against AI crawlers
# let's append a mirror by FreeBSD
master_sites        ${homepage}/files/[join [lrange [split ${version} .] 0 1] .]/ \
                    freebsd
livecheck.url       https://git.cryptomilk.org/projects/cmocka.git/

checksums           rmd160  c8db3491d57dfc0ab133e443de91fa90cdf56a07 \
                    sha256  39f92f366bdf3f1a02af4da75b4a5c52df6c9f7e736c7d65de13283f9f0ef416 \
                    size    121144

test.run            yes
