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

280.1. python3-pyqt6-6.11.0

Python bindings for Qt 6, which Calibre, Anki, QGIS, Picard and git-cola are written in

Version 6.11.0, release 3
Shelf python-gui — python3-* GUI toolkit, desktop and D-Bus bindings
Phase 43_toolkits (Toolkits), 126 of 344 in build order
Licence GPL-3.0-only
Homepage https://www.riverbankcomputing.com/software/pyqt/
Build time 33.7 SBU
Installed size 33.1 MiB in 884 files
Recipe ports/core/python-gui/python3-pyqt6/kpkgbuild

About

PyQt6 is Riverbank’s set of Python bindings for Qt 6: one extension module per Qt module, PyQt6.QtCore, PyQt6.QtWidgets and the rest, generated by SIP and built by PyQt-builder. Calibre, Picard, Spyder and the other Python applications written in Qt 6 import it. The bindings for Qt WebEngine are the separate python3-pyqt6-webengine port.

The package also carries the pyuic6 and pylupdate6 tools, the Qt Designer plugin that lets Designer load widgets written in Python, the qmlscene plugin that lets QML import types written in Python, and the dbus.mainloop.pyqt6 module, which runs dbus-python on Qt’s event loop.

Why it is in KDOS

The comment above it in script/phases/43_toolkits/packages.d/python-gui.txt:

PyQt6, with its sip and builder: Calibre, Picard and Spyder import it.

Sources

Dependencies

Depends on: python3, python3-sip, python3-pyqt-builder, python3-pyqt6-sip, python3-dbus, dbus, pkgconf, qt6-qtbase, qt6-qtdeclarative, qt6-qtsvg, qt6-qttools, qt6-qtmultimedia, qt6-qtspeech, qt6-qtwebchannel, qt6-qtwebsockets, qt6-qtpositioning, qt6-qtserialport, qt6-qtsensors, qt6-qtquick3d, qt6-qtremoteobjects, qt6-qtscxml, qt6-qtconnectivity.

Required by (15): calibre, cura, git-cola, kajongg, krita, picard, python3-pyqt6-webengine, python3-qscintilla, python3-qtpy, qgis, qutebrowser, spyder, uranium, urh, veusz.

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/43_toolkits/phase.env && kpkg install python3-pyqt6'

What kpkg does

kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/python-gui/python3-pyqt6.

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/python-gui/python3-pyqt6
echo '45dd60aa69976de1918b5ced6b4e7b6a25abd2a919ecef5fd5826ecc76718889  python3-pyqt6-6.11.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/python3-pyqt6
SRC=$SRC_ROOT/python3-pyqt6-6.11.0
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf python3-pyqt6-6.11.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:

patch -p1 -i "$PORT_SRC/qt612-edit-focus.patch"

sip-build \
	--confirm-license \
	--qmake /usr/lib/qt6/bin/qmake \
	--qmake-setting "QMAKE_CFLAGS_RELEASE = $CFLAGS" \
	--qmake-setting "QMAKE_CXXFLAGS_RELEASE = $CXXFLAGS" \
	--qmake-setting "QMAKE_LFLAGS_RELEASE = $LDFLAGS" \
	--qmake-setting "QMAKE_RPATHDIR =" \
	--api-dir /usr/share/qt6/qsci/api/python \
	--disable QtPdf \
	--disable QtPdfWidgets \
	--build-dir build \
	--no-make \
	--verbose
make -C build
make -C build -j1 INSTALL_ROOT="$PKG" install
site=$(find "$PKG"/usr/lib -maxdepth 2 -type d -name site-packages)
for m in QtCore QtGui QtWidgets QtDBus QtNetwork QtQml QtQuick QtSvg QtOpenGL \
	QtMultimedia QtTextToSpeech QtWebChannel QtWebSockets QtPositioning \
	QtSerialPort QtSensors QtQuick3D QtRemoteObjects QtDesigner QtHelp \
	QtStateMachine QtSpatialAudio QtBluetooth QtNfc; do
	test -n "$(find "$site/PyQt6" -maxdepth 1 -name "$m.*.so")"
done
test -n "$(find "$site/dbus/mainloop" -maxdepth 1 -name 'pyqt6.*.so')"

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/python3-pyqt6, 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 python3-pyqt6-6.11.0-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/python3-pyqt6, and runs the triggers its paths call for.

Contents

Installed programs: pylupdate6, pyuic6.

Installed directories: /usr/lib/python3.14/site-packages/PyQt6/__pycache__, /usr/lib/python3.14/site-packages/PyQt6/bindings/QtBluetooth, /usr/lib/python3.14/site-packages/PyQt6/bindings/QtCore, /usr/lib/python3.14/site-packages/PyQt6/bindings/QtDBus, /usr/lib/python3.14/site-packages/PyQt6/bindings/QtDesigner, /usr/lib/python3.14/site-packages/PyQt6/bindings/QtGui, /usr/lib/python3.14/site-packages/PyQt6/bindings/QtHelp, /usr/lib/python3.14/site-packages/PyQt6/bindings/QtMultimedia, /usr/lib/python3.14/site-packages/PyQt6/bindings/QtMultimediaWidgets, /usr/lib/python3.14/site-packages/PyQt6/bindings/QtNetwork, /usr/lib/python3.14/site-packages/PyQt6/bindings/QtNfc, /usr/lib/python3.14/site-packages/PyQt6/bindings/QtOpenGL, /usr/lib/python3.14/site-packages/PyQt6/bindings/QtOpenGLWidgets, /usr/lib/python3.14/site-packages/PyQt6/bindings/QtPositioning, /usr/lib/python3.14/site-packages/PyQt6/bindings/QtPrintSupport, /usr/lib/python3.14/site-packages/PyQt6/bindings/QtQml, /usr/lib/python3.14/site-packages/PyQt6/bindings/QtQuick, /usr/lib/python3.14/site-packages/PyQt6/bindings/QtQuick3D, /usr/lib/python3.14/site-packages/PyQt6/bindings/QtQuickWidgets, /usr/lib/python3.14/site-packages/PyQt6/bindings/QtRemoteObjects, /usr/lib/python3.14/site-packages/PyQt6/bindings/QtSensors, /usr/lib/python3.14/site-packages/PyQt6/bindings/QtSerialPort, /usr/lib/python3.14/site-packages/PyQt6/bindings/QtSpatialAudio, /usr/lib/python3.14/site-packages/PyQt6/bindings/QtSql, /usr/lib/python3.14/site-packages/PyQt6/bindings/QtStateMachine, /usr/lib/python3.14/site-packages/PyQt6/bindings/QtSvg, /usr/lib/python3.14/site-packages/PyQt6/bindings/QtSvgWidgets, /usr/lib/python3.14/site-packages/PyQt6/bindings/QtTest, /usr/lib/python3.14/site-packages/PyQt6/bindings/QtTextToSpeech, /usr/lib/python3.14/site-packages/PyQt6/bindings/QtWebChannel, /usr/lib/python3.14/site-packages/PyQt6/bindings/QtWebSockets, /usr/lib/python3.14/site-packages/PyQt6/bindings/QtWidgets, /usr/lib/python3.14/site-packages/PyQt6/bindings/QtXml, /usr/lib/python3.14/site-packages/PyQt6/lupdate, /usr/lib/python3.14/site-packages/PyQt6/uic, /usr/lib/python3.14/site-packages/pyqt6-6.11.0.dist-info, /usr/lib/qt6/plugins/PyQt6, /usr/share/licenses/python3-pyqt6.

Notes

sip-build runs a small configuration test for each Qt module and leaves out, without an error, the bindings of any module whose test fails. After the install, build.sh checks that each module the package is meant to carry, from QtCore to QtNfc, has its extension in site-packages/PyQt6, and that the dbus main-loop module is there; a Qt module missing from the build root stops the build instead of shipping a smaller PyQt6. Every Qt module checked is in depends for that reason.