Hi,
I’ve created a couple of classic snaps of Electron applications, text editors. I’ve found that some of the libraries bundled via stage-packages: are not being found by the application.
This came to light on Ubuntu GNOME 17.04 which doesn’t ship gconf2 by default. Electron applications require gconf2 and the classic snaps fail to find libgconf-2.so.4, although it is included in the snap.
What is the correct technique to ensure classic snaps can find all their bundled libraries? Here is an example snapcraft.yaml for the Atom snap I am publishing so you can see how things are currently setup. As you can see my attempts to coerce LD_LIBRARY_PATH aren’t working.
name: atom
version: 1.18.0
summary: A hackable text editor for the 21st Century.
description: |
Atom is a free and open source text editor that is modern,
approachable, and hackable to the core.
grade: stable
confinement: classic
parts:
atom:
plugin: dump
source: https://github.com/atom/atom/releases/download/v1.18.0/atom-amd64.deb
source-type: deb
# Correct path to icon.
prepare: |
sed -i 's|Icon=atom|Icon=/usr/share/pixmaps/atom\.png|g' usr/share/applications/atom.desktop
after:
- desktop-gtk2
stage-packages:
- gconf2
- libasound2
- libnotify4
- libnspr4
- libnss3
- libpulse0
- libxss1
- libxtst6
apps:
atom:
# Correct the TMPDIR path for Chromium Framework/Electron to
# ensure libappindicator has readable resources.
# Coerce LD_LIBRARY_PATH so libgconf-2.so.4 can be found in the snap.
command: env TMPDIR=$XDG_RUNTIME_DIR LD_LIBARY_PATH=$SNAP/usr/lib/x86_64-gnu-linux/usr/lib ${SNAP}/bin/desktop-launch ${SNAP}/usr/share/atom/atom
desktop: usr/share/applications/atom.desktop