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

280.2. python3-wxpython-4.2.5

The wxWidgets GTK 3 toolkit for Python programs such as CHIRP and Pronterface

Version 4.2.5, release 2
Shelf python-gui — python3-* GUI toolkit, desktop and D-Bus bindings
Phase 43_toolkits (Toolkits), 264 of 344 in build order
Licence LGPL-2.0-or-later WITH WxWindows-exception-3.1
Homepage https://wxpython.org/
Build time 28.6 SBU
Installed size 58.5 MiB in 743 files
Recipe ports/core/python-gui/python3-wxpython/kpkgbuild

About

wxPython is the Python binding of wxWidgets, the wx package, built here against the tree’s GTK 3 wxWidgets rather than a copy of its own. Python programs written in wx import it; in the tree, CHIRP and KiCad depend on it. The binding’s C++ sources, generated by SIP, ship in the release archive under sip/cpp, so the build compiles them and runs no SIP. The SVG module wx.svg._nanosvg ships only as Cython source, which python3-cython translates during the build.

Sources

Dependencies

Depends on: python3, python3-setuptools, python3-cython, wxwidgets, gtk3, numpy, python3-pillow, python3-six.

Required by (2): chirp, kicad.

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

What kpkg does

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

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-wxpython
echo '44e836d1bccd99c38790bb034b6ecf70d9060f6734320560f7c4b0d006144793  python3-wxpython-4.2.5.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-wxpython
SRC=$SRC_ROOT/python3-wxpython-4.2.5
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf python3-wxpython-4.2.5.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 recipe’s helpers series and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:

export LDFLAGS="$LDFLAGS -Wl,--strip-debug"
patch -p1 -i "$PORT_SRC/no-stacktrace.patch"
python3 build.py build_py --use_syswx --gtk3 --release --jobs="$KDOS_JOBS"
python3 build.py install --use_syswx --gtk3 --release --destdir="$PKG" \
	--extra_setup="--prefix=/usr"
test -n "$(find "$PKG"/usr/lib/python3*/site-packages/wx -maxdepth 1 -name '_core.*.so')"
test -n "$(find "$PKG"/usr/lib/python3*/site-packages/wx/svg -maxdepth 1 -name '_nanosvg.*.so')"
test -z "$(readelf -S "$(find "$PKG"/usr/lib/python3*/site-packages/wx -maxdepth 1 -name '_core.*.so')" | grep '\.debug_info')"

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-wxpython, 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-wxpython-4.2.5-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-wxpython, and runs the triggers its paths call for.

Contents

Installed programs: helpviewer, img2png, img2py, img2xpm, pycrust, pyshell, pyslices, pyslicesshell, pywxrc, wxdemo, wxdocs, wxget.

Installed directories: /usr/lib/python3.14/site-packages/wx, /usr/lib/python3.14/site-packages/wxPython-4.2.5-py3.14.egg-info, /usr/share/licenses/python3-wxpython.

Notes

After the install, build.sh checks that the core extension wx/_core.*.so and the SVG module wx/svg/_nanosvg.*.so are in the package, so a build that skipped either fails rather than shipping a wx package that cannot be imported.