254.29. python3-pyside6-6.12.0
PySide6 and Shiboken6, the official Qt 6 bindings for Python (FreeCAD's scripting GUI)
| Version | 6.12.0, release 1 |
| Shelf | qt6 — The Qt 6 modules, and everything in `group = qt6` |
| Phase | 43_toolkits (Toolkits), 309 of 344 in build order |
| Licence | (LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only) AND GPL-3.0-only WITH Qt-GPL-exception-1.0 |
| Homepage | https://doc.qt.io/qtforpython-6/ |
| Build time | 1.0 SBU |
| Installed size | 37.2 MiB in 428 files |
| Recipe | ports/core/qt6/python3-pyside6/kpkgbuild |
About
PySide6 is the Qt Company’s set of Python bindings for Qt 6, and Shiboken6 is the binding generator they are made with. The port builds both from one source tree: the PySide6 and shiboken6 Python packages, libpyside6 and libshiboken6, the shiboken6 generator, their headers, CMake packages and pkg-config files. In KDOS it is FreeCAD’s scripting interface, and Falkon’s Python plugin support (PyFalkon), which Falkon’s recipe makes required, is built against it.
Sources
python3-pyside6-6.12.0.tar.xz(17.4 MiB)
sha256099c1a597cf33c1b000e11cf68a0b82d216fb802bf81726efc720394f10c7751
upstream: https://download.qt.io/official_releases/QtForPython/pyside6/PySide6-6.12.0-src/pyside-setup-everywhere-src-6.12.0.tar.xz
archive copy: sources-4/qt6--python3-pyside6-6.12.0.tar.xz
Dependencies
Depends on: cmake, ninja, pkgconf, python3, python3-setuptools, numpy, clang, llvm, libxml2, libxslt, qt6-qtbase, qt6-qtsvg, qt6-qttools, qt6-qtwebchannel, qt6-qtwebengine.
Required by (2): falkon, freecad.
Patches
build.sh applies these; kpkg applies nothing by itself.
pc-dirs.patch— inpyside6.pc.in, makeslibdirabsolute (@LIB_INSTALL_DIR@is the relativelib) and pointsincludedirat/usr/include/PySide6, where the install step putslibpyside’s headers, instead of/usr/PySide6/include, which does not exist.pyi-build-tree-shiboken.patch— adds the build tree’ssourcesdirectory to the--sys-pathof the step that writes each module’s.pyistub. That step imports the module just built, and the module importsshiboken6, which upstream looks for in the installed site-packages; in a build of both packages from one tree,shiboken6is in the build tree’ssourcesdirectory and is not installed yet.
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-pyside6'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/qt6/python3-pyside6.
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/qt6/python3-pyside6
echo '099c1a597cf33c1b000e11cf68a0b82d216fb802bf81726efc720394f10c7751 python3-pyside6-6.12.0.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/python3-pyside6
SRC=$SRC_ROOT/python3-pyside6-6.12.0
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf python3-pyside6-6.12.0.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 recipe’s helpers group and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:
patch -p1 -i "$PORT_SRC/pyi-build-tree-shiboken.patch"
patch -p1 -i "$PORT_SRC/pc-dirs.patch"
export LLVM_INSTALL_DIR=/usr
_numpy=$(python3 -c 'import numpy; print(numpy.get_include())')
mkdir -p build && cd build
cmake .. -G Ninja -Wno-dev \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_SKIP_INSTALL_RPATH=ON \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_TESTS=OFF \
-DNO_QT_TOOLS=yes \
-DPython_EXECUTABLE=/usr/bin/python3 \
-DNUMPY_INCLUDE_DIR="$_numpy" \
-DSHIBOKEN_PYTHON_LIBRARIES="$(pkg-config --libs python3-embed)" \
-DMODULES="Core;Gui;Widgets;Network;Xml;Concurrent;DBus;Sql;Test;PrintSupport;OpenGL;OpenGLWidgets;Svg;SvgWidgets;UiTools;WebChannel;WebEngineCore;WebEngineWidgets"
PYTHONPATH="$PWD/sources" ninja
DESTDIR=$PKG ninja install
install -Dm644 -t "$PKG/usr/lib/cmake/PySide6" \
sources/pyside6/libpyside/PySide6Config.abi3.cmake
site=$(python3 -c 'import sysconfig; print(sysconfig.get_path("platlib"))')
install -d "$PKG$site/PySide6/scripts"
for f in "$PKG"/usr/bin/*.py "$PKG"/usr/bin/*_lib "$PKG"/usr/bin/requirements-android.txt; do
[ -e "$f" ] || continue
mv "$f" "$PKG$site/PySide6/scripts/"
done
The switches, and why each is set:
-DMODULES— the list of Qt modules to generate bindings for. Left unset, upstream builds every essential module and every optional one it finds installed; named, every module in the list is required. The list is fixed so that the set of bindings does not grow or shrink with whichever Qt modules happen to be installed when the port is built. It holds what FreeCAD imports, the rest of qtbase,WebEngineCoreandWebEngineWidgets, whose typesystems Falkon’sPyFalkonplugin loads, andWebChannel, which upstream’sWebEngineCorebinding depends on; the matching Qt ports are independs.-DNO_QT_TOOLS=yes— stop pyside-tools from copying Qt’s ownuic,rcc,designer,lupdate,qmllintand the other Qt programs into/usr/binbeside itspyside6-*wrappers. Those programs are installed by qt6-qtbase and qt6-qttools.-DNUMPY_INCLUDE_DIR— the directory of numpy’s C headers, read from the installed numpy. With it,libshibokenis compiled withHAVE_NUMPYand can convert numpy arrays; without it, CMake reports “NUMPY not found” and builds without that support.-DSHIBOKEN_PYTHON_LIBRARIES— the librarieslibshibokenlinks for the Python C API, herepkg-config --libs python3-embed, the flags forlibpython. Upstream leaves it empty except on Windows, and empty, the Python symbols are resolved from the interpreter that loads the module; set,libshibokenand everything linked to it carries a dependency onlibpython.-DBUILD_TESTS=OFF— skip shiboken’s and PySide’s test suites, which upstream builds by default.-DCMAKE_SKIP_INSTALL_RPATH=ON— install the libraries and modules without the run path upstream sets, which names$ORIGIN, the Qt library directory and theshiboken6package directory. Everything they link is in/usr/lib.-DPython_EXECUTABLE=/usr/bin/python3— the interpreter CMake’sFindPythonuses, named rather than searched for, so the modules are built for the tree’s Python.
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-pyside6, 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-pyside6-6.12.0-1.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-pyside6, and runs the triggers its paths call for.
Contents
Installed programs: requirements-ios.txt, shiboken6.
Installed libraries: libpyside6.abi3.so, libpyside6qml.abi3.so, libpyside6remoteobjects.a, libshiboken6.abi3.so.
Installed directories: /usr/include/PySide6, /usr/include/shiboken6, /usr/lib/cmake/PySide6, /usr/lib/cmake/Shiboken6, /usr/lib/cmake/Shiboken6Tools, /usr/lib/python3.14/site-packages/PySide6, /usr/lib/python3.14/site-packages/shiboken6, /usr/lib/python3.14/site-packages/shiboken6_generator, /usr/share/PySide6, /usr/share/licenses/python3-pyside6.
Short descriptions
pyside6.pc |
Support library for Python bindings of Qt5-based libraries. |
shiboken6.pc |
Support library for Python bindings created with the Shiboken6 generator. |
Notes
LLVM_INSTALL_DIR=/usr is read from the environment by the shiboken6_generator CMake project, which puts it first on CMAKE_PREFIX_PATH to find libclang, the parser the generator reads Qt’s headers with. The shiboken6 generator is the one file of the package that links libclang, and facet_dev = usr/bin/shiboken6 puts it in the development facet: the run-time bindings (libpyside6, libshiboken6 and the Python modules) load no clang, so the package’s measured run-time needs, and its binhost N: line, name no clang, and a prebuilt Falkon or FreeCAD does not install the compiler. A prebuilt machine that generates bindings needs both halves: kdos update install --dev python3-pyside6 restores the generator and kdos update install clang the libclang it loads, without which it does not start; a source build of a port that depends on PySide6 installs both, as it installs every declared dependency. ninja runs with PYTHONPATH set to the build tree’s sources directory for the same reason as the .pyi patch: the build imports the shiboken6 package it has just built.
The install step puts a PySide6Config.abi3.cmake in /usr/lib/cmake/PySide6 that computes the PySide6 package, typesystem and glue directories relative to its own location. build.sh installs the copy configured in the build tree over it, which spells the same three directories as absolute paths under /usr. A CMake project using find_package(PySide6) (Falkon is one) reads PYSIDE_TYPESYSTEMS and PYSIDE_GLUE from this file to find the typesystems under /usr/share/PySide6.
pyside-tools installs its deployment scripts, deploy.py, project.py and the rest, with their _lib directories, straight into /usr/bin. build.sh moves them into the scripts directory of the PySide6 package, so that generic names such as project.py are not commands on the PATH.