Here’s how I learned to build a Flatpak version of a GIMP source code fork, from a specified branch. In this case, the branch is called ‘Imp’, and is an unofficial, personal version of GIMP. It also serves as an example of how you might build your own Flatpak version of GIMP.

Why Flatpak?

Flatpak is a software utility for packaging and running Linux applications. Each Flatpak application is contained in its own sandboxed environment, which includes its dependencies and runtime. This isolation allows you to have different versions of the same software installed side by side without interference. Using Flatpak also provides a structured and reproducible way to compile applications.

There is a ‘manifest’ file, org.gimp.GIMP.json, in this repository, which is an adapted version of this nightly one. It provides a way to describe the application and its environment so that it can be packaged as a Flatpak. This is also a neat way to build GIMP locally. Within the manifest, right at the end, GIMP is built from a ‘source’ of code. This can be the official source, or your own remote repo, or a local branch.

If you would like to take the risk of building Imp, are willing to trust a stranger on the internet, and have other security features in place, don’t mind being hacked, or having your data wiped, then you can build Imp by cloning this repository and adjusting the manifest file. It’s not recommended by me, I do recommend playing around with the verified source code for fun and education.

Prepare the System

If you are going to build GIMP as a Flatpak, you need to have the latest parts it needs to be assembled. Here’s a rough guide to this process for a Debian based, Linux Mint platform. It will probably be a unique process for your system, good luck.

Sourced from:

sudo apt build-dep gimp

Dependencies to install or update:

  • flatpak
  • flatpak-builder
  • appstream-compose

Learn About Git

This is another topic altogether, you’ll need some basic knowledge and have ‘Git’ installed.

Cloning the Repository

Clone the Github GIMP Flatpak fork for Imp into a local folder
cd /yourfolder
git clone https://github.com/script-fu/Imp.git
Download the submodules and update them
git submodule update --init --recursive
git submodule update --remote --merge

Open the file org.gimp.GIMP.json in a text editor

Find this top line:

"app-id": "org.gimp.GIMP",

Change to:

"app-id": "org.gimp.Imp",

find the lines that specify the official, the verified and trustable source, the safe code

"type": "git",
"url": "https://gitlab.gnome.org/GNOME/gimp.git",
"branch": "master"

Change to:

Trust me, I’m not a hacker, honest. LoTs of BAd thiNgs MiGht HaPPen
"type": "git",
"url": "https://gitlab.gnome.org/pixelmixer/gimp-plugins.git",
"branch": "Imp"

What do the shell scripts do?

There is a script file in this repo, build-flatpak.sh, it builds the necessary files for installing a Flatpak version of GIMP. It downloads and stores all the parts that make up GIMP, into a folder called ‘.flatpak-builder’, compiles them and assembles the result into a folder called ‘flatpak-install’. This process can take a long while. It then installs the Flatpak on your system.

After build and installiion, start Imp by executing the script launch-flatpak-Imp.sh

How to Make lots of GIMPS

Change the version at the top of build-flatpak.sh

export VERSION="AnyName"

Change the ‘app ID’ at the top of org.gimp.GIMP.json

  "app-id": "org.gimp.AnyName",

Change the code source at the end of org.gimp.GIMP.json

"type": "git",
"url": "https://gitlab.gnome.org/yourGitLab/yourRepo.git",
"branch": "yourBranch"

Or point at a local repository

"type": "git",
"url": "file:///path/to/your/repo/for/building/gimp",
"branch": "yourBranch"

Change the ‘app ID’ at the top of launch-flatpak-Imp.sh

flatpak run org.gimp.AnyName -s

Imp

Imp is coded to use a different ‘workspace’ folder than GIMP, to protect GIMP rc files. The Imp version of gimprc is not compatable with GIMP, it has extra features. You can copy your gimprc to the Imp .config location. Do not copy your gimprc from Imp to GIMP 2.99.

Use at your own risk, it’s unofficial, it’s not GIMP stable, not even GIMP Dev.

More about Imp

https://script-fu.github.io/2023/11/21/ProjectImp.html


<
Previous Post
GitLab and GitHub
>
Next Post
Rename All Layers