I am trying to create a snap of anydesk and I am not able to start AnyDesk after building the snap.
sudo snap run anydesk
No UTF-8. Trying to change locale.
C.UTF-8: not available.
en_US.UTF-8: not available.
Couldn’t set the locale to UTF-8.
(process:2264): GdkPixbuf-WARNING **: 14:17:17.256: Cannot open pixbuf loader module file '/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders.cache': No such file or directory
This likely means that your installation is broken.
Try running the command
gdk-pixbuf-query-loaders > /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders.cache
to make things work again for the time being.
terminate called after throwing an instance of 'base::gdk_exception_t'
This is my yml file :
name: anydesk # you probably want to 'snapcraft register <name>'
version: '2.9.5' # just for humans, typically '1.2+git' or '1.3.2'
summary: Single-line elevator pitch for your amazing snap # 79 char long summary
description: |
This is my-snap's description. You have a paragraph or two to tell the
most important story about your snap. Keep it under 100 words though,
we live in tweetspace and your description wants to look good in the snap
store.
grade: devel # must be 'stable' to release into candidate/stable channels
confinement: devmode # use 'strict' once you have the right plugs and slots
parts:
anydesk:
plugin: dump
source: https://download.anydesk.com/linux/anydesk_2.9.5-1_amd64.deb
source-type: deb
build-packages:
- libgtk-3-dev
stage-packages:
- libc6
- zlib1g
- zlib1g-dev
- libpng16-16
- libpango1.0-0
- libgvc6-plugins-gtk
- libcanberra-gtk-module
- libcanberra-gtk3-module
- locales-all
- libxkbcommon0 # XKB_CONFIG_ROOT
- ttf-ubuntu-font-family
- dmz-cursor-theme
- light-themes
- adwaita-icon-theme
- gnome-themes-standard
- shared-mime-info
- libgtk-3-0
- libgdk-pixbuf2.0-0
- libglib2.0-bin
- libgtk-3-bin
- unity-gtk3-module
- libappindicator3-1
- xdg-user-dirs
- ibus-gtk3
- libibus-1.0-5
apps:
anydesk:
command: anydesk
plugs:
- x11
- network-bind
You can fix this by using the snapcraft-desktop-helpers:
Add after: [desktop-gtk3] to your part
Add desktop-launch to the commandline
parts:
anydesk:
after: [desktop-gtk3]
plugin: dump
.... # the rest of the part definition
apps:
anydesk:
command: desktop-launch $SNAP/anydesk
plugs:
- x11
- wayland # let it run on wayland, because it's gtk3 so it should be fine
- desktop # needed for a lot of gtk3 and glib interaction with the host system
- desktop-legacy # needed for accessibility tools IIRC
- network-bind
This is what I am getting from adding desktop-gtk3 :
Skipping pull desktop-gtk3 (already ran)
Skipping build desktop-gtk3 (already ran)
Skipping stage desktop-gtk3 (already ran)
Skipping pull anydesk (already ran)
Skipping build anydesk (already ran)
Skipping stage anydesk (already ran)
Priming desktop-gtk3
The GLIBC version of the targeted core is 2.23. A newer libc will be required for the following files:
/home/jeff/snapcraft/AnyDesk/prime/usr/lib/x86_64-linux-gnu/libgnutls.so.30.14.10 (requires GLIBC 2.25)
‘libc6’ is required inside the snap for this part to work properly.
Add it as a stage-packages entry for this part.