Skip to the text
KDOS
Menu
kdos.dev KDOS from Scratch KDOS 0.2 · 4dd4a10 · 2026-11-30 Contents Index

53.3. ngtcp2-1.25.0

QUIC protocol library, with its OpenSSL crypto helper

Version 1.25.0, release 1
Shelf net-libs — Networking and protocol libraries
Phase 30_foundation (Build Foundation), 110 of 127 in build order
Licence MIT
Homepage https://nghttp2.org/ngtcp2/
Build time 1.0 SBU
Installed size 784.5 KiB in 14 files
Recipe ports/core/net-libs/ngtcp2/kpkgbuild

About

ngtcp2 implements QUIC, the UDP-based transport under HTTP/3, in C. The package has two parts: libngtcp2, the protocol engine, which leaves the TLS handshake to a separate library, and a crypto helper library that connects it to one particular TLS implementation. KDOS builds the helper for OpenSSL, libngtcp2_crypto_ossl, which uses the QUIC TLS interface OpenSSL itself provides.

Its one consumer in the tree is curl, which builds its HTTP/3 support from this and nghttp3 and requires the ngtcp2_crypto_ossl module to be found by pkg-config, or its configure stops.

Sources

Dependencies

Depends on: openssl, pkgconf.

Required by (1): curl.

Optional, off in KDOS

These switches in build.sh turn off a feature whose library is a port here. The recipe may turn each off on purpose, or because the library was not yet a port when the recipe was written; this list cannot tell which.

Installation

From the repository root, inside the build container, this is the line kdosbuild runs for the port:

script/chroot/exec.sh bash -c 'source script/phases/30_foundation/phase.env && kpkg install ngtcp2'

What kpkg does

kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/net-libs/ngtcp2.

1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.

cd /ports/core/net-libs/ngtcp2
echo '2a34d2484ba17847a5d11965704e9dd0fac4c6d8efc75ffe1ec7de66d8c6b6fb  ngtcp2-1.25.0.tar.xz' | sha256sum -c -

2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.

SRC_ROOT=/var/cache/kpkg/work/ngtcp2
SRC=$SRC_ROOT/ngtcp2-1.25.0
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf ngtcp2-1.25.0.tar.xz -C "$SRC" --strip-components=1

Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.

3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:

./configure --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib \
	--disable-static \
	--enable-lib-only \
	--disable-cryptotest \
	--with-openssl \
	--without-gnutls \
	--without-boringssl \
	--without-picotls \
	--without-wolfssl \
	--without-libnghttp3 \
	--without-libev \
	--without-jemalloc \
	--without-libbrotlienc \
	--without-libbrotlidec
make
make DESTDIR=$PKG install

The switches, and why each is set:

The common switches of each build system are explained in the Flag glossary.

4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/ngtcp2, prunes what the image does not ship, lints the tree and rolls it reproducibly:

tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
    --mtime=@$SOURCE_DATE_EPOCH \
    --use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
    -cf ngtcp2-1.25.0-1.tar.xz -C "$PKG" .

5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/ngtcp2, and runs the triggers its paths call for.

Contents

Installed libraries: libngtcp2.so, libngtcp2_crypto_ossl.so.

Installed directories: /usr/include/ngtcp2, /usr/share/doc/ngtcp2, /usr/share/licenses/ngtcp2.

Short descriptions

libngtcp2.pc ngtcp2 library
libngtcp2_crypto_ossl.pc ngtcp2 ossl crypto library