I am currently trying to bundle my app DaKanji as a snap with snapcraft.
I am using python and PySide2 as GUI library.
However on Ubuntu 20.4 PySide2 does not run out of the box and
sudo apt-get install -y libxcb-xinerama0
needs to be invoked to make it run.
I am now wondering if it is possible to bundle this in the snap somehow.
I tried adding it to
This did not help and the app does not run as a snap.
I am also missing a lot of libraries which I am not sure how to add: This part is missing libraries that cannot be satisfied with any available stage-packages known to snapcraft:
Maybe someone here can point me in the right direction.
I tried to add the plugs used in this application however that also didn’t change the error message.
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb.
Aborted (core dumped)
@futuretim Do you maybe know of any snap (with an available snapcraft.yaml) which uses pyside2?
name: dakanji # you probably want to 'snapcraft register <name>'
base: core20 # the base snap is the execution environment for this snap
version: '1.2' # just for humans, typically '1.2+git' or '1.3.2'
summary: Draw a kanji with your mouse and open it in your dictionary of choice.
description: |
Did you ever try to read a Japanese text but did not know how to read some Kanji? This app can help you with exactly that.
Draw a Kanji and the app will convert it to a digital character.
You can than open that character in a dictionary of your choice or use it somewhere else.
This app works completely offline and no internet connection is needed for recognizing the characters.
Features:
* Recognize Kanji characters offline
* Use a web dictionary to translate characters
grade: devel # must be 'stable' to release into candidate/stable channels
confinement: devmode # use 'strict' once you have the right plugs and slots
parts:
copy-src:
plugin: dump
source: ./src
organize:
"*" : src/
dakanji:
source: .
plugin: python
requirements: ['requirements.txt']
stage-packages:
- libfreetype6
- libpng16-16
- libnss3
- libxcomposite1
- libxcursor1
- libxtst6
- libxrandr2
- libasound2
- libglu1-mesa
- libgles2-mesa
- fontconfig
- libxkbcommon0
- libxkbcommon-x11-0
- libxi6
- libegl1
- shared-mime-info
- libgdk-pixbuf2.0-0
- locales-all
- libxslt1.1
- xfonts-base
- xfonts-scalable
apps:
dakanji:
command: src/dakanji
plugs:
- desktop
I would consider myself as a noob regarding snapcraft and linux development in general. So I think I didn’t set any desktop-helper up.
python3: relocation error: /snap/dakanji/x1/kf5/usr/lib/x86_64-linux-gnu/qt5/qml/QtQuick/Controls.2/libqtquickcontrols2plugin.so: symbol _ZN13QQmlDirParserC1Ev version Qt_5_PRIVATE_API not defined in file libQt5Qml.so.5 with link time reference
This error does not help me at all.
Do you have an idea how to resolve this?
Is it not possible to include an package from apt in the snap?
I found this thread there it is said:
"
For (2), that probably means building PySide2 from source as a second part in your Snapcraft recipe, since there are no deb packages of PySide2 in the 18.04 repository that you could reference via stage-packages. It is in the 20.04 repository, but the kde-neon extension does not yet support core20 snaps
"
Because now kde-neon can be used in base20 as experimental extension, how can I use it as a stage-package?