# -*- 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.19.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  79603e256ffaf5289ef1a01df466be5476235ac6 \
                        sha256  228e17f5cc3d4de7bfced9912bd09de30e7f45741cc47503cf88d3fa9209e155 \
                        size    418660
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
