Skip to content

Add KICAD_BUILD_{NIGHTLY_,}FLATPAK CMake options

Turning on KICAD_BUILD_FLATPAK changes names and application specifiers in the metainfo, icons, desktop launchers, and MIME files to follow flatpak (and flathub) naming conventions and requirements. KICAD_BUILD_NIGHTLY_FLATPAK is a second option which adds .Nightly to the flatpak app ID when activated. Turning on KICAD_BUILD_NIGHTLY_FLATPAK also turns on KICAD_BUILD_FLATPAK. This helps simplifying the flatpak manifest on flathub significantly, which currently runs all of these renaming and editing via scripts and/or patching source files at build time. (Feel free to take a look at the mess at https://github.com/flathub/org.kicad.KiCad/blob/master/org.kicad.KiCad.yml#L221-L266)

Since flatpak is by now an officially supported packing format for KiCad, I would like to have these quirks maintained in the KiCad source tree, rather than in the flathub manifest. This will also help people wanting to build their own flatpak versions of KiCad.

Both options default to OFF, not changing anything for regular Linux builds.

The flatpak conventions divert enough from official freedeskop.org specifications for icons, desktop files, and MIME metadata that it was not accepted to simply rename our Linux metadata accordingly. See discussion for !1315 (closed) where I originally proposed to simply adopt the flatpak conventions also for regular Linux builds.

This MR is the CMake approach mentioned at the end of !1315 (closed) . I did tests building and running local flatpaks with the new options active. I also built with the options OFF (i.e. the default), had no build issues, and the generated files looked exactly as before this MR, but I didn't run these builds, as I am on Fedora Silverblue. Running self-built non-flatpak apps is rather difficult there.

Edited by Johannes Maibaum

Merge request reports