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

53.8. curl-8.23.0

Utility and a library used for transferring files

Version 8.23.0, release 1
Shelf net-libs — Networking and protocol libraries
Phase 30_foundation (Build Foundation), 116 of 127 in build order
Licence curl
Homepage https://curl.se/
Build time 0.9 SBU
Installed size 5.7 MiB in 552 files
Recipe ports/core/net-libs/curl/kpkgbuild

About

curl is the curl command and libcurl, the library behind it: URL transfers over HTTP(S) in all three versions, FTP, SCP and SFTP, LDAP, SMTP, IMAP and the rest of its protocols. git, in the same phase, links it for HTTP remotes; rust’s cargo and cargo-c, in 31_compilers, link it too; and many later ports depend on it.

KDOS’s own tools run the curl command rather than linking the library, always through an argument vector and never a shell. kdos update fetch downloads the signed ports tree with it and takes curl’s exit codes for an unresolved name, a refused connection and a timeout to mean the machine is offline; kpkg downloads each source with it during kdos update apply; and kdos-fetch-static downloads with it too. The build’s own ports/fetch and ports/publish run on the build host and use the host’s curl, not this one.

Almost every switch in build.sh names a feature, and the library behind it is in the recipe’s depends, so it is installed before curl builds. Left to itself, configure looks for each optional library and builds without the feature when it finds none; named, each makes a missing library an error instead. libidn2 is the exception: configure only warns about it whatever the switches say. The Notes describe the two checks build.sh adds after configure.

Sources

Dependencies

Depends on: ca-certificates, openssl, zlib, perl, nghttp2, ngtcp2, nghttp3, libidn2, libunistring, libpsl, libssh2, zstd, brotli, openldap.

Required by (77): amiberry, appstream, ardour, bladerf, cargo-c, chromium, clamav, coeurl, darktable, ddnet, freeciv, fwupd, git, gnuastro, gpredict, gst-plugins-bad, horizon-eda, htslib, hurl, imhex, ioquake3, kdos-tools, kicad, kodi, koreader, libgphoto2, libkiwix, libmediainfo, libproxy, libqalculate, libreoffice, libtatsu, lnav, mpd, mtxclient, mupdf, nbdkit, nco, netcdf-c, netsurf, networkmanager, newsboat, nheko, obs-studio, octave, opencpn, openttd, orcaslicer, pdal, postgresql, powerman, predict, profanity, prusaslicer, qemu, R, remmina, rust, sane-backends, satdump, sfeed, srb2, supertuxkart, tesseract, tpm2-tools, tpm2-tss, transmission, viking, vorbis-tools, warzone2100, weechat, wesnoth, wxwidgets, xastir, xmlrpc-c, xonotic, yamagi-quake2.

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 curl'

What kpkg does

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

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/curl
echo '8dadd7d2536a314f982ad05a651b713f426bf7d02cc2c76cffb9796f2218e6c5  curl-8.23.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/curl
SRC=$SRC_ROOT/curl-8.23.0
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf curl-8.23.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 \
	--enable-ldap \
	--enable-ldaps \
	--enable-threaded-resolver \
	--with-ca-bundle=/etc/ssl/certs/ca-certificates.crt \
	--with-openssl \
	--with-nghttp2 \
	--with-ngtcp2 \
	--with-nghttp3 \
	--with-libidn2 \
	--with-libpsl \
	--with-libssh2 \
	--with-zstd \
	--with-brotli \
	--with-zsh-functions-dir=/usr/share/zsh/site-functions \
	--without-fish-functions-dir
grep -q '^#define USE_OPENLDAP 1' lib/curl_config.h ||
	{ echo "curl: OpenLDAP not found at configure" >&2; exit 1; }
grep -q '^#define HAVE_BROTLI 1' lib/curl_config.h ||
	{ echo "curl: brotli not found at configure" >&2; exit 1; }
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/curl, 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 curl-8.23.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/curl, and runs the triggers its paths call for.

Contents

Installed programs: curl, curl-config, wcurl.

Installed libraries: libcurl.a, libcurl.so.

Installed directories: /usr/include/curl, /usr/share/licenses/curl.

Short descriptions

curl transfer a URL
curl-config Get information about a libcurl installation
wcurl a simple wrapper around curl to easily download files.
libcurl.pc Library to transfer files with HTTP, FTP, etc.

Notes

Two checks run between configure and make. Each greps lib/curl_config.h, the header configure writes, and stops the build unless it defines a feature:

When either fails, the message names the library: “curl: OpenLDAP not found at configure” or “curl: brotli not found at configure”. Look in config.log for why the library’s check failed, not in make’s output.