53.5. libidn2-2.3.8
Free software implementation of IDNA2008, Punycode and TR46
| Version | 2.3.8, release 1 |
| Shelf | net-libs — Networking and protocol libraries |
| Phase | 30_foundation (Build Foundation), 112 of 127 in build order |
| Licence | (LGPL-3.0-or-later OR GPL-2.0-or-later) AND GPL-3.0-or-later |
| Homepage | https://gitlab.com/libidn/libidn2 |
| Build time | 1.1 SBU |
| Installed size | 711.1 KiB in 32 files |
| Recipe | ports/core/net-libs/libidn2/kpkgbuild |
About
libidn2 converts internationalised domain names, host names written in Unicode such as bücher.example, to and from the ASCII form DNS carries (xn--bcher-kva.example), following IDNA2008, Punycode and Unicode’s TR46 mapping. It installs the library and the idn2 command. The Unicode tables it needs come from libunistring.
curl links it to resolve such names, libpsl uses it at run time to convert the entries of a Public Suffix List file it loads, and gnutls, rsync, dnsmasq, whois, lynx, msmtp and gmime depend on it as well.
Sources
libidn2-2.3.8.tar.gz(2.1 MiB)
sha256f557911bf6171621e1f72ff35f5b1825bb35b52ed45325dcdee931e5d3c0787a
upstream: https://ftp.gnu.org/gnu/libidn/libidn2-2.3.8.tar.gz
archive copy: sources-3/net-libs--libidn2-2.3.8.tar.gz
Dependencies
Depends on: libunistring.
Required by (9): curl, dnsmasq, gmime, gnutls, libpsl, lynx, msmtp, rsync, whois.
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 libidn2'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/net-libs/libidn2.
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/libidn2
echo 'f557911bf6171621e1f72ff35f5b1825bb35b52ed45325dcdee931e5d3c0787a libidn2-2.3.8.tar.gz' | 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/libidn2
SRC=$SRC_ROOT/libidn2-2.3.8
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf libidn2-2.3.8.tar.gz -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 --disable-nls --disable-valgrind-tests
make
make DESTDIR=$PKG install
rm -rf "$PKG/usr/share/gtk-doc"
The switches, and why each is set:
--disable-nls— build no message catalogues. No catalogue would ship anyway: the package’s language prune removes every non-English one (see Size and language policy), and with translation off the library has no use for GNUlibintl; see Gettext on musl.--disable-valgrind-tests— do not run the self-tests under Valgrind. By default configure looks forvalgrindonPATHand, when it finds one, wraps the test suite in it. The valgrind port exists from40_langon, so the switch keeps a rebuild’s configure result the same whatever is installed.build.shruns no test suite.
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/libidn2, 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 libidn2-2.3.8-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/libidn2, and runs the triggers its paths call for.
Contents
Installed programs: idn2.
Installed libraries: libidn2.a, libidn2.so.
Installed directories: /usr/share/licenses/libidn2.
Short descriptions
idn2 |
Libidn2 Internationalized Domain Names conversion tool |
libidn2.pc |
Library implementing IDNA2008 and TR46 |
Notes
The release tarball carries the API reference already generated as HTML, under doc/reference/html, and make install copies it under /usr/share/gtk-doc/html whether or not gtk-doc is enabled. The package prune removes HTML manuals only under usr/share/doc and TeX Live’s documentation tree, so build.sh deletes usr/share/gtk-doc itself. The manual pages and the Info manual stay.