# -*- 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               github 1.0

github.setup            ngtcp2 nghttp3 1.18.0 v
revision                0
categories              net
maintainers             {gmail.com:herby.gillot @herbygillot} \
                        openmaintainer
license                 MIT
description             ${name} is an implementation of RFC 9114 HTTP/3 \
                        mapping over QUIC and RFC 9204 QPACK in C
long_description        {*}${description}
homepage                https://nghttp2.org/nghttp3
checksums               rmd160  a09f3c30973da02089552ffe9800e08dc7533a85 \
                        sha256  aad782c23d3f01bd4bb52c8bac7a553b631ef8115fd1612703df6183449fef19 \
                        size    410868
github.tarball_from     releases

use_xz                  yes

compiler.cxx_standard   2017

use_autoreconf          yes

# The test suite lists its include paths in AM_CFLAGS, which automake places
# after CPPFLAGS on the compile line. -I${prefix}/include therefore wins and the
# tests build against an already-installed nghttp3's headers instead of the ones
# in the source tree, so `port test` fails on every upgrade. Move them to
# AM_CPPFLAGS, as lib/ and examples/ already do.
patchfiles-append       patch-tests-Makefile.am.diff

depends_build-append    path:bin/pkg-config:pkgconfig

# Only the library is installed; the C++ example would be built and discarded.
# The test suite is not gated by --enable-lib-only.
configure.args-append   --disable-silent-rules \
                        --enable-lib-only=yes

test.run                yes
test.target             check
