# -*- 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.0
PortGroup           github 1.0
PortGroup           muniversal 1.0

github.setup        json-c json-c 0.19 json-c- -20260627
github.tarball_from releases
revision            0
license             MIT
categories          textproc devel
maintainers         nomaintainer

description         A JSON parser

long_description    JSON-C implements a reference counting object model that allows \
                    you to easily construct JSON objects in C, output them as JSON \
                    formatted strings and parse JSON formatted strings back into \
                    the C representation of JSON objects.

master_sites-append https://s3.amazonaws.com/${name}_releases/releases/
distfiles           ${name}-${version}-nodoc${extract.suffix}
checksums           rmd160  e93f6f68fb2794102b8c6fad2002ae989dfc0b3c \
                    sha256  704927172443309a8efeb162060bb215548e1286e5568514007dd2cc35a0a164 \
                    size    232738

# These are never installed
# See: https://github.com/json-c/json-c/blob/json-c-0.19-20260627/apps/CMakeLists.txt#L119-L121
configure.args-append \
                    -DBUILD_APPS=OFF

# disable warnings as errors, fixes:
# cc1: warnings being treated as errors
# json_object.c:73: warning: 'cold' attribute directive ignored
# make[2]: *** [CMakeFiles/json-c.dir/build.make:125: CMakeFiles/json-c.dir/json_object.c.o] Error 1
configure.args-append -DDISABLE_WERROR=ON

livecheck.regex     {releases/tag/json-c-([0-9.]+)(?:[_-]\d{6,8})}
