5

How can I use Gtk3 in my snap app? should I add Gtk3 as a plugin to snapcraft.yaml? and how to build it? However I can build Gtk3 outside of snapcraft system.

1

Take a look at https://github.com/ubuntu/snappy-playpen/blob/master/galculator/snapcraft.yaml - it's actually quite straight-forward:

The relevant bit is parts: galculator: source: https://github.com/galculator/galculator.git plugin: autotools install-via: prefix build-packages: - flex - gettext - intltool - libgtk-3-dev - libpng12-dev - libxml-parser-perl stage-packages: - libglib2.0-0 - libgtk-3-0 - libpango-1.0-0 - libpng12-0 - libquadmath0 - dconf-gsettings-backend - librsvg2-common - libwmf0.2-7-gtk - libgdk-pixbuf2.0-0 after: [gtkconf]

A few points: - it uses the autotools plugin to build the package - it pulls in libgtk3-dev (and other packages) as build-packages, so packages you need to have locally installed to build the snap - it mentions dependencies as stage-packages which are then bundled with the snap - it uses the gtkconf wiki part for the launcher

Have a look at the full example though, it should help getting your GTK3 app to build.

| improve this answer | |
  • This answer is now out of date – trampster Aug 5 '19 at 4:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.