Flatpak¶
Flatpak provides features for application sandboxing and distribution.
Applications for the phone will be distributed as flatpaks – packages that can
be distributed via repositories. Documentation for the flatpak
tool and
its flatpak-builder
wrapper can be found in the Flatpak documentation.
Installing Flatpak Builder¶
Versions of these tools provided with modern GNU/Linux distributions should be
sufficient. Debian-based distributions provide packages called flatpak
and
flatpak-builder
that can be installed with the following command:
sudo apt -y install flatpak flatpak-builder
The flatpak-builder
tool is used to build flatpaks; the flatpak
tool is
used to install and uninstall flatpaks, manage repositories and keep track of
the applications that are available to run.
Cross-Compiling¶
Building and testing applications locally is straightforward. Cross-compiling applications with Flatpak requires the use of the qemu user mode emulation binaries. On Debian-based platforms these can be installed with the following command:
sudo apt -y install qemu-user-static
This package, or the equivalent on other platforms, is necessary if you want to build applications for the Librem 5 on systems with a processor architecture different to that used by the phone (aarch64).
Installing Runtimes and SDKs for Development¶
Flatpak uses specific runtimes and SDKs for each target platform. The ones you will use depend on the technologies you will use to write applications for the Librem 5.
- If you are using GNOME-based applications, you will need to follow the steps in Setting up Flatpak for GNOME Development.
- If you are using Plasma-based applications based on KDE frameworks, you will need to follow the steps in Setting up Flatpak for Plasma Mobile Development.
When you have installed a suitable runtime and SDK, you can start to develop your application and package it for testing on the phone or in an emulator.