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

306.12. digikam-9.1.0

digiKam and showFoto: photo library, tagging, face recognition, RAW import and editing, for Qt 6

Version 9.1.0, release 2
Shelf graphics — Graphics applications: painting, vector, photo development and management, image viewers, screenshot and image optimisers
Phase 44_apps (Applications), 232 of 422 in build order
Licence GPL-2.0-or-later
Homepage https://www.digikam.org/
Build time 52.6 SBU
Installed size 137.2 MiB in 1934 files
Recipe ports/core/graphics/digikam/kpkgbuild

About

digiKam is KDE’s photo library: albums, tags, ratings, face detection and recognition, camera and scanner import, RAW development and a full image editor. The same build produces showFoto, the editor on its own for single files. Both are built against Qt 6 and KDE Frameworks 6, and the collection lives in SQLite.

Sources

Dependencies

Depends on: cmake, ninja, pkgconf, gettext, extra-cmake-modules, qt6-qtbase, qt6-qtsvg, qt6-qtnetworkauth, qt6-qtscxml, qt6-qtmultimedia, qt6-qtwebengine, kxmlgui, kcoreaddons, kconfig, kservice, kwindowsystem, solid, ki18n, kio, kiconthemes, threadweaver, knotifyconfig, knotifications, sonnet, kcalendarcore, libksane, opencv, exiv2, expat, libjpeg-turbo, lcms2, libpng, libtiff, zlib, boost, eigen, libheif, libjxl, jasper, x265, flex, bison, libxml2, libxslt, imagemagick, ffmpeg, lensfun, libgphoto2, glib, libX11, libXv, mesa, libglvnd, hicolor-icon-theme.

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

What kpkg does

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

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/digikam
echo 'a7309191e9a4787853cb3ac4136e4f8d7c044b40338dc42c7e422c37625b72e1  digikam-9.1.0.tar.xz' | sha256sum -c -
echo '8f2383e4dd3cfbb4553ea8718107fc0423210dc964f9f4280604804ed2552fa4  face_detection_yunet_2023mar.onnx' | sha256sum -c -
echo '0ba9fbfa01b5270c96627c4ef784da859931e02f04419c829e83484087c34e79  face_recognition_sface_2021dec.onnx' | sha256sum -c -
echo '158c039c7ae795340eea959bedde4a5d263a8add9e5bebca10b4a45bb7073a2b  dnntestimage.jpeg' | 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/digikam
SRC=$SRC_ROOT/digikam-9.1.0
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf digikam-9.1.0.tar.xz -C "$SRC" --strip-components=1
cp face_detection_yunet_2023mar.onnx "$SRC"
cp face_recognition_sface_2021dec.onnx "$SRC"
cp dnntestimage.jpeg "$SRC"

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 recipe’s helpers _models and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:

patch -p1 -i "$PORT_SRC/ai-tools-default-off.patch"
patch -p1 -i "$PORT_SRC/no-online-export.patch"

cmake -S . -B build -G Ninja \
	-D CMAKE_C_STANDARD=99 \
	-D CMAKE_C_EXTENSIONS=ON \
	-D CMAKE_INSTALL_PREFIX=/usr \
	-D KDE_INSTALL_LIBDIR=lib \
	-D CMAKE_BUILD_TYPE=Release \
	-D KDE_INSTALL_USE_QT_SYS_PATHS=ON \
	-D BUILD_TESTING=OFF \
	-D BUILD_WITH_QT6=ON \
	-D DIGIKAMSC_COMPILE_PO=OFF \
	-D DIGIKAMSC_COMPILE_DIGIKAM=ON \
	-D KF_SKIP_PO_PROCESSING=ON \
	-D ENABLE_MYSQLSUPPORT=OFF \
	-D ENABLE_INTERNALMYSQL=OFF \
	-D ENABLE_KFILEMETADATASUPPORT=OFF \
	-D ENABLE_AKONADICONTACTSUPPORT=OFF \
	-D ENABLE_GEOLOCATION=ON \
	-D ENABLE_MEDIAPLAYER=ON \
	-D ENABLE_DBUS=ON \
	-D ENABLE_KIO=ON \
	-D ENABLE_APPSTYLES=OFF \
	-D ENABLE_SHOWFOTO=ON \
	-D ENABLE_DIGIKAM_MODELTEST=OFF \
	-D ENABLE_SANITIZERS=OFF \
	-D BUILD_WITH_CCACHE=OFF \
	-D CMAKE_REQUIRE_FIND_PACKAGE_Jasper=ON \
	-D CMAKE_REQUIRE_FIND_PACKAGE_X11=ON \
	-D CMAKE_REQUIRE_FIND_PACKAGE_LensFun=ON \
	-D CMAKE_REQUIRE_FIND_PACKAGE_Gphoto2=ON \
	-D CMAKE_REQUIRE_FIND_PACKAGE_Eigen3=ON \
	-D CMAKE_REQUIRE_FIND_PACKAGE_ImageMagick=ON \
	-D CMAKE_REQUIRE_FIND_PACKAGE_GLIB2=ON \
	-D CMAKE_REQUIRE_FIND_PACKAGE_Libheif=ON \
	-D CMAKE_REQUIRE_FIND_PACKAGE_X265=ON \
	-D CMAKE_REQUIRE_FIND_PACKAGE_Libjxl=ON \
	-D CMAKE_REQUIRE_FIND_PACKAGE_FLEX=ON \
	-D CMAKE_REQUIRE_FIND_PACKAGE_BISON=ON \
	-D CMAKE_REQUIRE_FIND_PACKAGE_LibXml2=ON \
	-D CMAKE_REQUIRE_FIND_PACKAGE_LibXslt=ON \
	-D CMAKE_REQUIRE_FIND_PACKAGE_KSaneWidgets6=ON \
	-D CMAKE_REQUIRE_FIND_PACKAGE_KF6KIO=ON \
	-D CMAKE_REQUIRE_FIND_PACKAGE_KF6IconThemes=ON \
	-D CMAKE_REQUIRE_FIND_PACKAGE_KF6ThreadWeaver=ON \
	-D CMAKE_REQUIRE_FIND_PACKAGE_KF6NotifyConfig=ON \
	-D CMAKE_REQUIRE_FIND_PACKAGE_KF6Notifications=ON \
	-D CMAKE_REQUIRE_FIND_PACKAGE_KF6Sonnet=ON \
	-D CMAKE_REQUIRE_FIND_PACKAGE_KF6CalendarCore=ON \
	-D CMAKE_REQUIRE_FIND_PACKAGE_Qt6Multimedia=ON \
	-D CMAKE_REQUIRE_FIND_PACKAGE_Qt6MultimediaWidgets=ON \
	-Wno-dev
cmake --build build
DESTDIR=$PKG cmake --install build

install -d "$PKG/usr/share/digikam/facesengine"
install -m644 face_detection_yunet_2023mar.onnx face_recognition_sface_2021dec.onnx \
	dnntestimage.jpeg "$PKG/usr/share/digikam/facesengine/"

cat > "$PKG/usr/share/applications/org.kde.digikam.desktop" <<'EOF'
[Desktop Entry]
Type=Application
Name=digiKam
GenericName=Photo Library
Comment=Organise, tag, search and edit a photo collection
Exec=digikam
Icon=digikam
Terminal=false
StartupWMClass=org.kde.digikam
Categories=Qt;KDE;Graphics;Photography;
Keywords=photo;library;album;tag;face;raw;camera;import;digikam;
EOF
cat > "$PKG/usr/share/applications/org.kde.showfoto.desktop" <<'EOF'
[Desktop Entry]
Type=Application
Name=showFoto
GenericName=Photo Editor
Comment=View and edit single photos with digiKam's tools
Exec=showfoto %U
Icon=showfoto
Terminal=false
StartupWMClass=org.kde.showfoto
Categories=Qt;KDE;Graphics;Photography;
Keywords=photo;editor;viewer;raw;showfoto;
EOF
chmod 644 "$PKG/usr/share/applications/org.kde.digikam.desktop" \
	"$PKG/usr/share/applications/org.kde.showfoto.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/digikam, 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 digikam-9.1.0-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/digikam, and runs the triggers its paths call for.

Contents

Installed programs: cleanup_digikamdb, digikam, digitaglinktree, showfoto.

Installed libraries: libdigikamcore.so, libdigikamdatabase.so, libdigikamgui.so.

Installed directories: /usr/include/digikam, /usr/lib/cmake/DigikamCore, /usr/lib/cmake/DigikamDatabase, /usr/lib/cmake/DigikamGui, /usr/lib/cmake/DigikamPlugin, /usr/lib/qt6/plugins/digikam, /usr/share/digikam, /usr/share/kxmlgui5/digikam, /usr/share/kxmlgui5/showfoto, /usr/share/licenses/digikam, /usr/share/showfoto.

Short descriptions

cleanup_digikamdb Cleanup the digiKam databases to reduce their sizes and increase access speed
digitaglinktree Export tag structure of photos in digikam to the filesystem.

Notes

The face engine looks for its models under digikam/facesengine in the XDG data directories before it offers to download them. The three later sources are those files, installed into /usr/share/digikam/facesengine, so face detection and recognition work on first start with no network. Their names and sizes must be the ones core/data/dnnmodels/dnnmodels.conf lists: a file that differs counts as missing.

build.sh writes both desktop entries over upstream’s, with StartupWMClass set to the Wayland app ids KAboutData gives the programs, org.kde.digikam and org.kde.showfoto. showFoto’s entry carries no MimeType: the image types already have a handler, and a second claim would make the default whichever entry sorts first.