Before you can build a snap, you need to know a few attributes about your application.
These attributes ensure a snap can be built and, via a 3-point checklist outlined below, help with the construction of the application’s snapcraft.yaml.
There are currently a few types of project that are unsuitable for snaps:
Before going any further, make sure your project builds and runs from a clean environment. This will help clarify any wayward dependencies or specific installation requirement that may have been forgotten in an old build tree.
A snap’s requirements reflect those of the application itself.
If you’re a developer working on the application, or a technical user familiar with a project, a snap’s requirements won’t contain any surprises; they’re what you need to build your application.
Split roughly into their relevance, and the order you should tackle each requirement, here’s what you need to know:
This is the foundation of your snap. It defines how your snap is built and is often an extension of the programming language you’re using. Examples include Python applications using PyPI and Go projects using go get, but also build systems like cmake and platforms like Electron.
Applications can be built using a single part with a single plugin, or from multiple parts and multiple plugins, depending on their complexity.
There are recipes for incorporating many popular toolkits into your snap, either by pasting pre-configured snippets into your snap’s snapcraft.yaml, or by using a new Snapcraft feature called Extensions.
See Desktop app support for examples with toolkit and desktop integration.
Your application may have requirements of the system its running on, and these requirements are typically satisfied by configuring one or more interfaces.
These requirements may be as simple as access to a user’s home directory, sound playback and recording via PulseAudio and desktop interfaces. But they can equally include process management or memory access.
Last updated 10 months ago. Help improve this document in the forum.