53.4. nghttp3-1.18.0
HTTP/3 and QPACK library
| Version | 1.18.0, release 1 |
| Shelf | net-libs — Networking and protocol libraries |
| Phase | 30_foundation (Build Foundation), 111 of 127 in build order |
| Licence | MIT |
| Homepage | https://nghttp2.org/nghttp3/ |
| Build time | 0.6 SBU |
| Installed size | 328.7 KiB in 8 files |
| Recipe | ports/core/net-libs/nghttp3/kpkgbuild |
About
nghttp3 implements HTTP/3, the mapping of HTTP onto QUIC (RFC 9114), and QPACK, its header compression (RFC 9204), as the C library libnghttp3. It does not carry a QUIC transport of its own: the caller pairs it with one, and in this tree that is ngtcp2.
curl links the two for its HTTP/3 support, and wireshark links nghttp3 to decompress the headers of HTTP/3 traffic it captures.
Sources
nghttp3-1.18.0.tar.xz(401.2 KiB)
sha256aad782c23d3f01bd4bb52c8bac7a553b631ef8115fd1612703df6183449fef19
upstream: https://github.com/ngtcp2/nghttp3/releases/download/v1.18.0/nghttp3-1.18.0.tar.xz
archive copy: sources-3/net-libs--nghttp3-1.18.0.tar.xz
Dependencies
Depends on: nothing a recipe names.
Required by (2): curl, wireshark.
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 nghttp3'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/net-libs/nghttp3.
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/nghttp3
echo 'aad782c23d3f01bd4bb52c8bac7a553b631ef8115fd1612703df6183449fef19 nghttp3-1.18.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/nghttp3
SRC=$SRC_ROOT/nghttp3-1.18.0
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf nghttp3-1.18.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
make
make DESTDIR=$PKG install
The switches, and why each is set:
--enable-lib-only— build the library only. The one thing it leaves out is theexamplesdirectory, whoseqpackprogram is anoinst_PROGRAMStarget compiled with the C++ compiler and never installed.
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/nghttp3, 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 nghttp3-1.18.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/nghttp3, and runs the triggers its paths call for.
Contents
Installed libraries: libnghttp3.so.
Installed directories: /usr/include/nghttp3, /usr/share/doc/nghttp3, /usr/share/licenses/nghttp3.
Short descriptions
libnghttp3.pc |
nghttp3 library |