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 Ubuntu 16.04:
sudo add-apt-repository ppa:alexlarsson/flatpak sudo apt update sudo apt install flatpak-builder
Note the actual versions of the GNOME SDK and Platform (below is used version 3.28) 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": "3.28",). 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 runtime, which can be installed with:
flatpak remote-add --from gnome https://sdk.gnome.org/gnome.flatpakrepo flatpak install gnome org.gnome.Platform//3.28 flatpak install gnome org.gnome.Sdk//3.28
If it's required to install the GNOME SDK and Platform only for the current user, rather than system wide (also to not require root password), then install it with --user argument, like this:
flatpak --user remote-add --from gnome https://sdk.gnome.org/gnome.flatpakrepo flatpak --user install gnome org.gnome.Platform//3.28 flatpak --user install gnome org.gnome.Sdk//3.28
And that's all with respect of prerequisites. All the rest is handled by Flatpak and Evolution build script.
Prepare the build directory
Choose 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
Get the build script now, using wget command:
There's everything ready to start the build now.
To build Evolution in Flatpak, run the below command:
flatpak-builder --force-clean org.gnome.Evolution-stable org.gnome.Evolution-stable.json
and flatpak-builder will do everything what is needed to build Evolution, including downloading other dependencies and building them.
Flatpak requires the local build to be part of a repository, thus create one for it and add it to Flatpak:
flatpak build-export repo-stable org.gnome.Evolution-stable flatpak --user remote-add --no-gpg-verify --if-not-exists evolution-repo-stable repo-stable
Evolution can be installed from this repository now:
flatpak --user install evolution-repo-stable org.gnome.Evolution
To run the built Evolution, use this command:
flatpak run org.gnome.Evolution
And that's it.
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 repo-stable 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-stable
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.