# -*- 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        BelledonneCommunications ortp 5.4.66
revision            0

categories          devel
license             GPL-3
maintainers         nomaintainer

description         Real-time Transport Protocol (RTP) library
long_description    \
    oRTP is a C library implementing the RTP protocol (rfc3550). \
    It is available for most Unix clones (primilarly Linux and HP-UX), \
    and Microsoft Windows.

checksums           rmd160  7bd128b513e251155e06eb424b9f66745756b97f \
                    sha256  cd9a72cd384b40bd0c5cb2a3fe6f3fb7487749482d26e3357e622cf028cb64cc \
                    size    316398
github.tarball_from archive

depends_lib-append  port:bctoolbox \
                    port:bcunit \
                    port:libiconv

# https://github.com/BelledonneCommunications/ortp/pull/22
# https://github.com/BelledonneCommunications/ortp/pull/29
patchfiles          patch-fix-Frameworks-path.diff \
                    patch-legacy.diff \
                    patch-use-openssl.diff \
                    patch-cinttypes.diff
# https://github.com/BelledonneCommunications/ortp/pull/13
patchfiles-append   patch-fix-endian.diff

configure.args-append \
                    -DENABLE_DOC=NO \
                    -DENABLE_OPENSSL=YES \
                    -DENABLE_TESTS=NO \
                    -DENABLE_UNIT_TESTS=NO

compiler.cxx_standard \
                    2017

variant docs description "Build and install documentation in HTML format" {
    depends_build-append \
                    path:bin/doxygen:doxygen

    configure.args-replace \
                    -DENABLE_DOC=NO -DENABLE_DOC=YES

    post-destroot {
        move ${destroot}${prefix}/share/doc/ortp-5.0.0/html \
            ${destroot}${prefix}/share/doc/ortp
    }
}

github.livecheck.regex  {([0-9.]+)}
