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

280.5. python3-pyqt5-5.15.11

Python bindings for Qt 5, which GNU Radio's gr-qtgui and the Qt 5 Python tools are written in

Version 5.15.11, release 2
Shelf python-gui — python3-* GUI toolkit, desktop and D-Bus bindings
Phase 43_toolkits (Toolkits), 274 of 344 in build order
Licence GPL-3.0-only
Homepage https://www.riverbankcomputing.com/software/pyqt/
Build time 25.2 SBU
Installed size 28.9 MiB in 774 files
Recipe ports/core/python-gui/python3-pyqt5/kpkgbuild

About

PyQt5 is Riverbank’s set of Python bindings for Qt 5: one extension module per Qt 5 module, PyQt5.QtCore, PyQt5.QtWidgets and the rest, generated by SIP and built by PyQt-builder. In the tree, GNU Radio, gr-osmosdr and pyqtgraph depend on it. The package also carries pyuic5, pyrcc5 and pylupdate5, the Qt Designer plugin for widgets written in Python, the qmlscene plugin that lets QML import types written in Python, and the dbus.mainloop.pyqt5 module, which runs dbus-python on Qt’s event loop.

Sources

Dependencies

Depends on: python3, python3-sip, python3-pyqt-builder, python3-pyqt5-sip, python3-dbus, dbus, pkgconf, qt5-qtbase, qt5-qtdeclarative, qt5-qtsvg, qt5-qttools, qt5-qtmultimedia, qt5-qtserialport, qt5-qtwebsockets, qt5-qtx11extras.

Required by (3): gnuradio, gr-osmosdr, python3-pyqtgraph.

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

What kpkg does

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

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-pyqt5
echo 'fda45743ebb4a27b4b1a51c6d8ef455c4c1b5d610c90d2934c7802b5c1557c52  python3-pyqt5-5.15.11.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-pyqt5
SRC=$SRC_ROOT/python3-pyqt5-5.15.11
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf python3-pyqt5-5.15.11.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/sip-minimum-abi.patch"

sip-build \
	--confirm-license \
	--qmake /usr/lib/qt5/bin/qmake \
	--api-dir /usr/share/qt5/qsci/api/python \
	--disable QtBluetooth \
	--disable QtNfc \
	--disable QtLocation \
	--disable QtPositioning \
	--disable QtSensors \
	--disable QtWebChannel \
	--disable QtRemoteObjects \
	--disable QtTextToSpeech \
	--disable QtXmlPatterns \
	--disable QtQuick3D \
	--disable QtWebKit \
	--disable QtWebKitWidgets \
	--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 QtOpenGL QtPrintSupport \
	QtQml QtQuick QtQuickWidgets QtSvg QtMultimedia QtMultimediaWidgets \
	QtSerialPort QtWebSockets QtX11Extras QtDesigner QtHelp QtSql QtTest \
	QtXml; do
	test -n "$(find "$site/PyQt5" -maxdepth 1 -name "$m.*.so")"
done
test -n "$(find "$site/dbus/mainloop" -maxdepth 1 -name 'pyqt5.*.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-pyqt5, 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-pyqt5-5.15.11-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/python3-pyqt5, and runs the triggers its paths call for.

Contents

Installed programs: pylupdate5, pyrcc5, pyuic5.

Installed directories: /usr/lib/python3.14/site-packages/PyQt5/__pycache__, /usr/lib/python3.14/site-packages/PyQt5/bindings, /usr/lib/python3.14/site-packages/PyQt5/uic, /usr/lib/python3.14/site-packages/pyqt5-5.15.11.dist-info, /usr/lib/qt5/plugins/PyQt5, /usr/share/licenses/python3-pyqt5, /usr/share/qt5/qsci.

Notes

No --qmake-setting for the compiler flags is needed here, unlike python3-pyqt6: Qt 5’s mkspecs read CFLAGS, CXXFLAGS and LDFLAGS from the environment through a patch of qt5-qtbase’s, and Qt 5 is built with no RPATH.

sip-build leaves out, without an error, the bindings of any Qt module whose configuration test fails. After the install, build.sh checks that each module the package is meant to carry, from QtCore to QtXml, has its extension in site-packages/PyQt5, and that the dbus main-loop module is there; every Qt 5 module checked is in depends for that reason.