# -*- 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.8
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  6483fad3d9eeab0e9acd886ea1d54a4ab06d4381 \
                    sha256  f557911bf6171621e1f72ff35f5b1825bb35b52ed45325dcdee931e5d3c0787a \
                    size    2234804

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}
