# -*- 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.8 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  9b67e6fac93aebebe2aa3ffb96d885c1e963d95e \
                    sha256  d2c982fec0c820dd7e640d7ddafc3b3b62e6cefd9d95915d9297aa36d0a1854b \
                    size    52656578

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
