259.1. wxwidgets-3.2.9
wxWidgets on GTK 3 — the native-widget C++ toolkit under KiCad, PrusaSlicer, FileZilla, VeraCrypt and wxPython
| Version | 3.2.9, release 3 |
| Shelf | toolkits — Other GUI and TUI toolkits for applications |
| Phase | 43_toolkits (Toolkits), 263 of 344 in build order |
| Licence | LGPL-2.0-or-later WITH WxWindows-exception-3.1 |
| Homepage | https://www.wxwidgets.org/ |
| Build time | 0.8 SBU |
| Installed size | 31.8 MiB in 795 files |
| Recipe | ports/core/toolkits/wxwidgets/kpkgbuild |
About
wxWidgets is a C++ toolkit that draws each widget with the platform’s own: on Linux, GTK. This port builds it on GTK 3 as shared libraries, with the wx-config script, wxwin.m4 for autoconf projects and the CMake package. KiCad, PrusaSlicer, Audacity, Tenacity, FileZilla, VeraCrypt, OpenCPN and FreeDV are wx applications; it is for applications, and no part of the KDOS desktop links it (see Applications bring their own toolkit).
Why it is in KDOS
The comment above it in script/phases/43_toolkits/packages.d/toolkits.txt:
wxWidgets on GTK 3. KiCad, PrusaSlicer, Audacity, Tenacity, FileZilla, VeraCrypt, OpenCPN and FreeDV are wx applications.
Sources
wxwidgets-3.2.9.tar.bz2(26.1 MiB)
sha256fb90f9538bffd6a02edbf80037a0c14c2baf9f509feac8f76ab2a5e4321f112b
upstream: https://github.com/wxWidgets/wxWidgets/releases/download/v3.2.9/wxWidgets-3.2.9.tar.bz2
archive copy: sources-4/toolkits--wxwidgets-3.2.9.tar.bz2
Dependencies
Depends on: cmake, ninja, pkgconf, gtk3, glib, pango, cairo, gdk-pixbuf, harfbuzz, fontconfig, freetype2, libX11, libXext, libXtst, libxkbcommon, wayland, mesa, libglvnd, glu, webkitgtk, libsoup3, gstreamer, gst-plugins-base, gst-plugins-bad, libnotify, gspell, libsecret, sdl2-compat, curl, expat, libjpeg-turbo, libpng, libtiff, zlib, pcre2, xz, libmspack.
Required by (11): audacity, cubicsdr, filezilla, freedv-gui, kicad, limesuite-gui, opencpn, prusaslicer, python3-wxpython, tenacity, veracrypt.
Patches
build.sh applies these; kpkg applies nothing by itself.
largefile.patch— makesHAVE_LARGEFILE_SUPPORTan unconditional#define 1in CMake’ssetup.h.in. On Unixinit.cmakealready sets it wheneverwxBUILD_LARGEFILE_SUPPORTis on, which is upstream’s default and is not changed here, so the generatedsetup.hdiffers only if that option is turned off.musl-locale-l.patch— ininclude/wx/xlocale.h, definesstrtol_l,strtoul_l,wcstod_l,wcstol_landwcstoul_las the plain C calls without the locale argument when they are not macros. musl has none of the five.no-langinfo-h.patch— removes thelanginfo.hprobe and itsHAVE_LANGINFO_Hline from CMake’s setup, so wx compiles its locale code withoutnl_langinfo(): number separators come fromlocaleconv(), andwxLocale::GetInforeturns an empty string for the date and time formats.
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 wxwidgets'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/toolkits/wxwidgets.
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/toolkits/wxwidgets
echo 'fb90f9538bffd6a02edbf80037a0c14c2baf9f509feac8f76ab2a5e4321f112b wxwidgets-3.2.9.tar.bz2' | 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/wxwidgets
SRC=$SRC_ROOT/wxwidgets-3.2.9
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf wxwidgets-3.2.9.tar.bz2 -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:
patch -p1 -i "$PORT_SRC/largefile.patch"
patch -p1 -i "$PORT_SRC/musl-locale-l.patch"
patch -p1 -i "$PORT_SRC/no-langinfo-h.patch"
cmake -S . -B _build -G Ninja \
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR=lib \
-DwxBUILD_TOOLKIT=gtk3 \
-DwxBUILD_SHARED=ON \
-DwxBUILD_PRECOMP=OFF \
-DwxBUILD_TESTS=OFF \
-DwxBUILD_SAMPLES=OFF \
-DwxBUILD_DEMOS=OFF \
-DwxUSE_SYS_LIBS=ON \
-DwxUSE_REGEX=sys \
-DwxUSE_ZLIB=sys \
-DwxUSE_EXPAT=sys \
-DwxUSE_LIBJPEG=sys \
-DwxUSE_LIBPNG=sys \
-DwxUSE_LIBTIFF=sys \
-DwxUSE_LIBLZMA=ON \
-DwxUSE_OPENGL=ON \
-DwxUSE_GLCANVAS_EGL=ON \
-DwxUSE_GTKPRINT=ON \
-DwxUSE_PRIVATE_FONTS=ON \
-DwxUSE_WEBVIEW=ON \
-DwxUSE_WEBVIEW_WEBKIT=ON \
-DwxUSE_MEDIACTRL=ON \
-DwxUSE_SOUND=ON \
-DwxUSE_LIBSDL=ON \
-DwxUSE_LIBNOTIFY=ON \
-DwxUSE_SECRETSTORE=ON \
-DwxUSE_SPELLCHECK=ON \
-DwxUSE_LIBMSPACK=ON \
-DwxUSE_XTEST=ON \
-DwxUSE_WEBREQUEST_CURL=ON \
-DwxUSE_DETECT_SM=OFF \
-DwxUSE_LIBGNOMEVFS=OFF
ninja -C _build
DESTDIR=$PKG ninja -C _build install
install -Dm644 wxwin.m4 "$PKG/usr/share/aclocal/wxwin.m4"
for f in licence.txt lgpl.txt preamble.txt; do
install -Dm644 "docs/$f" "$PKG/usr/share/licenses/$name/$f"
done
for lib in webview gl media; do
test -e "$PKG/usr/lib/libwx_gtk3u_$lib-3.2.so"
done
test -e "$PKG/usr/lib/wx/3.2/web-extensions/webkit2_extu-3.2.so"
for sym in wxUSE_GLCANVAS_EGL wxUSE_LIBSDL wxUSE_LIBNOTIFY wxUSE_SECRETSTORE wxUSE_SPELLCHECK wxUSE_LIBMSPACK wxUSE_WEBREQUEST_CURL; do
grep -q "^#define $sym 1" "$PKG"/usr/lib/wx/include/gtk3-unicode-*/wx/setup.h
done
The switches, and why each is set:
-DwxBUILD_TOOLKIT=gtk3— the GTK 3 port of wx. It linkslibX11because GDK has an X11 backend, and runs on Wayland or X11 according to the display GDK opened.-DwxUSE_SYS_LIBS=ON— with-DwxUSE_REGEX=sys,-DwxUSE_ZLIB=sys,-DwxUSE_EXPAT=sys,-DwxUSE_LIBJPEG=sys,-DwxUSE_LIBPNG=sysand-DwxUSE_LIBTIFF=sys: use the installed pcre2, zlib, expat, libjpeg-turbo, libpng and libtiff instead of the copies wx carries insrc/and3rdparty/pcre.-DwxUSE_GLCANVAS_EGL=ON— with-DwxUSE_OPENGL=ON: buildwxGLCanvason EGL. The canvas is chosen when wx is compiled: the EGL one works on Wayland and on X11, the GLX one only on X11. configure turns this off without a message when it finds no EGL.-DwxUSE_WEBVIEW=ON— with-DwxUSE_WEBVIEW_WEBKIT=ON:wxWebViewon WebKitGTK’s 4.1 API; KiCad’s build requires thewebviewlibrary. CMake looks for 4.1 first and falls back to 4.0; the 4.1 API is the one built against libsoup3. On GTK 3 wx records the backend it found aswxUSE_WEBVIEW_WEBKIT2, andwxUSE_WEBVIEW_WEBKITis 0 in the installedsetup.h.-DwxUSE_MEDIACTRL=ON—wxMediaCtrlon GStreamer.-DwxUSE_SOUND=ON— with-DwxUSE_LIBSDL=ON:wxSoundplays through SDL, here sdl2-compat, which reaches PipeWire. wx’s other Unix sound backend is OSS on/dev/dsp, which exists only while the kernel’ssnd-pcm-ossmodule is loaded, and nothing in KDOS loads it.-DwxUSE_LIBNOTIFY=ON— notifications through libnotify.-DwxUSE_SECRETSTORE=ON—wxSecretStore, which keeps passwords, on libsecret.-DwxUSE_SPELLCHECK=ON— spell checking inwxTextCtrl, through gspell.-DwxUSE_LIBMSPACK=ON— read CHM help files with libmspack.-DwxUSE_WEBREQUEST_CURL=ON—wxWebRequeston curl.-DwxUSE_LIBLZMA=ON— LZMA compression streams, with xz’s liblzma.-DwxUSE_XTEST=ON—wxUIActionSimulator, which synthesises input; with GTK 3 it cannot work without the XTest extension (libXtst).-DwxUSE_GTKPRINT=ON— printing through GTK’s print dialog.-DwxUSE_PRIVATE_FONTS=ON— let an application load a font file it ships, through fontconfig and PangoFT2.-DwxUSE_LIBGNOMEVFS=OFF— no GNOME VFS for associating MIME types; GNOME VFS is not a port.-DwxUSE_DETECT_SM=OFF— no code that looks for an X11 session manager. Upstream’s default, named.-DwxBUILD_PRECOMP=OFF— compile without precompiled headers, which upstream uses by default.-DwxBUILD_SAMPLES=OFF— with-DwxBUILD_TESTS=OFFand-DwxBUILD_DEMOS=OFF: build only the libraries.
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/wxwidgets, 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 wxwidgets-3.2.9-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/wxwidgets, and runs the triggers its paths call for.
Contents
Installed programs: wx-config, wxrc, wxrc-3.2.
Installed libraries: libwx_baseu-3.2.so, libwx_baseu_net-3.2.so, libwx_baseu_xml-3.2.so, libwx_gtk3u_adv-3.2.so, libwx_gtk3u_aui-3.2.so, libwx_gtk3u_core-3.2.so, libwx_gtk3u_gl-3.2.so, libwx_gtk3u_html-3.2.so, libwx_gtk3u_media-3.2.so, libwx_gtk3u_propgrid-3.2.so, libwx_gtk3u_qa-3.2.so, libwx_gtk3u_ribbon-3.2.so, libwx_gtk3u_richtext-3.2.so, libwx_gtk3u_stc-3.2.so, libwx_gtk3u_webview-3.2.so, libwx_gtk3u_xrc-3.2.so.
Installed directories: /usr/include/wx-3.2, /usr/lib/cmake/wxWidgets-3.2, /usr/lib/wx, /usr/share/licenses/wxwidgets.
Notes
Naming an optional backend ON does not make configure require it. When a probe fails, configure turns the feature off and carries on, with a warning, a status line or no message at all; wxSecretStore is the one exception, and stops configure when libsecret is missing. The checks at the end of build.sh turn a lost backend into a failed build: the webview, GL and media libraries and the WebKit web extension must be installed, and setup.h must define each of wxUSE_GLCANVAS_EGL, wxUSE_LIBSDL, wxUSE_LIBNOTIFY, wxUSE_SECRETSTORE, wxUSE_SPELLCHECK, wxUSE_LIBMSPACK and wxUSE_WEBREQUEST_CURL as 1.
The source tree already has a build/ directory, holding wx’s own build systems, so the CMake build directory is _build.