build/flatpak: Move Build instructions to gimp-web-devel

Here, the instructions was hard to find in the middle of maintainer stuff.

Also, be able to build GIMP without dev-oriented distros is something very
desirable, and the gimp-web-devel is the suited place fot it.
This commit is contained in:
Bruno Lopes 2024-02-09 15:29:45 -03:00
parent 6e6239c882
commit e977b1b03b

View file

@ -40,108 +40,6 @@ Base rule to update the nightly build manifest:
exception in our repository, but only for the `master` branch), so we often
need to publish to `master` after mostly a visual review.
## Custom Flatpak builds (for development)
Most contributors simply build GIMP the "old-school" way, nevertheless some
projects are starting to use `flatpak` as a development environment. Here is how
this can be done, as far as our knowledge goes.
Note 1
: The below process is about using flatpak as a development environment, not for
proper [releases to a
repository](https://docs.flatpak.org/en/latest/flatpak-builder.html), neither
for creating [standalone
bundles](https://docs.flatpak.org/en/latest/single-file-bundles.html)
Note 2
: since we usually only use flatpak for releases, not for development, there may
be better ways to make a flatpak development environment. We welcome any
proposed improvement to this file.
* Dependencies:
- flatpak (at least 0.9.5)
- flatpak-builder (at least 0.9.5, when the option `--export-only` has been
added to `flatpak-builder` so that the build and the export can be made in 2
separate steps while using the high level procedure.)
- appstream-compose
Note 1
: there are packages of `flatpak` and `flatpak-builder` for [most
distributions](http://flatpak.org/getting.html).
Note 2
: `appstream-compose` is used to parse the appdata file and generate the
appstream (metadata like comments, etc.).
On Fedora, this is provided by the package `libappstream-glib`, on Ubuntu by
`appstream-util`
* Install the runtimes and the corresponding SDKs if you haven't already:
```sh
flatpak remote-add --user --from gnome https://nightly.gnome.org/gnome-nightly.flatpakrepo
flatpak install --user gnome org.gnome.Platform/x86_64/master org.gnome.Sdk/x86_64/master
flatpak install --user gnome org.gnome.Platform/aarch64/master org.gnome.Sdk/aarch64/master
```
Or simply update them if you have already installed them:
```sh
flatpak update
```
* Setup some recommended build options:
```sh
export BUILD_OPTIONS="--ccache --keep-build-dirs --force-clean"
```
We recommend using `ccache` to improve build speed, and to keep build dirs
(these will be found in `.flatpak-builder/build/` relatively to the work
directory; you may manually delete these once you are done to save space) for
later debugging if ever any configuration or build issue arises.
* Choose what architecture to build and where you will "install" your flatpak:
```sh
# Architectures supported with GIMP flatpak are one of 'x86_64' or 'aarch64':
export ARCH="x86_64"
# Path where build files are stored
export INSTALLDIR="`pwd`/${ARCH}"
```
* Build the flatpak up to GIMP itself (not included):
```sh
flatpak-builder $BUILD_OPTIONS --arch="$ARCH" --stop-at=gimp \
"${INSTALLDIR}" org.gimp.GIMP-nightly.json 2>&1 \
| tee gimp-nightly-flatpak.log
```
The build log will be outputted on `stdout` as well as being stored in a file
`gimp-nightly-flatpak.log`.
* Now we'll want to build GIMP itself, yet not from a clean repository clone
(which is what the manifest provides) but from your local checkout, so that
you can include any custom code:
```sh
flatpak build "${INSTALLDIR}" meson setup --prefix=/app/ --libdir=/app/lib/ _gimp ../../ 2>&1 | tee -a gimp-nightly-flatpak.log
flatpak build "${INSTALLDIR}" ninja -C _gimp 2>&1 | tee -a gimp-nightly-flatpak.log
flatpak build "${INSTALLDIR}" ninja -C _gimp install 2>&1 | tee -a gimp-nightly-flatpak.log
```
This assumes you are currently within `build/flatpak/`, therefore the
repository source is 2 parent-folders away (`../../`). The build artifacts
will be inside the `_gimp/` subfolders, and finally it will be installed with
the rest of the flatpak inside `$INSTALLDIR`.
* For development purpose, you don't need to export the flatpak to a repository
or even install it. Just run it directly from your build directory:
```sh
flatpak-builder --run "${INSTALLDIR}" org.gimp.GIMP-nightly.json gimp-X.XX
```
## Maintaining the manifests
* GIMP uses Flatpak's [GNOME runtime](http://flatpak.org/runtimes.html), which