# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4

PortSystem          1.0
PortGroup           meson 1.0
PortGroup           gobject_introspection 1.0

name                libnice
version             0.1.23
revision            0
license             {MPL-1.1 LGPL-2.1}
description         Libnice is an implementation of IETF's Interactive Connectivity Establishment (ICE) standard (RFC 5245).
long_description    ${description} \
                    It provides a GLib-based library, libnice, as well as GStreamer elements.
maintainers         {devans @dbevans} openmaintainer
categories          net comms
homepage            https://libnice.freedesktop.org/
master_sites        https://libnice.freedesktop.org/releases/

checksums           rmd160  537107dc1457598e70681d9625aa3b78950bf332 \
                    sha256  618fc4e8de393b719b1641c1d8eec01826d4d39d15ade92679d221c7f5e4e70d \
                    size    469330

depends_build-append \
                    path:bin/pkg-config:pkgconfig

depends_lib-append  path:lib/pkgconfig/glib-2.0.pc:glib2 \
                    path:lib/pkgconfig/gnutls.pc:gnutls \
                    port:gstreamer1 \
                    port:gupnp-igd

post-patch {
    reinplace {s|gupnp-igd-1\.0|gupnp-igd-1.6|g} ${worksrcpath}/meson.build
}

gobject_introspection   yes

configure.args-append \
                    -Dcrypto-library=gnutls \
                    -Dexamples=disabled \
                    -Dgupnp=enabled \
                    -Dgstreamer=enabled \
                    -Dgtk_doc=disabled \
                    -Dtests=disabled

# ld: unknown option: -force_load
compiler.blacklist  *gcc-3.* *gcc-4.* {clang < 300}

test.run            yes
test.dir            ${worksrcpath}/tests
test.target         check

livecheck.type      regex
livecheck.url       ${homepage}
livecheck.regex     "${name}-(\\d+(?:\\.\\d+)*)${extract.suffix}"
