# -*- 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           boost 1.0
PortGroup           cmake 1.1
PortGroup           github 1.0
PortGroup           legacysupport 1.1
PortGroup           openssl 1.0

boost.version       1.81
# clock_gettime
legacysupport.newest_darwin_requires_legacy 16

github.setup        facebook mvfst 2026.07.27.00 v
revision            0
categories          devel net security
license             MIT
maintainers         {@barracuda156 macos-powerpc.org:barracuda}

description         Implementation of the QUIC transport protocol
long_description    {*}${description}

checksums           rmd160  871d3666186b34508ed238af15fba91a391cbfa0 \
                    sha256  7e3b85c6dcbb96804936883eca2b429bc17ac9a74e5a86dfae5f919701bf12a5 \
                    size    1551161
github.tarball_from archive

set libfmt_v        12
cmake.prefix_path-append \
                    ${prefix}/lib/libfmt${libfmt_v}/cmake
depends_lib-append  port:bzip2 \
                    port:double-conversion \
                    port:fizz \
                    port:folly \
                    port:gflags \
                    port:google-glog \
                    port:libevent \
                    port:libfmt${libfmt_v} \
                    port:libsodium \
                    port:lz4 \
                    port:snappy \
                    port:zlib \
                    port:zstd

compiler.blacklist-append \
                    {clang < 1200}
# As of 2025.08.04.00, still uses C++17:
compiler.cxx_standard   2017

cmake.generator     Ninja

configure.args-append \
                    -DBUILD_SHARED_LIBS=ON \
                    -DBUILD_TESTS=OFF

if {[string match *clang* ${configure.compiler}]} {
    # Don’t use libcxx with gcc.
    legacysupport.use_mp_libcxx yes
}

if {[string match *gcc* ${configure.compiler}] && ${configure.build_arch} in [list arm i386 ppc]} {
    configure.ldflags-append \
                    -latomic
}
