flatpak-howto.txt 3.21 KB
Newer Older
Jehan's avatar
Jehan committed
1 2 3 4 5 6 7 8 9 10 11 12
GIMP Flatpak HowTo
==================

* GIMP uses Flatpak's GNOME runtime, which contains a base of libraries,
  some of which are dependencies of GIMP.
  Check out the available versions at: http://flatpak.org/runtimes.html
  Verify that we use the last runtime version in `org.gimp.GIMP.json`:

> "runtime-version": "3.22"

* Install this runtime and the corresponding SDK if you haven't already:

13 14 15 16 17 18
> flatpak remote-add --from gnome https://sdk.gnome.org/gnome.flatpakrepo
> flatpak install gnome org.gnome.Platform//3.22 org.gnome.Sdk//3.22

Or simply update them:

> flatpak update
Jehan's avatar
Jehan committed
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34

* Other GIMP dependencies which are not available in the GNOME runtime
  should be built along as modules within GIMP's flatpak.
  Check format in `org.gimp.GIMP.json` and add modules if necessary.
  For more information and options, check flatpak builder's manifest
  format:
  http://flatpak.org/flatpak/flatpak-docs.html#flatpak-builder

* On the other hand, if we increased the runtime version in particular,
  some modules may no longer be necessary.
  For instance, at time of writing, GNOME runtime 3.22 includes libpng
  1.6.17 but GIMP requires "libpng >= 1.6.25".
  Similarly lcms2 was available in the runtime but on a low version.
  On a higher version runtime, these modules can likely be removed from
  our manifest.

35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
  A flatpak is a layered set of modules. Our GIMP build in particular is
  built over the GNOME runtime, itself built over the Freedesktop
  runtime, itself based on a yocto-built image.
  Other than by trial and error, you can find the installed dependencies
  by running:

> flatpak run --devel --command=bash org.gimp.GIMP

  GIMP manifest available at:

> less /app/manifest.json

  GNOME module list:

> less /usr/manifest.json

  Freedesktop module list:

> less /usr/manifest-base-1.json

  Finally the contents of the yocto-built image:

> less /usr/manifest.base
Jehan's avatar
Jehan committed
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91

* For a stable release, remove the following line from the manifest:

>  "desktop-file-name-prefix": "(Dev) ",

* Run the flatpak builder with the following command:

> flatpak-builder --repo=gimp-repo gimp-flatpak-build org.gimp.GIMP.json

  Note: if you ever want to check the `config.log` of any of the module,
  this is available in a hidden directory of your working path.
  For instance GIMP build dir will be `.flatpak-builder/build/gimp-1/`.
  The number will be incrementing at each build (`flatpak-builder`
  apparently caches every build).

  If it ends successfuly, this will have built then installed GIMP in a
  new folder `gimp-flatpak-build/` and all its dependencies based on the
  information from the manifest. It will also create or update the
  folder `gimp-repo` which is a flatpak repository.

* Test it with:

> flatpak --user remote-add --no-gpg-verify gimp-repo gimp-repo
> flatpak --user install gimp-repo org.gimp.GIMP
> flatpak run org.gimp.GIMP

  Also an entry "(Dev) GNU Image Manipulation Software" should now be
  available in your menus (or GNOME Overview). This will run the flatpak
  build.

* TODO: this is my current state. I still have to probably write a
  `.flatpakrepo` file which we can upload on `gimp.org` and should allow
  GNU/Linux users to install GIMP and our flatpak repo in a few clicks.
  We will also have to sign the repo with GPG, etc.