flatpaks/flatpak-runtime

This git repository holds container definition file for the Fedora Flatpak runtimes. It also holds scripts and data files used to maintain and update the Fedora Flatpak runtimes.

Updating

Prequisites: you need to have the following "upstream" runtimes installed:

  • org.freedesktop.Platform/x86_64/23.08
  • org.freedesktop.Sdk/x86_64/23.08
  • org.gnome.Platform/x86_64/46
  • org.gnome.Sdk/x86_64/46

You also need python3-jinja2 and possibly a few other Python packages installed.

And finally, you'll need to have flatpak-module-tools installed.

How it works: The files in the upstream runtimes are the primary source for the contents of the corresponding Fedora runtimes. When you type make update, the steps are as follows:

  • List the contents of selected directories of the upstream runtime (tools/list-files.py)
  • Exclude and rename files, and otherwise tweak the contents of the resulting lists, and find the Fedora packages that contain the corresponding packages. (tools/resolve-files.py)
  • Find all dependencies of the resolved packages using flatpak-module-depchase resolve-requires, correlate it all together, figure out the install profiles for each runtime, and create report/runtime.html. (tools/generate-runtime-report.py)
  • Create a container.new.yaml using the profiles. (tools/generate-container-yaml.py)
  • Finds data about applications packaged in Fedora and Flathub (tools/download-fedora-appstream.sh, tools/download-flathub-appstream.sh, tools/download-reviews.py)
  • Finds out how those applications would build using this runtime, and generates more reports in reports/. (tools/generate-app-reports.py).
  • Copy container.new.yaml to container.yaml

Report generation: if you type make report instead then all the above happens except the last step.

Viewing the HTML reports

Because the application reports dynamically load generated JSON files, they can't be viewed as local files. You can run a web server to view them like:

podman run -it --rm -p 8081:8080 \
   -v $(pwd)/reports:/usr/share/nginx/html:ro,z \
   docker.io/nginxinc/nginx-unprivileged \
   nginx -g 'daemon off;'

And then go to [https://localhost:8081/applications.html].

Tweaking the result

The main way to tweak the result is to edit and extend the data embedded in tools/resolve-files.py. Make sure you add comments explaining why you are excluding files, and feed back exclusions to the upstream runtime maintainers as appropriate.

Package notes

To aid in keeping track of the status of all the packages in report.html, notes and "flags" are read from package-notes.txt. The notes are added to report.html and the flags affect formatting. The top of that file has a comment describing the simple format.

Creating a runtime for a new Fedora release

First make sure that the branches for new Fedora release are created in the following components:

Once done, please do the following steps in this exact order:

  1. Update rpms/flatpak-runtime-config package for a new Fedora release - i.e. f35 and f36
  2. Create a new file under the data directory data/f40-live.packages (replace the f40 with the new release) and put the list of packages (rpm -qa --qf "%{NAME}\n" | sort) from a live Fedora Workstation media.
  3. Replace all occurrences of an old Fedora release with the new one in flatpaks/flatpak-runtime - i.e. f34 -> f35 and f35 -> f36
  4. Bump the required freedesktop and GNOME Flatpak SDKs versions if required in tools/generate-files.sh
  5. Run make update. In case of any problems you will need to update the tools/resolve-files.py to adapt it for new library versions and so on. Once the new runtime files are generated, consult the content of it and again modify tools/resolve-files.py to exclude any libraries, binaries or packages if needed.
  6. Try to build the container locally with flatpak-module local-build to verify that the changes from previous step are working.
  7. Commit the change and do the official build with fedpkg module-build -w followed by fedpkg flatpak-build
  8. Update and build modules/flatpak-common - i.e. f35 -> f36 and do an official build of with with fedpkg module-build -w. If you will hit any build problems you might want to try to build the module locally against the local packages with flatpak-module build-module. For that you have to setup your environment
  9. Update modules/flatpak-sdk - i.e. f35 -> f36 and build it with fedpkg flatpak-build (no need to build a module for flatpak-sdk). On the other hand if you will need to make any changes to the flatpak-runtime definitions (to add more packages that are not pulled on x86_64 - i.e. this change) then you will need to again do a module build of flatpak-runtime and once it's done, you can start a new fedpkg flatpak-build of flatpak-runtime and flatpak-sdk.
  10. Create a bodhi update for the new runtime and SDK - i.e. [https://bodhi.fedoraproject.org/updates/FEDORA-FLATPAK-2022-16d56b1bde
  11. Move all applications to the new runtime - i.e. Evince Flatpak moving from f35 -> f36 and build it with fedpkg module-build -w and fedpkg flatpak-build. Also it's a good time to update the finish-args from Flathub and update them in Fedora if needed. Also update the module packages with the changes from the new Fedora release - i.e. fedmod rpm2flatpak --flatpak-common --force --flathub=gimp gimp. You might find the following howto useful.
  12. Create bodhi updates for moved applications
  13. Switch to the new runtime for Anaconda - i.e. f34 -> f35
  14. Once everything is moved, deprecate the old runtime and SDK - TBD