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

name                libidn2
version             2.3.7
revision            0
categories          mail
license             {LGPL-2.1+ GPL-3+}
description         GNU International Domain Name Library (current version 2)
long_description    {*}${description}.\
                    GNU Libidn2 is an implementation of the IDNA2008 + TR46 \
                    specifications (RFC 5890, RFC 5891, RFC 5892, RFC 5893, TR 46). \
                    Libidn2 is a standalone library, without any dependency on Libidn. \
                    Libidn2 is believed to be a complete IDNA2008 / TR46 implementation.
homepage            https://www.gnu.org/software/libidn/#libidn2
platforms           darwin
maintainers         {mps @Schamschula} openmaintainer
master_sites        gnu:libidn

checksums           rmd160  511eb10830342dc546824c5e48bb6ef0022382ab \
                    sha256  4c21a791b610b9519b9d0e12b8097bf2f359b12f8dd92647611a929e6bfd7d64 \
                    size    2155214

depends_build       port:gettext \
                    port:pkgconfig

depends_lib         port:gettext-runtime \
                    port:libiconv \
                    port:libunistring

configure.checks.implicit_function_declaration.whitelist-append strchr

configure.args      --disable-silent-rules

# unreachable is part of the C23 standard
configure.checks.implicit_function_declaration.whitelist-append unreachable

if {${os.platform} eq "darwin" && ${os.major} < 10} {
    depends_build-append port:cctools
    configure.env-append NM=${prefix}/bin/nm
    configure.args-append lt_cv_path_NM=${prefix}/bin/nm
}

test.run            yes
test.target         check

livecheck.distname  ${name}
