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

name                libnice
version             0.1.22
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  55148ebbdc07bcfaa069db1709f0702ebeb0e114 \
                    sha256  a5f724cf09eae50c41a7517141d89da4a61ec9eaca32da4a0073faed5417ad7e \
                    size    460696

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 \
                    path:lib/pkgconfig/gobject-introspection-1.0.pc:gobject-introspection \
                    port:gstreamer1-gst-plugins-base \
                    port:gupnp-igd

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

configure.args-append \
                    -Dcrypto-library=gnutls \
                    -Dexamples=disabled \
                    -Dgupnp=enabled \
                    -Dgstreamer=enabled \
                    -Dgtk_doc=disabled \
                    -Dintrospection=enabled \
                    -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}"
