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

306.4. darktable-5.6.1

RAW photo developer and virtual lighttable

Version 5.6.1, release 2
Shelf graphics — Graphics applications: painting, vector, photo development and management, image viewers, screenshot and image optimisers
Phase 44_apps (Applications), 224 of 422 in build order
Licence GPL-3.0-or-later
Homepage https://www.darktable.org/
Build time 17.6 SBU
Installed size 28.5 MiB in 1142 files
Recipe ports/core/graphics/darktable/kpkgbuild

About

darktable is a raw photo developer and virtual lighttable: it keeps a catalogue of photographs and develops each one non-destructively from the camera’s raw data, with edits stored beside the image. The port builds the GTK 3 program and its companions, darktable-cli for developing from a shell, darktable-chart for building colour lookup tables from a chart, and darktable-rs-identify. Raw decoding is the rawspeed library darktable carries in src/external/rawspeed, with the tree’s libraw for the formats it hands on.

Sources

Dependencies

Depends on: cmake, ninja, pkgconf, perl, intltool, gettext, libxslt, libxml2, gtk3, glib, librsvg, pango, cairo, libpng, libjpeg-turbo, libtiff, lcms2, json-glib, potrace, sqlite, curl, exiv2, lensfun, libraw, libgphoto2, imath, openexr, libjxl, libwebp, libavif, libheif, openjpeg, imagemagick, portmidi, sdl2-compat, iso-codes, icu, lua54, pugixml, cups, osm-gps-map, zlib.

Required by: no port names it.

Patches

build.sh applies these; kpkg applies nothing by itself.

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/44_apps/phase.env && kpkg install darktable'

What kpkg does

kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/graphics/darktable.

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/graphics/darktable
echo 'e8b84ac98b0b689a244e4036c4b56394c1d58ce2d9abc05e0a060ef9f756dc36  darktable-5.6.1.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/darktable
SRC=$SRC_ROOT/darktable-5.6.1
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf darktable-5.6.1.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:

patch -p1 -i "$PORT_SRC/no-graphite.patch"

export LDFLAGS="$LDFLAGS -Wl,--strip-debug"

cmake -S . -B build -G Ninja \
	-D CMAKE_POLICY_VERSION_MINIMUM=3.5 \
	-D CMAKE_INSTALL_PREFIX=/usr \
	-D CMAKE_INSTALL_LIBDIR=lib \
	-D CMAKE_BUILD_TYPE=Release \
	-D BUILD_TESTING=OFF \
	-D BINARY_PACKAGE_BUILD=ON \
	-D RAWSPEED_ENABLE_LTO=OFF \
	-D RAWSPEED_ENABLE_WERROR=OFF \
	-D USE_CAMERA_SUPPORT=ON \
	-D USE_COLORD=OFF \
	-D USE_MAP=ON \
	-D CMAKE_REQUIRE_FIND_PACKAGE_OSMGpsMap=ON \
	-D USE_LUA=ON \
	-D DONT_USE_INTERNAL_LUA=ON \
	-D USE_KWALLET=OFF \
	-D USE_LIBSECRET=OFF \
	-D USE_UNITY=OFF \
	-D USE_OPENMP=ON \
	-D USE_OPENCL=ON \
	-D TESTBUILD_OPENCL_PROGRAMS=OFF \
	-D USE_GRAPHICSMAGICK=OFF \
	-D USE_IMAGEMAGICK=ON \
	-D USE_XMLLINT=ON \
	-D USE_PORTMIDI=ON \
	-D USE_OPENJPEG=ON \
	-D USE_JXL=ON \
	-D USE_WEBP=ON \
	-D USE_AVIF=ON \
	-D USE_HEIF=ON \
	-D USE_XCF=ON \
	-D USE_ISOBMFF=ON \
	-D USE_LIBRAW=ON \
	-D DONT_USE_INTERNAL_LIBRAW=ON \
	-D CMAKE_REQUIRE_FIND_PACKAGE_libraw=ON \
	-D USE_AI=OFF \
	-D USE_OPENEXR=ON \
	-D USE_GMIC=OFF \
	-D USE_ICU=ON \
	-D USE_SDL2=ON \
	-D BUILD_PRINT=ON \
	-D BUILD_CMSTEST=OFF \
	-D BUILD_RS_IDENTIFY=ON \
	-D VALIDATE_APPDATA_FILE=OFF \
	-Wno-dev
cmake --build build
DESTDIR=$PKG cmake --install build

find "$PKG/usr/share/man" -mindepth 1 -maxdepth 1 ! -name 'man[0-9]*' -exec rm -rf {} +

cat > "$PKG/usr/share/applications/org.darktable.darktable.desktop" <<'DESKTOP'
[Desktop Entry]
Type=Application
Name=Darktable
GenericName=Virtual Lighttable and Darkroom
Comment=Organize and develop images from digital cameras
TryExec=darktable
Exec=darktable %U
Icon=darktable
Terminal=false
StartupNotify=true
StartupWMClass=org.darktable.darktable
MimeType=application/x-darktable;image/x-dcraw;image/x-adobe-dng;image/x-canon-cr2;image/x-canon-cr3;image/x-canon-crw;image/x-fuji-raf;image/x-kodak-dcr;image/x-kodak-kdc;image/x-minolta-mrw;image/x-nikon-nef;image/x-nikon-nrw;image/x-olympus-orf;image/x-panasonic-rw;image/x-panasonic-rw2;image/x-pentax-pef;image/x-sony-arw;image/x-sony-sr2;image/x-sony-srf;image/jpeg;image/png;image/tiff;image/x-portable-bitmap;image/x-portable-graymap;image/x-portable-pixmap;image/x-portable-floatmap;image/vnd.radiance;image/avif;image/x-exr;image/aces;image/heif;image/heic;image/jp2;image/jxl;image/webp;image/qoi;image/fits;
Categories=Graphics;Photography;GTK;
Keywords=graphics;photography;raw;darkroom;lighttable;darktable;
DESKTOP
chmod 644 "$PKG/usr/share/applications/org.darktable.darktable.desktop"

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/darktable, 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 darktable-5.6.1-2.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/darktable, and runs the triggers its paths call for.

Contents

Installed programs: darktable, darktable-chart, darktable-cli, darktable-cltest, darktable-generate-cache, darktable-rs-identify.

Installed directories: /usr/lib/darktable, /usr/share/darktable, /usr/share/doc/darktable, /usr/share/licenses/darktable, /usr/share/locale/en@truecase.

Short descriptions

darktable a digital photography workflow application
darktable-cli a command line darktable variant
darktable-cltest check if there is a usable OpenCL environment for darktable to use
darktable-generate-cache update darktables thumbnail cache

Notes

The find after the install removes every directory under /usr/share/man that is not a man<section> one, which takes out the translated manual pages; kpkg’s language rule removes the same directories (see Size and language policy).

darktable calls g_set_prgname("org.darktable.darktable"), which makes that its Wayland app_id. Upstream’s desktop entry names StartupWMClass=darktable and an absolute Exec path, so it is replaced by one with StartupWMClass=org.darktable.darktable and a bare Exec=darktable %U. The hicolor icons it names are upstream’s.