306.11. krita-6.0.4
Krita: digital painting, illustration and frame-by-frame animation, for Qt 6
| Version | 6.0.4, release 3 |
| Shelf | graphics — Graphics applications: painting, vector, photo development and management, image viewers, screenshot and image optimisers |
| Phase | 44_apps (Applications), 231 of 422 in build order |
| Licence | GPL-3.0-or-later |
| Homepage | https://krita.org/ |
| Build time | 90.9 SBU |
| Installed size | 229.0 MiB in 1328 files |
| Recipe | ports/core/graphics/krita/kpkgbuild |
About
Krita is a painting program for digital painting, illustration, comics and frame-by-frame animation, with brush engines, layers and masks, colour management through OpenColorIO and lcms2, pressure-sensitive tablet input, and Python scripting. The port builds Krita on Qt 6 and the KDE Frameworks, with its Wayland platform integration and its X11 path for Xwayland. G’MIC-Qt, which Krita can host as a filter plugin, is a separate program and is not part of this port.
Sources
krita-6.0.4.tar.xz(197.2 MiB)
sha256ef73e57fe20fa5bd896d53d4af6eb254e5ade83e6a39b47273dd320f9823ab4b
upstream: https://download.kde.org/stable/krita/6.0.4/krita-6.0.4.tar.xz
archive copy: sources-2/graphics--krita-6.0.4.tar.xz
Dependencies
Depends on: cmake, ninja, pkgconf, gettext, extra-cmake-modules, qt6-qtbase, qt6-qtsvg, qt6-qt5compat, qt6-qtdeclarative, qt6-qtwayland, wayland, kconfig, kwidgetsaddons, kcompletion, kcoreaddons, kguiaddons, ki18n, kitemviews, kcolorscheme, kcrash, boost, eigen, immer, zug, lager, xsimd, exiv2, lcms2, libpng, zlib, libjpeg-turbo, libtiff, giflib, libwebp, openexr, libheif, openjpeg, libjxl, fftw, gsl, opencolorio, kseexpr, libmypaint, quazip, libkdcraw, poppler, mlt, sdl2-compat, freetype2, harfbuzz, fontconfig, fribidi, libunibreak, libX11, libXi, python3, python3-sip, python3-pyqt-builder, python3-pyqt6, ffmpeg, hicolor-icon-theme, shared-mime-info.
Required by: no port names it.
Patches
build.sh applies these; kpkg applies nothing by itself.
0001-fftw-use-pkgconfig.patch— fftw use pkgconfigsip-abi.patch— Makescmake/modules/SIPMacros.cmakegive the Qt 6 Python bindings the sip ABI version13in place of13.0, so sip uses the newest minor version of ABI 13, as PyQt6 itself does. PyQt6 declares a minimum ABI above 13.0, and sip refuses to generate thekritamodule against a pinned 13.0.uic-assistants-class-name.patch— Removes the leading space from the class name" QWidget"ofshowDockerOptionsPanelinplugins/assistants/Assistants/AssistantsToolOptions.ui. The tree’suicchecks every widget class name and stops withInvalid class nameon one that does not open with a letter or an underscore.
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 krita'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/graphics/krita.
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/krita
echo 'ef73e57fe20fa5bd896d53d4af6eb254e5ade83e6a39b47273dd320f9823ab4b krita-6.0.4.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/krita
SRC=$SRC_ROOT/krita-6.0.4
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf krita-6.0.4.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/0001-fftw-use-pkgconfig.patch"
patch -p1 -i "$PORT_SRC/sip-abi.patch"
patch -p1 -i "$PORT_SRC/uic-assistants-class-name.patch"
cmake -S . -B build -G Ninja \
-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 ALLOW_UNSTABLE=QT6 \
-D ENABLE_UPDATERS=OFF \
-D FOUNDATION_BUILD=OFF \
-D KRITA_ENABLE_PCH=OFF \
-D BUILD_KRITA_QT_DESIGNER_PLUGINS=OFF \
-D USE_EXTERNAL_RAQM=OFF \
-D KRITA_QT_HAS_ENTER_LEAVE_PATCH=OFF \
-D KRITA_QT_HAS_UNBALANCED_KEY_PRESS_RELEASE_PATCH=OFF \
-D KRITA_QT_HAS_UPDATE_COMPRESSION_PATCH=OFF \
-D KRITA_USE_SURFACE_COLOR_MANAGEMENT_API=ON \
-D KF_SKIP_PO_PROCESSING=ON \
-D CMAKE_REQUIRE_FIND_PACKAGE_Qt6WaylandClient=ON \
-D CMAKE_REQUIRE_FIND_PACKAGE_Qt6Quick=ON \
-D CMAKE_REQUIRE_FIND_PACKAGE_Qt6QuickWidgets=ON \
-D CMAKE_REQUIRE_FIND_PACKAGE_Qt6QuickControls2=ON \
-D CMAKE_REQUIRE_FIND_PACKAGE_Qt6DBus=ON \
-D CMAKE_REQUIRE_FIND_PACKAGE_KF6Crash=ON \
-D CMAKE_REQUIRE_FIND_PACKAGE_PythonLibrary=ON \
-D CMAKE_REQUIRE_FIND_PACKAGE_SIP=ON \
-D CMAKE_REQUIRE_FIND_PACKAGE_PyQt6=ON \
-D CMAKE_REQUIRE_FIND_PACKAGE_GSL=ON \
-D CMAKE_REQUIRE_FIND_PACKAGE_KSeExpr=ON \
-D CMAKE_REQUIRE_FIND_PACKAGE_OpenEXR=ON \
-D CMAKE_REQUIRE_FIND_PACKAGE_TIFF=ON \
-D CMAKE_REQUIRE_FIND_PACKAGE_JPEG=ON \
-D CMAKE_REQUIRE_FIND_PACKAGE_GIF=ON \
-D CMAKE_REQUIRE_FIND_PACKAGE_HEIF=ON \
-D CMAKE_REQUIRE_FIND_PACKAGE_OpenJPEG=ON \
-D CMAKE_REQUIRE_FIND_PACKAGE_JPEGXL=ON \
-D CMAKE_REQUIRE_FIND_PACKAGE_FFTW3=ON \
-D CMAKE_REQUIRE_FIND_PACKAGE_OpenColorIO=ON \
-D CMAKE_REQUIRE_FIND_PACKAGE_Mlt7=ON \
-D CMAKE_REQUIRE_FIND_PACKAGE_LibMyPaint=ON \
-D CMAKE_REQUIRE_FIND_PACKAGE_Poppler=ON \
-D CMAKE_REQUIRE_FIND_PACKAGE_KDcrawQt6=ON \
-Wno-dev
grep -q '^build cmake_object_order_depends_target_kritawebpimport:' build/build.ninja
grep -qx '#define HAVE_JPEG_TURBO 1' build/config-jpeg.h
cmake --build build
DESTDIR=$PKG cmake --install build
rm -f "$PKG"/usr/share/applications/krita_*.desktop
cat > "$PKG/usr/share/applications/org.kde.krita.desktop" <<'EOF'
[Desktop Entry]
Type=Application
Name=Krita
GenericName=Digital Painting
Comment=Paint, illustrate and animate
Exec=krita %F
Icon=krita
Terminal=false
StartupNotify=true
StartupWMClass=org.kde.krita
MimeType=application/x-krita;
Categories=Qt;KDE;Graphics;2DGraphics;RasterGraphics;
Keywords=paint;painting;drawing;illustration;sketch;animation;brush;tablet;
EOF
chmod 644 "$PKG/usr/share/applications/org.kde.krita.desktop"
install -d "$PKG/etc/xdg"
cat > "$PKG/etc/xdg/kritarc" <<'EOF2'
defaultExportMimeType=image/png
EOF2
chmod 644 "$PKG/etc/xdg/kritarc"
The switches, and why each is set:
-D BUILD_WITH_QT6=ON— Builds against Qt 6 and KF6. Without it the project looks for Qt 5.-D ALLOW_UNSTABLE=QT6— Upstream marks the Qt 6 build unstable, and configure stops unless this list namesQT6. Upstream also counts every Qt 6 build as a development build, so the splash carries the beta mark and the welcome page shows “DEV BUILD”; no switch removes them.-D KDE_INSTALL_USE_QT_SYS_PATHS=ON,-D KDE_INSTALL_LIBDIR=lib— The install layout every KDE application here shares (see A graphical application).-D ENABLE_UPDATERS=OFF— Removes the check for new releases and its notification, which are on by default.-D FOUNDATION_BUILD=OFF,-D KRITA_ENABLE_PCH=OFF,-D BUILD_KRITA_QT_DESIGNER_PLUGINS=OFF— Upstream’s defaults, named: an ordinary system install rather than the Krita Foundation’s binary release with its extra bundled resources, no precompiled headers, and no Qt Designer plugins for Krita’s widgets.-D USE_EXTERNAL_RAQM=OFF— Builds the copy of Raqm, the text-layout library, that Krita carries, rather than fetching one from the network at configure time; upstream’s default, named.-D KRITA_QT_HAS_ENTER_LEAVE_PATCH=OFF,-D KRITA_QT_HAS_UNBALANCED_KEY_PRESS_RELEASE_PATCH=OFF,-D KRITA_QT_HAS_UPDATE_COMPRESSION_PATCH=OFF— Each names a patch that Krita’s own build of Qt carries and the tree’s qt6-qtbase does not. Krita probes the Qt headers for each; namedOFF, the answer is pinned. Off, Krita keeps its own workarounds for unbalanced enter and leave events and for unbalanced key presses and releases in non-Latin layouts, and draws the canvas without limiting its updates to the display’s frame rate. SetONagainst this Qt, those events would go unhandled.-D KRITA_USE_SURFACE_COLOR_MANAGEMENT_API=ON— Gives the canvas its own colour space through the per-surface colour-management API. Its Wayland client for thecolor-management-v1protocol generates its code from the protocol XML in the tarball. The default is on whenever Qt’s Wayland client is found;-D CMAKE_REQUIRE_FIND_PACKAGE_Qt6WaylandClient=ONmakes that certain.-D KF_SKIP_PO_PROCESSING=ON— Builds none of the translations; the image is English only (see Size and language policy).-D CMAKE_REQUIRE_FIND_PACKAGE_Qt6WaylandClient=ON,-D CMAKE_REQUIRE_FIND_PACKAGE_Qt6Quick=ON,-D CMAKE_REQUIRE_FIND_PACKAGE_Qt6QuickWidgets=ON,-D CMAKE_REQUIRE_FIND_PACKAGE_Qt6QuickControls2=ON,-D CMAKE_REQUIRE_FIND_PACKAGE_Qt6DBus=ON,-D CMAKE_REQUIRE_FIND_PACKAGE_KF6Crash=ON— Require the Qt and KDE parts Krita otherwise uses only when present: the Wayland platform plugin, the QML-based touch dockers, D-Bus, and KCrash.-D CMAKE_REQUIRE_FIND_PACKAGE_PythonLibrary=ON,-D CMAKE_REQUIRE_FIND_PACKAGE_SIP=ON,-D CMAKE_REQUIRE_FIND_PACKAGE_PyQt6=ON— Require the Python plugin host and the scripts that ship with it, built through python3-sip against python3-pyqt6.-D CMAKE_REQUIRE_FIND_PACKAGE_GSL=ON,-D CMAKE_REQUIRE_FIND_PACKAGE_KSeExpr=ON,-D CMAKE_REQUIRE_FIND_PACKAGE_FFTW3=ON,-D CMAKE_REQUIRE_FIND_PACKAGE_OpenColorIO=ON,-D CMAKE_REQUIRE_FIND_PACKAGE_LibMyPaint=ON— Require the libraries behind filters, layers and engines: GSL, the SeExpr fill layer through kseexpr, FFTW, the OpenColorIO display filter, and the MyPaint brush engine through libmypaint.-D CMAKE_REQUIRE_FIND_PACKAGE_OpenEXR=ON,-D CMAKE_REQUIRE_FIND_PACKAGE_TIFF=ON,-D CMAKE_REQUIRE_FIND_PACKAGE_JPEG=ON,-D CMAKE_REQUIRE_FIND_PACKAGE_GIF=ON,-D CMAKE_REQUIRE_FIND_PACKAGE_HEIF=ON,-D CMAKE_REQUIRE_FIND_PACKAGE_OpenJPEG=ON,-D CMAKE_REQUIRE_FIND_PACKAGE_JPEGXL=ON,-D CMAKE_REQUIRE_FIND_PACKAGE_Poppler=ON,-D CMAKE_REQUIRE_FIND_PACKAGE_KDcrawQt6=ON— Require the libraries behind file formats: EXR, TIFF, JPEG, GIF, HEIF and AVIF, JPEG 2000, JPEG XL, PDF import through poppler’s Qt 6 binding, and camera raw import through libkdcraw.-D CMAKE_REQUIRE_FIND_PACKAGE_Mlt7=ON— Requires mlt, which plays the audio track of an animation, with SDL2 for its output.
Every one of these finds is optional upstream, and a missing library builds a Krita without that format, filter or engine, saying so only in the configure summary. Required, a missing port stops configure instead (see A graphical application).
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/krita, 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 krita-6.0.4-3.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/krita, and runs the triggers its paths call for.
Contents
Installed programs: krita, krita_version, kritarunner.
Installed libraries: libkritabasicflakes.so, libkritacommand.so, libkritaexifcommon.so, libkritaflake.so, libkritaglobal.so, libkritaimage.so, libkritaimpex.so, libkritalibbrush.so, libkritalibkis.so, libkritalibkra.so, libkritalibpaintop.so, libkritametadata.so, libkritamultiarch.so, libkritapigment.so, libkritaplugin.so, libkritapsd.so, libkritapsdutils.so, libkritaqmicinterface.so, libkritaqmlwidgets.so, libkritaresources.so, libkritaresourcewidgets.so, libkritastore.so, libkritasurfacecolormanagementapi.so, libkritatiffpsd.so, libkritaui.so, libkritaversion.so, libkritawidgets.so, libkritawidgetutils.so.
Installed directories: /usr/lib/krita-python-libs, /usr/lib/kritaplugins, /usr/lib/qt6/qml/org/krita, /usr/share/color/icc/krita, /usr/share/icons/hicolor/1024x1024/mimetypes, /usr/share/krita, /usr/share/kritaplugins, /usr/share/licenses/krita.
Notes
WebP and libjpeg-turbo cannot be required the same way. A requirement also applies to the config-package search each of Krita’s find modules makes first, and both fail it with the library present: the config files of libwebp and libjpeg-turbo reject the components the module asks for (demux and mux; turbojpeg), which they define no result for and which the module marks found only after the search has returned. Unrequired, that search fails quietly and the module finds the library another way. As in A requirement a find module misreads, the two grep lines after configure check for them in the generated build instead: the WebP import filter’s target in build.ninja, and HAVE_JPEG_TURBO in config-jpeg.h.
0001-fftw-use-pkgconfig.patch comments out the config-package search in cmake/modules/FindFFTW3.cmake, so the module finds FFTW through pkg-config: the FFTW autotools install writes an FFTW3Config.cmake that names targets it never defines, and Krita’s find module would take that file first and fail.
Each import filter installs a hidden desktop entry claiming its format, image/png, image/jpeg and the rest, which would make Krita a second handler for every common picture type. build.sh removes those krita_*.desktop files and replaces the main entry with one that claims only Krita’s own document type, application/x-krita; the brush-preset type upstream’s entry names is not in the MIME database. QGuiApplication::setDesktopFileName makes the Wayland app_id org.kde.krita, which the entry names as StartupWMClass; under Xwayland the window class is krita.
build.sh installs /etc/xdg/kritarc, the system layer under each user’s ~/.config/kritarc, with one key in its unnamed top group, the one Krita’s own settings are read from: defaultExportMimeType=image/png, the File Handling page’s default export type. Unset, File > Export opens the KDE file dialog on “All supported formats” with Krita’s own .kra as the extension to add, and a name typed as picture.png is written as picture.png.kra. With PNG preselected, the name keeps its extension and the PNG options follow. A user who picks another default in Settings overrides it in their own file.