Using libgtk-3-0 getting missing libraries libgtk-x11-2.0.so.0

My Python + wxPython application snap which references libgtk-3-0 builds and runs OK but I do have two missing libraries being reported.

On a previous linux system I was using, these came up as mere warnings and those libraries were ‘migrated into the snap to satisfy dependencies’ from the host filesystem:

Priming desktop-gtk3 
This part is missing libraries that cannot be satisfied with any available stage-packages known to snapcraft:
- libgdk-x11-2.0.so.0
- libgtk-x11-2.0.so.0
These dependencies can be satisfied via additional parts or content sharing. Consider validating configured filesets if this dependency was built.

Should I be worried? Can anybody recommend what entries to my yaml are needed to fix this? My snap/snapcraft.yaml under Ubuntu 18.04 with snapcraft installed via snap looks like:

name: blah
version: git
summary: 'blah'
description: blah

grade: stable
confinement: strict
base: core18

apps:
    pynsource:
        command: desktop-launch python3 $SNAP/pynsource-gui.py
        plugs: [x11, unity7, pulseaudio, home, gsettings, network, desktop, desktop-legacy]
        desktop: usr/share/applications/pynsource.desktop
        environment:
            LD_LIBRARY_PATH: $LD_LIBRARY_PATH:$SNAP/usr/lib/x86_64-linux-gnu/pulseaudio

parts:
  desktop-gtk3:
    build-packages:
    - build-essential
    - libgtk-3-dev
    make-parameters:
    - FLAVOR=gtk3
    plugin: make
    source: https://github.com/ubuntu/snapcraft-desktop-helpers.git
    source-subdir: gtk
    stage-packages:
    - libxkbcommon0
    - 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
    - locales-all
    - xdg-user-dirs
    - ibus-gtk3
    - libibus-1.0-5
    - fcitx-frontend-gtk3
  copy-stuff:
    plugin: dump
    source: ./src
  copy-desktop-icon-stuff:
    plugin: dump
    source: snap/gui
    organize:
      # without it the two files end up in /prime not /prime/usr/share/applications/
      pynsource.png: usr/share/applications/pynsource.png
      pynsource.desktop: usr/share/applications/pynsource.desktop     
  pynsource:
    # See 'snapcraft plugins'
    plugin: python
    python-version: python3
    source: ./src
    stage-packages:
        - libssl-dev
        - libjpeg-dev
        - libtiff-dev
        - libsdl1.2-dev
        - libnotify-dev
        - freeglut3
        - ibus-gtk3
        - libwebkitgtk-3.0-0
        - zlib1g
        - libsm6
        - libpulse0
        - libslang2
        - libsdl1.2debian
    python-packages:
        - https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-18.04/wxPython-4.0.4-cp36-cp36m-linux_x86_64.whl
        - wxasync
    requirements:
        - /root/project/requirements-linux.txt

P.S. Any suggestions for a cleaner snapfile also appreciated, though, as I say, it works.

you want libgtk2.0-0 in stage-packages:

2 Likes

Thanks that worked!

P.S. I also removed the entire desktop-gtk3 part and added the line extensions: [gnome-3-28] to my snapcraft.yaml file which simplifies things nicely.