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

118.14. libjxl-0.12.0

JPEG XL reference implementation — libjxl, cjxl, djxl and the gdk-pixbuf loader

Version 0.12.0, release 1
Shelf image-libs — Raster image formats, codecs, metadata, processing, barcodes, and terminal image output
Phase 41_system (System), 688 of 1047 in build order
Licence BSD-3-Clause
Homepage https://jpeg.org/jpegxl/
Build time 3.7 SBU
Installed size 8.8 MiB in 44 files
Recipe ports/core/image-libs/libjxl/kpkgbuild

About

libjxl is the reference implementation of JPEG XL: libjxl and libjxl_threads, libjxl_cms, the cjxl and djxl converters, and a gdk-pixbuf loader, so GTK programs open .jxl files. ffmpeg, imagemagick, gimp, krita, the web engines and KDE’s kimageformats link it.

Sources

Dependencies

Depends on: cmake, ninja, pkgconf, highway, brotli, lcms2, libpng, giflib, libjpeg-turbo, openexr, gdk-pixbuf, asciidoc.

Required by (24): chafa, darktable, digikam, ffmpeg, gdal, gimp, graphicsmagick, gthumb, imagemagick, imv, kimageformats, krita, lagrange, libcupsfilters, libvips, netsurf, opencv, openimageio, rawtherapee, sdl2-image, sdl3-image, swayimg, webkitgtk, webkitgtk6.

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/41_system/phase.env && kpkg install libjxl'

What kpkg does

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

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/image-libs/libjxl
echo '03e9be69a30be4011f559da75328b6d7cea8ad921fabfbd551ce10bf45cdc992  libjxl-0.12.0.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/libjxl
SRC=$SRC_ROOT/libjxl-0.12.0
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf libjxl-0.12.0.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:

cmake -S . -B build -G Ninja \
	-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
	-DCMAKE_BUILD_TYPE=Release \
	-DCMAKE_INSTALL_PREFIX=/usr \
	-DCMAKE_INSTALL_LIBDIR=lib \
	-DBUILD_SHARED_LIBS=ON \
	-DBUILD_TESTING=OFF \
	-DJPEGXL_FORCE_SYSTEM_HWY=ON \
	-DJPEGXL_FORCE_SYSTEM_BROTLI=ON \
	-DJPEGXL_FORCE_SYSTEM_LCMS2=ON \
	-DJPEGXL_BUNDLE_LIBPNG=OFF \
	-DJPEGXL_ENABLE_SKCMS=OFF \
	-DJPEGXL_ENABLE_SJPEG=OFF \
	-DJPEGXL_ENABLE_OPENEXR=ON \
	-DJPEGXL_ENABLE_TRANSCODE_JPEG=ON \
	-DJPEGXL_ENABLE_BOXES=ON \
	-DJPEGXL_ENABLE_TOOLS=ON \
	-DJPEGXL_ENABLE_MANPAGES=ON \
	-DJPEGXL_ENABLE_DOXYGEN=OFF \
	-DJPEGXL_ENABLE_BENCHMARK=OFF \
	-DJPEGXL_ENABLE_EXAMPLES=OFF \
	-DJPEGXL_ENABLE_DEVTOOLS=OFF \
	-DJPEGXL_ENABLE_VIEWERS=OFF \
	-DJPEGXL_ENABLE_FUZZERS=OFF \
	-DJPEGXL_ENABLE_JNI=OFF \
	-DJPEGXL_ENABLE_TCMALLOC=OFF \
	-DJPEGXL_ENABLE_COVERAGE=OFF \
	-DJPEGXL_ENABLE_PLUGINS=ON \
	-DJPEGXL_ENABLE_PLUGIN_GDKPIXBUF=ON \
	-DJPEGXL_ENABLE_PLUGIN_MIME=OFF \
	-DJPEGXL_WARNINGS_AS_ERRORS=OFF \
	-DCMAKE_REQUIRE_FIND_PACKAGE_GIF=ON \
	-DCMAKE_REQUIRE_FIND_PACKAGE_JPEG=ON \
	-DCMAKE_REQUIRE_FIND_PACKAGE_PNG=ON
cmake --build build
DESTDIR=$PKG cmake --install build

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/libjxl, 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 libjxl-0.12.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/libjxl, and runs the triggers its paths call for.

Contents

Installed programs: cjxl, djxl, jxlinfo, jxltran.

Installed libraries: libjxl.so, libjxl_cms.so, libjxl_extras_codec.a, libjxl_threads.so.

Installed directories: /usr/include/jxl, /usr/share/licenses/libjxl.

Short descriptions

cjxl compress images to JPEG XL
djxl decompress JPEG XL images
libjxl.pc Loads and saves JPEG XL files
libjxl_cms.pc CMS support library for libjxl
libjxl_threads.pc JPEG XL multi-thread runner using std::threads.