Evolution in Flatpak
As of Evolution release 3.30.0, users can build the latest stable (or development) version of Evolution using Flatpak. Such Evolution can be run on the host system in a pure sandbox, with only limited access to the host system. Part of the Flatpak version is also evolution-ews, thus it can be used to connect to Microsoft Exchange servers using Exchange Web Services (EWS) protocol.
Sections below show what to do to setup and build stable version of Evolution in Flatpak for the first time.
To be able to build the Flatpak version, flatpak and flatpak-builder is required to be installed on the system. The Flatpak site has steps how to install flatpak on various distributions, thus follow it and install also flatpak-builder. As a quick example, on Fedora:
sudo dnf install flatpak-builder
or on Debian/Ubuntu 16.04:
sudo add-apt-repository ppa:alexlarsson/flatpak sudo apt update sudo apt install flatpak-builder elfutils
Note the actual versions of the GNOME SDK and Platform can differ each release of Evolution. The exact expected version can be seen (or changed) in the .json file, the runtime-version key (line "runtime-version": "X.Y",). Use the same version in the below install commands as is written in the runtime-version key of the .json file.
Evolution uses GNOME SDK and Platform, which is current hosted on the flathub. If there's preinstalled a flathub repository in the system, then skip the flatpak remote-add command below. The GNOME Platform and SDK can be installed with:
flatpak --user remote-add --from flathub https://flathub.org/repo/flathub.flatpakrepo flatpak --user install flathub org.gnome.Platform//3.38 org.gnome.Sdk//3.38
If you are root on the machine, you can skip the --user argument.
And that's all with respect of prerequisites. All the rest is handled by Flatpak and Evolution build script.
1) Create a directory where the Flatpak will build Evolution. Let's use a directory in the user home, like ~/flatpak, which can be prepared by:
mkdir ~/flatpak cd ~/flatpak
2) Get the build script now, using wget command:
(If you instead want to build the unstable development version, then replace org.gnome.Evolution-stable.json with org.gnome.Evolution-master.json in the command above and in the following commands below.)
3) Run flatpak-builder as follows and flatpak-builder will do everything what is needed to build Evolution, including downloading other dependencies and building them.
flatpak-builder --force-clean org.gnome.Evolution-stable org.gnome.Evolution-stable.json
Flatpak requires the local build to be part of a repository, thus create one for it and add it to Flatpak:
flatpak build-export localrepo org.gnome.Evolution-stable flatpak --user remote-add --no-gpg-verify --if-not-exists evolution-repo localrepo
Evolution can be installed from this repository now:
flatpak --user install evolution-repo org.gnome.Evolution
To run the built Evolution, use this command:
flatpak run org.gnome.Evolution
And that's it.
Note: The Flatpak installs org.gnome.Evolution.desktop file into ~/.local/share/flatpak/exports/share/applications/, from where the desktop environment can use it, instead of the Evolution installed in the host system. Remove the .desktop file from there, in case it's not desired. The Flatpak Evolution can still be run from a terminal using the above flatpak command.
Evolution is built from git checkout, which allows to rebuild it from the latest sources. To do so, move to the build folder and rebuild it:
cd ~/flatpak flatpak-builder --force-clean org.gnome.Evolution-stable org.gnome.Evolution-stable.json
Once the build is done, its repository needs to be refreshed with the built bits:
flatpak build-export localrepo org.gnome.Evolution-stable
Finally, update Evolution from the refreshed repository with:
flatpak --user update org.gnome.Evolution
Then run Evolution as before:
flatpak run org.gnome.Evolution
The Flatpak build of Evolution shows the git commit ID in Help->About at which the Evolution was when it had been built. It can be used to verify that the build contains the latest changes.
Clean up Flatpak data
As a quick reference, in case of removing the Flatpak version of Evolution from the system, check what is installed first:
and remove Evolution from there:
flatpak --user uninstall org.gnome.Evolution
Then also check what repositories are installed:
and remove the custom Evolution repository with:
flatpak --user remote-delete evolution-repo
Sometimes the build can fail or be stopped by the user, then the flatpak-builder can left whole checkout without erasing it. In such cases, the files are stored in ~/flatpak/.flatpak-builder/build. The folder should be empty when nothing is building, thus remove anything left there after the build ends.