# -*- 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        nilstate icey 2.4.5
github.tarball_from archive
revision            0

categories          devel multimedia net
maintainers         nomaintainer
license             LGPL-2.1+
homepage            https://0state.com/icey/
description         C++20 media stack and libwebrtc alternative for real-time video, signalling, TURN, and media servers
long_description    ${description}

checksums           rmd160  9a2f0145f1eea9a65d9289631a485c9436ee99dc \
                    sha256  b8574956fcdd497b79cbb267935972348385b6c679d0239e0debc79afbedfbcf \
                    size    6459512

openssl.branch      3

set ffmpeg_ver      8

depends_lib-append  path:libexec/ffmpeg${ffmpeg_ver}/lib/libavcodec.dylib:ffmpeg${ffmpeg_ver} \
                    port:libuv \
                    port:llhttp \
                    port:minizip \
                    port:nlohmann-json \
                    port:zlib

configure.pkg_config_path-prepend \
                    ${prefix}/libexec/ffmpeg${ffmpeg_ver}/lib/pkgconfig

compiler.cxx_standard 2020

# Upstream rejects the cmake PortGroup's default "MacPorts" build type.
cmake.build_type    Release

configure.args-append \
                    -DBUILD_SHARED_LIBS=ON \
                    -DUSE_SYSTEM_DEPS=ON \
                    -DBUILD_TESTS=OFF \
                    -DBUILD_SAMPLES=OFF \
                    -DBUILD_APPLICATIONS=OFF \
                    -DBUILD_FUZZERS=OFF \
                    -DBUILD_BENCHMARKS=OFF \
                    -DBUILD_PERF=OFF \
                    -DBUILD_ALPHA=OFF \
                    -DCMAKE_DISABLE_FIND_PACKAGE_Doxygen=TRUE \
                    -DENABLE_NATIVE_ARCH=OFF \
                    -DWITH_FFMPEG=ON \
                    -DWITH_LIBDATACHANNEL=OFF \
                    -DBUILD_MODULE_webrtc=OFF \
                    -DWITH_OPENCV=OFF
