2020-03-25 19:04:56 +11:00
|
|
|
# Flatpak packaging
|
|
|
|
|
2020-03-26 22:44:02 +11:00
|
|
|
## Building Flatpak
|
|
|
|
|
2020-03-27 22:06:38 +11:00
|
|
|
To build the Flatpak package, you will need `flatpak`, `flatpak-builder`, and
|
|
|
|
KDE 5.12 runtime with SDK. `flatpak-builder` is usually available from
|
|
|
|
the same repository as `flatpak`.
|
|
|
|
|
|
|
|
[Flatpak setup instructions](https://flatpak.org/setup/)
|
|
|
|
|
|
|
|
To install the runtimes (remove the `--user` flag and run as root if you
|
|
|
|
prefer system-wide installation):
|
2020-03-26 22:44:02 +11:00
|
|
|
|
|
|
|
```
|
|
|
|
flatpak install --user flathub org.kde.Platform//5.12 org.kde.Sdk//5.12
|
|
|
|
```
|
|
|
|
|
2020-03-27 22:06:38 +11:00
|
|
|
If the download fails for some reason, run `flatpak repair` before retrying.
|
|
|
|
|
2020-03-26 22:44:02 +11:00
|
|
|
To build, run from the root of the project:
|
|
|
|
|
|
|
|
```
|
|
|
|
flatpak-builder --repo=build/flatpak/repo --force-clean build/flatpak/build packaging/flatpak/mirage.flatpak.yaml
|
|
|
|
```
|
|
|
|
|
|
|
|
To create bundle, run
|
|
|
|
|
|
|
|
```
|
2020-03-27 03:05:13 +11:00
|
|
|
flatpak build-bundle build/flatpak/repo build/mirage.flatpak io.github.mirukana.mirage
|
2020-03-26 22:44:02 +11:00
|
|
|
```
|
|
|
|
|
|
|
|
Then you can install it with
|
|
|
|
```
|
2020-03-27 03:05:13 +11:00
|
|
|
flatpak install --user build/mirage.flatpak
|
2020-03-26 22:44:02 +11:00
|
|
|
```
|
|
|
|
|
|
|
|
To run, either use your desktop environment or command line:
|
|
|
|
```
|
|
|
|
flatpak run io.github.mirukana.mirage
|
|
|
|
```
|
|
|
|
|
|
|
|
|
2020-03-25 19:04:56 +11:00
|
|
|
## Manifest
|
|
|
|
|
2020-03-27 03:05:13 +11:00
|
|
|
The manifest can be created using the included scripts, as described
|
2020-03-26 22:44:02 +11:00
|
|
|
below. Please note it is intended to be done by the maintainers
|
|
|
|
only. In particular, there could be some unexpected issues exposed by
|
|
|
|
updates in Python modules that have to be resolved.
|
|
|
|
|
2020-03-27 03:05:13 +11:00
|
|
|
The manifest has to be updated by maintainers when the dependencies of
|
|
|
|
Mirage change, or some updates in used Python modules are desired.
|
2020-03-26 22:44:02 +11:00
|
|
|
|
2020-03-27 03:05:13 +11:00
|
|
|
The Flatpak packaging manifest is generated by running
|
|
|
|
[generate-flatpak-script.sh](generate-flatpak-script.sh), which
|
|
|
|
uses [mirage.flatpak.base.yaml](mirage.flatpak.base.yaml) and replaces the
|
|
|
|
marked placeholder with Python dependencies.
|
2020-03-25 19:04:56 +11:00
|
|
|
|
2020-03-27 03:05:13 +11:00
|
|
|
This script requires `libolm` to be installed on the development PC, as it
|
|
|
|
will create Python virtual environment and install all the requirements in it.
|
|
|
|
|
|
|
|
Note that the Python dependencies are taken from
|
|
|
|
[requirements.flatpak.txt](requirements.flatpak.txt) and the
|
|
|
|
project root's [requirements.txt](../../requirements.txt).
|
2020-03-25 19:04:56 +11:00
|
|
|
|
|
|
|
In addition, the list of ignored packages is in
|
2020-03-26 07:27:40 +11:00
|
|
|
[generate-flatpak-script.sh](generate-flatpak-script.sh).
|