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
darktable-5.6.1.tar.xz(8.0 MiB)
sha256e8b84ac98b0b689a244e4036c4b56394c1d58ce2d9abc05e0a060ef9f756dc36
upstream: https://github.com/darktable-org/darktable/releases/download/release-5.6.1/darktable-5.6.1.tar.xz
archive copy: sources-2/graphics--darktable-5.6.1.tar.xz
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.
no-graphite.patch— Removesloop-nest-optimize,tree-loop-linear,loop-blockandloop-strip-minefrom the#pragma GCC optimizelists in the blend, IOP-order, IOP-profile and channel-mixer sources and insrc/common/extra_optimizations.h. They are Graphite passes, the tree’s GCC is built without isl, and it rejects each one as unimplemented. A pragma takes precedence over the command line, so no flag can turn them off. Inchannelmixerrgb.cit also drops the blank continuation lines inside theNOTEBOOK_PAGEmacro.
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:
-D BINARY_PACKAGE_BUILD=ON— Passes-mtune=genericinstead of probing for-march=native, so the code is built for the compiler’s default target rather than the builder’s processor. Bundled rawspeed reads the same switch for its own CPU settings. Without it the package carries instructions of the machine that built it and stops with an illegal instruction on an older processor.-D RAWSPEED_ENABLE_WERROR=OFF— Rawspeed turns every warning into an error by default; a warning this compiler adds would fail the build (see An upstream-Werror).-D RAWSPEED_ENABLE_LTO=OFF— No link-time optimisation for rawspeed; upstream’s default, named.-D USE_CAMERA_SUPPORT=ON— Tethered shooting and import straight from a camera through libgphoto2.-D USE_COLORD=OFF— No display profile from colord, which is not a port.-D USE_MAP=ON,-D CMAKE_REQUIRE_FIND_PACKAGE_OSMGpsMap=ON— The map view, which places geotagged images on OpenStreetMap tiles drawn and cached by osm-gps-map and fetched online when the view opens. The second switch makes the library required: darktable otherwise drops the view, with only a status message, when it is not found.-D USE_AI=OFF— No AI modules, which run on onnxruntime and download their models from a repository at run time; upstream’s default, named.-D USE_KWALLET=OFF,-D USE_LIBSECRET=OFF— No password-store back end. darktable keeps only the credentials of its web export targets there, and both are on by default.-D USE_UNITY=OFF— No progress on a Unity launcher icon; upstream’s default, named.-D USE_LUA=ON,-D DONT_USE_INTERNAL_LUA=ON— Lua scripting against the system lua54. darktable takes Lua 5.4 only, and with the second switch configure stops if it is missing rather than building the copy in the tarball. Both are upstream’s defaults.-D USE_OPENMP=ON,-D USE_OPENCL=ON— Threads through OpenMP and GPU processing through OpenCL. The OpenCL loader is opened at run time, so neither needs anything more at build time.-D TESTBUILD_OPENCL_PROGRAMS=OFF— Does not test-compile the OpenCL kernels during the build, which needs LLVM and Clang; the kernels are compiled by the OpenCL driver when they run.-D USE_GRAPHICSMAGICK=OFF,-D USE_IMAGEMAGICK=ON— The fallback loader for formats darktable has no reader of its own for, such as FITS and GIF, is imagemagick rather than GraphicsMagick, which is upstream’s default.-D USE_GMIC=OFF— No G’MIC support in the LUT 3D module; G’MIC is not a port.-D USE_LIBRAW=ON,-D DONT_USE_INTERNAL_LIBRAW=ON— LibRaw for the raw formats darktable hands it, always Canon’s CR3 and Sigma’s X3F and any extension added to thelibraw_extensionssetting, from the system library rather than the copy insrc/external/LibRaw.-D CMAKE_REQUIRE_FIND_PACKAGE_libraw=ON— Makes the system LibRaw required. Asked not to use the bundled copy, darktable still builds it, with only a status message, when the system one is not found (see A graphical application).-D USE_XMLLINT=ON— Validates the generateddarktableconfig.xmlwithxmllint --nonetfrom libxml2 during the build.-D USE_PORTMIDI=ON,-D USE_SDL2=ON— MIDI controllers through portmidi and gamepads through SDL2, as input devices for darktable’s shortcuts.-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_OPENEXR=ON,-D USE_ICU=ON— Upstream’s defaults, named: JPEG 2000, JPEG XL, WebP, AVIF and HEIF, GIMP’s XCF format, metadata of ISO base media files (CR3, AVIF, HEIF) through exiv2, which the tree builds with-DEXIV2_ENABLE_BMFF=ON, OpenEXR, and ICU.-D BUILD_PRINT=ON— The print view, through cups; upstream’s default, named.-D BUILD_CMSTEST=OFF— Leaves outdarktable-cmstest, which reads display profiles through X11 and XRandR and has nothing to report on a Wayland session.-D BUILD_RS_IDENTIFY=ON— Buildsdarktable-rs-identify, which prints what rawspeed knows of a raw file; upstream’s default, named.-D VALIDATE_APPDATA_FILE=OFF— Does not runappstream-utilover the AppData file; upstream’s default, named.-Wl,--strip-debug— darktable adds-gtoCMAKE_C_FLAGSandCMAKE_CXX_FLAGSfor every build type, after the tree’s flags, so the debug information is dropped at the link (see What kpkg does around build.sh).
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.