Snapcraft Extensions

Snapcraft extensions enable snap developers to easily incorporate a set of common requirements into a snap.

A snap developer creating a GTK 3 application snap, for example, can use the gnome-3-28 extension to expose the GTK 3 libraries to a snap at build and runtime without the snap developer needing specific deep knowledge about GTK 3.

Extensions help:

  • avoid repetitive tasks in the snap building process
  • obviate the need for in-depth knowledge of the target software stack
  • create a standard template for common application requirements
  • reduce the testing and security burden, as they’re tested and updated independently

For more details on the snap building process, see Creating a snap.

Supported Extensions

The following extensions are available in the latest version of Snapcraft:

Extension name Description
flutter-dev Create snaps that track the dev channel of the Flutter UI toolkit (Snapcraft 4.1)
flutter-master Create snaps that track the master channel of the Flutter UI toolkit (Snapcraft 4.1)
gnome-3-34 This latest version of the GNOME extension to help snaps integrate with GNOME and GTK (Snapcraft 4.0+)
gnome-3-28 This extension eases creation of snaps that integrate with GNOME and GTK 3.28 (Snapcraft 3.8+)
kde-neon This extension helps you snap desktop applications that use Qt5 and/or KDE Frameworks (Snapcraft 3.9+)
ros1-noetic This extension helps you snap ROS 1 applications for the Noetic Ninjemys distribution (experimental support in Snapcraft 4.3+)
ros2-foxy This extension helps you snap ROS 2 applications for the Foxy Fitzroy distribution (experimental support in Snapcraft 4.2+)

Using Extensions

All extensions are included with Snapcraft and can be listed with the following command:

$ snapcraft extensions
Extension name    Supported bases
----------------  -----------------
gnome-3-28        core18
kde-neon          core18

See Supported Extensions for the full list of extensions.

Make sure to use the latest version of Snapcraft to see all available extensions. Install it from the Snap Store.

Further information about any specific extension can be obtained by typing snapcraft extension followed by the extension name:

$ snapcraft extension gnome-3-28
This extension eases creation of snaps that integrate with GNOME 3.28

Extensions modify the snapcraft.yaml definition before a build. You can use the expand-extensions command from your project’s root directory to see how the snapcraft.yaml file will look with the extensions applied.

$ snapcraft expand-extensions
name: foliate
    bind: $SNAP/gnome-platform/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/webkit2gtk-4.0
    bind: $SNAP/gnome-platform/usr/share/xml/iso-codes
    command: usr/bin/com.github.johnfactotum.Foliate
    - gsettings
    - home
    - desktop
    - desktop-legacy
    - wayland
    - x11
    - dbus-daemon
    common-id: com.github.johnfactotum.Foliate.desktop
    desktop: usr/share/applications/com.github.johnfactotum.Foliate.desktop
    - snap/command-chain/desktop-launch

Last updated 4 days ago. Help improve this document in the forum.