# -*- 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.1
PortGroup           github 1.0
PortGroup           openssl 1.0

github.setup        paullouisageneau libdatachannel 0.24.6 v
github.tarball_from archive
revision            0

categories          net devel
license             MPL-2
maintainers         {gmail.com:herby.gillot @herbygillot} \
                    openmaintainer

description         C/C++ WebRTC network library
long_description    libdatachannel is a standalone implementation of WebRTC \
                    Data Channels, WebRTC Media Transport, and WebSockets in \
                    C++17 with C bindings.

homepage            https://libdatachannel.org/

checksums           rmd160  058d0b90ef9c166b1d0c2f1b4fef3e3271dd2be3 \
                    sha256  22a66aebebd8dae561d8e5181da96f2fcc203e067c5b2186c07b39af913464c0 \
                    size    52656037

compiler.cxx_standard 2017

depends_build-append \
                    port:plog

depends_lib-append  port:libjuice \
                    port:libsrtp \
                    port:libusrsctp

configure.args-append \
                    -DNO_EXAMPLES=ON \
                    -DNO_TESTS=OFF \
                    -DPREFER_SYSTEM_LIB=ON

# The cmake PortGroup builds with the (empty) install rpath.
pre-test {
    system -W ${cmake.build_dir} "install_name_tool -add_rpath ${cmake.build_dir} tests"
}

test.run            yes
test.cmd            ./tests
test.target
