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
ngtcp2-1.25.0.tar.xz(692.5 KiB)
sha2562a34d2484ba17847a5d11965704e9dd0fac4c6d8efc75ffe1ec7de66d8c6b6fb
upstream: https://github.com/ngtcp2/ngtcp2/releases/download/v1.25.0/ngtcp2-1.25.0.tar.xz
archive copy: sources-3/net-libs--ngtcp2-1.25.0.tar.xz
Dependencies
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.
--without-gnutls, line 17: gnutls (explained with the switches below)--without-libnghttp3, line 21: nghttp3 (explained with the switches below)--without-jemalloc, line 23: jemalloc
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:
--enable-lib-only— buildlibngtcp2and the crypto helper, and not the example client and server. With it, configure also skips every check that only the examples use: libnghttp3, libev, jemalloc and the two brotli libraries.--with-openssl— build the crypto helper for OpenSSL. Configure looks for OpenSSL withpkg-configand then for the API it needs: firstSSL_provide_quic_data, the interface of the quictls fork, thenSSL_set_quic_tls_cbs, OpenSSL’s own. With the second it buildslibngtcp2_crypto_ossl. With neither, configure would quietly drop OpenSSL support, and the switch turns that into an error:openssl was requested (--with-openssl) but not found.--without-gnutls— no crypto helper for GnuTLS.--without-boringssl,--without-picotlsand--without-wolfssldo the same for those three libraries. Each is already off by default; the switches say on the command line that the OpenSSL helper is the only one. GnuTLS is a port of a later phase,41_system, and the other three are not ports.--without-libnghttp3— with--without-libev,--without-jemalloc,--without-libbrotliencand--without-libbrotlidec: the optional libraries of the examples. Under--enable-lib-onlyconfigure never looks for them, so these switches change nothing in the build; they record that the examples’ dependencies are not wanted.--disable-cryptotest— skip the crypto helper’s test program. It is acheck_PROGRAMStarget, built only bymake check, whichbuild.shdoes not run.
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 |