Flatpak.rst 2.11 KB
Newer Older
1 2 3 4 5 6
.. _dev_env_flatpak:

Flatpak
=======

`Flatpak`_ provides features for application sandboxing and distribution.
7
Applications for the phone will be distributed as flatpaks -- packages that can
8 9 10
be distributed via repositories. Documentation for the ``flatpak`` tool and
its ``flatpak-builder`` wrapper can be found in the `Flatpak documentation`_.

11 12 13
Installing Flatpak Builder
--------------------------

14 15
Versions of these tools provided with modern GNU/Linux distributions should be
sufficient. Debian-based distributions provide packages called ``flatpak`` and
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
``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.

.. _dev_env_flatpak_cross:

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).
39

40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
Installing Runtimes and SDKs for Development
--------------------------------------------

Flatpak uses specific :ref:`runtimes and SDKs <building_flatpaks_concepts>` 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 :ref:`flatpak_setup_gnome`.
 * If you are using Plasma-based applications based on KDE frameworks, you will
   need to follow the steps in :ref:`flatpak_setup_plasma`.

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.

55
.. include:: /links.txt