This extension helps you snap desktop applications that use Qt5 and/or KDE Frameworks.
How to use it
Add extensions: [kde-neon] to the application definition in your snapcraft.yaml file. See QT5 and KDE Frameworks applications for a complete tutorial on how to use this extension.
If you are using core18 as a base and your application needs access to the Qt5 and KDE Frameworks development tools, add kde-frameworks-5-core18-sdk to the build-snaps of the part that builds your application (this action is not required when using core20 as a base).
What it does
It makes the latest Qt5 and KDE Frameworks libraries available to your application at run time.
It initialises Qt5 and the desktop environment before your application starts so functionality like fonts, cursor themes and a11y work correctly.
To do this, it connects each application to the following content snaps at run time.
For a complete picture of what this extension does, add it to your app definition and run snapcraft expand-extensions.
Snapcraft extensions enable snap developers to easily incorporate a set of common requirements into a snap. See Snapcraft extensions for further details.
A notable observation: the kde-frameworks-5-core18 snap ships the KDE Plasma platform theme. The developer may want to prevent loading said theme by setting QT_QPA_PLATFORMTHEME to something not kde for whatever reason, e.g. an incompatibility with the application.
However, the KDE Plasma platform theme will still be loaded if the snap’s being run in a KDE session. The env variables XDG_CURRENT_DESKTOP and KDE_FULL_SESSION affect whether this platform theme is loaded.
A possible solution is to incorporate a wrapper script that unsets said env vars:
if [ ! -z "$KDE_FULL_SESSION" ]; then
unset KDE_FULL_SESSION
fi
if echo "$XDG_CURRENT_DESKTOP" | grep -q KDE; then
unset XDG_CURRENT_DESKTOP
fi
This does not seem to work on arm64, I suppose because the required kde-frameworks-5-core18 snap is not available on arm64. I filed a bug to note this: https://bugs.launchpad.net/snapcraft/+bug/1881963
Please note: Core18 and Core20 is not supported. Until we find a way / manpower to support multiple bases, this is the way of it. Also our current supported setup is core22 -> kf5-5-108-qt-5-15-10-core22-sdk
Using the kde-neon extension seems to prevent QtCharts from being found by cmake. Any idea why?
I have libqt5charts5-dev as a build-package, and it’s found when I build the snap without the kde-neon extension. (i.e. only change is adding kde-neon as an extension). Is there an additional build-snap needed for QtCharts?
I’ve tried various combinations of -DQt5_DIR and -DQt5Charts_DIR (Also needed to use -DQt5Gamepad_DIR and DQt5TextToSpeech_DIR as they appear to be missing from the snap too), and although it can now build, I get various run-time problems (Missing symbols, GL driver loader failures, WebEngine resources missing) depending the options used and what files I strip from the application’s snap.
Will see if I can just use the desktop-launch script from the snap, without the rest.
This is for a build that seems to mostly work, without using kde-neon extension. For the kde-neon version, see the commented lines - and I’d also remove the qt build/stage packages.
I found that I needed to use layout in the .yaml to overlay the qt5 directories, rather than use environment variables and a qt.conf as in the kde-neon desktop-launch script. With the latter, Qt WebEngine would crash, not being able to find resources. It just seemed to ignore QTWEBENGINE_RESOURCES_PATH, regardless of what it was set to.
Also, Qt location isn’t working. I get ‘org.freedesktop.DBus.Error.AccessDeniedAn AppArmor policy prevents this sender from sending this message to this recipient; to’ … ‘org.freedesktop.GeoClue2.Manager’. I have location-observe plug, but ‘snap connect sdrangel:location-observe’ gives ‘error: snap “snapd” has no “location-observe” interface slots’