I managed to build a snap of my Qt5/ QML user interface application which works on Ubuntu Desktop. I’m using the snapcraft-desktop-helpers according to these instructions. However, my goal is to run the user interface on Ubuntu Core connected to a touchscreen. I figured out that I need to use mir-kiosk and followed mainly Part 13 of the instructions.
However, I’m not sure how these two helpers are intended to work together - if at all. I’m assuming that the mir-kiosk-snap-launch is not configuring anything with the Qt5 dependencies. But on the other side the desktop-helpers are not setting anything with the wayland Mir interface.
Is mir-kiosk-snap-launch even intended to set the necessary Qt configurations/ paths? Or how should I proceed?
This is my snapcraft.yaml:
name: test
base: core18
version: '0.2'
summary: The Software
description: |
This snap includes the software to operate the high-level
control PC.
grade: devel
confinement: devmode
apps:
run:
command: wayland-launch roslaunch nav_gui gui.launch
run2:
command: wayland-launch bin/desktop-launch roslaunch nav_gui gui.launch
run3:
command: bin/desktop-launch roslaunch nav_gui gui.launch
run4:
command: bin/desktop-launch wayland-launch roslaunch nav_gui gui.launch
daemon:
command: run-daemon wayland-launch roslaunch nav_gui gui.launch
daemon: simple
restart-condition: always
rostopic:
command: rostopic
rosservice:
command: rosservice
plugs:
wayland:
parts:
desktop-qt5:
source: https://github.com/ubuntu/snapcraft-desktop-helpers.git
source-subdir: qt
plugin: make
make-parameters: ["FLAVOR=qt5"]
build-packages:
- build-essential
- qtbase5-dev
- qt5-default
- libqt5quick5
- qtdeclarative5-dev
- qtquickcontrols2-5-dev
- qtmultimedia5-dev
- dpkg-dev
stage-packages:
- libqt5qml5
- libqt5quick5
- libqt5quickcontrols2-5
- libqt5quicktemplates2-5
- qml-module-qtquick-layouts
- qml-module-qtquick-controls
- qml-module-qtquick-controls2
- qml-module-qtmultimedia
- qml-module-qtquick-extras
- libxkbcommon0
- ttf-ubuntu-font-family
- dmz-cursor-theme
- light-themes
- adwaita-icon-theme
- gnome-themes-standard
- shared-mime-info
- libqt5gui5
- libgdk-pixbuf2.0-0
- libqt5svg5 # for loading icon themes which are svg
- try: [appmenu-qt5] # not available on core18
- locales-all
- xdg-user-dirs
- fcitx-frontend-qt5
workspace:
plugin: catkin-tools
source: .
rosinstall-files: [snap/local/snap.rosinstall]
recursive-rosinstall: true
catkin-packages: [catkin_simple, nav_gui]
build-packages: [git]
after: [desktop-qt5]
mir-kiosk-snap-launch:
plugin: dump
source: https://github.com/MirServer/mir-kiosk-snap-launch.git
override-build: $SNAPCRAFT_PART_BUILD/build-with-plugs.sh wayland
Reduced to the relevant parts of the errors, this is what I get in the different situations with this snapcraft.yaml:
-
bin/desktop-launch
works on Ubuntu Desktop, but on Core for obvious reasons:
qt.qpa.screen: QXcbConnection: Could not connect to display
Could not connect to any X display.
-
wayland-launch
on Core:
+ [ ! -O /run/user/1000/wayland-0 ]
+ echo waiting for Wayland socket
waiting for Wayland socket
-
run-daemon wayland-launch
on Core:
Jan 09 15:32:37 localhost test.daemon[10788]: This application failed to start because it could not find or load the Qt platform plugin "xcb"
Jan 09 15:32:37 localhost test.daemon[10788]: in "".
-
bin/desktop-launch wayland-launch
on Core:
+ [ ! -O /run/user/1000/wayland-0 ]
+ echo waiting for Wayland socket
waiting for Wayland socket
Can you please point me in the right direction?