Hi. I have a PyQt5 snap. I works great on Ubuntu Desktop. I have been trying to run the snap on my Ubuntu Core for the last few days, but no luck till now.
Here is my snapcraft.yaml
name: cluemaster-mediadisplay
base: core20
version: '1.0.8'
summary: summary
description: description
grade: stable
confinement: strict
apps:
cluemaster-mediadisplay-daemon:
command: bin/run-daemon wayland-launch prepare-launch $SNAP/cluemaster_display
daemon: simple
restart-condition: always
plugs:
- home
- desktop-legacy
- desktop
- wayland
- x11
- unity7
- network
- opengl
- gsettings
- pulseaudio
- network-bind
- screen-inhibit-control
- audio-playback
- shutdown
- process-control
- mount-observe
- network-control
cluemaster-mediadisplay:
command: bin/run-daemon wayland-launch prepare-launch $SNAP/cluemaster_display
plugs:
- home
- desktop-legacy
- desktop
- wayland
- x11
- unity7
- network
- opengl
- gsettings
- pulseaudio
- network-bind
- screen-inhibit-control
- audio-playback
- shutdown
- process-control
- mount-observe
- network-control
environment:
QT_QPA_PLATFORM: wayland
QTCHOOSER_NO_GLOBAL_DIR: 1
QT_SELECT: snappy-qt5
parts:
copy-source-code:
plugin: dump
source: cluemaster_display/
stage-packages:
- ffmpeg
- locales
- libmpv1
- va-driver-all
- vdpau-driver-all
- mesa-va-drivers
- libvdpau-va-gl1
- libglu1-mesa
- samba-libs
- git
- python3-dbus
- qtwayland5
cluemaster-mediadisplay:
after: [copy-source-code]
plugin: python
python-packages:
- PyQt5==5.14.1
- requests==2.22.0
- git+https://github.com/hiransarkar21/python-mpv
- simplejson==3.16.0
stage-packages:
- python3-pyqt5
- python3-pyqt5.qtsvg
- python3-pyqt5.qtmultimedia
- python3-requests
- python3-simplejson
- python3
desktop-files-and-icons:
plugin: dump
source: snap/gui/
organize:
"cluemaster-mediadisplay.desktop": "usr/share/applications/"
"cluemaster-mediadisplay.png": "usr/share/applications/"
stage:
- usr/share/applications/cluemaster-mediadisplay.desktop
- usr/share/applications/cluemaster-mediadisplay.png
extras:
plugin: dump
source: static/
organize:
"prepare-launch": "bin/"
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
- dpkg-dev
stage-packages:
- 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
mir-kiosk-snap-launch:
plugin: dump
source: https://github.com/MirServer/mir-kiosk-snap-launch.git
override-build: |
echo "snapctl set app=rssnews" >> $SNAPCRAFT_PART_BUILD/meta/hooks/install
echo "[ -e \"\$SNAP/apps/\$(snapctl get app)\" ] || snapctl set app=rssnews" >> $SNAPCRAFT_PART_BUILD/meta/hooks/post-refresh
$SNAPCRAFT_PART_BUILD/build-with-plugs.sh network opengl wayland
stage-packages:
- inotify-tools
layout:
/usr/share/libdrm/amdgpu.ids:
symlink: $SNAP/usr/share/libdrm/amdgpu.ids
/etc/glvnd:
bind: $SNAP/etc/glvnd
/etc/fonts:
bind: $SNAP/etc/fonts
/etc/xdg:
bind: $SNAP/etc/xdg
/usr/share/X11/xkb:
bind: $SNAP/usr/share/X11/xkb
/usr/share/fonts:
bind: $SNAP/usr/share/fonts
/usr/share/glvnd:
bind: $SNAP/usr/share/glvnd
/usr/lib/${SNAPCRAFT_ARCH_TRIPLET}/qt5:
bind: $SNAP/usr/lib/${SNAPCRAFT_ARCH_TRIPLET}/qt5
The content of my prepare-launch script
#!/bin/sh
echo "Prepairing launch ..."
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH
export LD_LIBRARY_PATH="$SNAP/usr/lib/x86_64-linux-gnu/samba":$LD_LIBRARY_PATH
export PYTHONPATH="$SNAP/usr/lib/python3/dist-packages"
echo "Environment variables setup complete ..."
if [ ! -d "$SNAP_USER_DATA/.config/autostart" ];
then
mkdir -p $SNAP_USER_DATA/.config/autostart
ln -sfnt $SNAP_USER_DATA/.config/autostart/ $SNAP/usr/share/applications/cluemaster-mediadisplay.desktop
fi
exec "$@"
I installed the snap on my Ubuntu core but it shows nothing just a black.
Thanks in advance.