Skip to content
Matthias Clasen edited this page Jan 8, 2019 · 4 revisions

Hints for shipping Flatpak

Flatpak is designed to be shipped as part of a Linux distribution.

Building Flatpak

Flatpak uses traditional autotools. The standard

./autogen.sh
./configure
make
make install

should be sufficient to get Flatpak built.

Filesystem layout

This section is describing the default filesystem layout, assuming you haven't configured your build with a non-standard prefix or sysconfdir.

The default system installation is in /var/lib/flatpak, and you may want to include that directory in your package. Flatpak will create the necessary OSTree repo and other directories as necessary when it is run.

Flatpak will read static configuration in /etc/flatpak. You an predefine custom installations in /etc/flatpak/installations.d and remotes for the default system installation in /etc/flatpak/remotes.d, but it would be unusual for a distro package to do so.

Session setup

Flatpak relies on adding its installation locations to the XDG_DATA_DIRS environment variable to make desktop shells find flatpak apps. To this end, it installs a shell snipplet in /etc/profile.d and a systemd user environment generator in /usr/lib/systemd/user-environment-generators. Both of these should be included in distro packages.

Bash completion

Shell completion is an important aspect of the Flatpak commandline UX. It provides completion files for both bash and zsh.