feat(linux): package the desktop client for Flathub - #514
Open
plusmobileapps wants to merge 3 commits into
Open
Conversation
Four behaviors the desktop app owns on a normal Linux install belong to the sandbox (or are outright broken by it) in a Flatpak build: - The database directory hardcoded ~/.local/share/chef-mate, which the sandbox does not mount. Honor XDG_DATA_HOME, which Flatpak points at the app's private ~/.var/app/<id>/data. Outside a sandbox the two resolve to the same path. - The in-app updater downloads a .deb and runs it. The sandbox is read-only and Flathub publishes updates, so disable it there for the same reason it is already disabled on the two app-store platforms. - SchemeRegistrar self-registers chefmate:// by writing a handler .desktop file. Inside the sandbox that points at a sandbox-internal launcher path the host session cannot run; the exported .desktop declares the scheme instead. - X11 derived WM_CLASS from the main class name, so the window would not match the .desktop file's StartupWMClass and showed up as a second unnamed dock entry. Pin awtAppClassName to the app id before AWT initializes. Adds platform/Flatpak.kt as the shared FLATPAK_ID / /.flatpak-info probe. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The Flatpak manifest, AppStream metainfo, desktop entry, and launcher shim that get committed to the Flathub repository. They live here so they are reviewed and version-bumped alongside the code they package. The manifest consumes a jpackage app image tarball rather than building from source: every client/* module applies the Android Gradle plugin, so even the JVM target needs the Android SDK to configure, and the SDK cannot be a Flatpak source. Desktop Release now stages that tarball (app image with its bundled jlink runtime, hicolor icon sizes resized from the 584x584 source, and the license) and attaches it to the GitHub Release, where x-checker-data picks it up. Runtime choices worth noting: org.gnome.Platform because JavaFX links against GTK 3, plain --socket=x11 because neither AWT/Skiko nor JavaFX has a Wayland backend, and xdg-pictures/documents/download because the file pickers are java.awt.FileDialog and never reach the document portal. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
packaging/linux/README.md covers building and linting the flatpak locally, the pre-submission checklist (screenshots and the tarball sha256 are still open), the submission flow against flathub/flathub's new-pr branch, and why the manifest is not a source build. Cross-linked from the deployment guide next to the Windows and macOS store sections. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the Flatpak packaging for the Linux desktop client, plus the app-side fixes needed for it to actually work inside the sandbox.
What's here
packaging/linux/— the four files that get committed to the Flathub repository, kept in this repo so they're reviewed and version-bumped alongside the code they package:com.plusmobileapps.chefmate.yml— the manifestcom.plusmobileapps.chefmate.metainfo.xml— AppStream listing, OARS rating, releasescom.plusmobileapps.chefmate.desktop— desktop entry exported by the sandboxchef-mate.sh— launcher shim at/app/bin/chef-mateSandbox fixes — each of these is a real breakage under Flatpak, not cosmetics:
DriverFactory.jvm.kthonorsXDG_DATA_HOME~/.local/share/chef-mateisn't mounted in the sandbox. Same path outside Flatpak.DesktopUpdaterdisabled under FlatpakSchemeRegistrarskips self-registration.desktopdeclaresx-scheme-handler/chefmateinstead.main.ktpinsawtAppClassNameWM_CLASSfrom the main class name, so the window doesn't matchStartupWMClassand appears as a second unnamed dock entry.platform/Flatpak.ktis the sharedFLATPAK_ID//.flatpak-infoprobe.CI —
Desktop Releasenow stageschef-mate-<version>-linux-x86_64.tar.gz(jpackage app image with its bundled jlink runtime, hicolor icons resized from the 584x584 source, LICENSE) and attaches it to the GitHub Release. The.debleg is unchanged.Why it's not a source build
Flathub prefers manifests that compile in the build sandbox with no network. That isn't reachable here: every
client/*module applies the Android Gradle plugin, so even the JVM target needs the Android SDK just to configure, and the SDK isn't redistributable so it can't be a Flatpak source. On top of that, an offline Gradle build would need every Maven artifact, the Gradle distribution, and the Kotlin compiler pinned as manifest sources.So the manifest consumes the upstream-built tarball — the same shape Flathub accepts for other large JVM apps (IntelliJ IDEA Community is Apache-2.0 and still ships an upstream tarball). Reviewers may well push on this; the rationale is written up in
packaging/linux/README.md.Runtime choices
org.gnome.Platform//50, not Freedesktop — JavaFX (the in-app recipe browser's WebView) links against GTK 3, which the Freedesktop runtime doesn't ship.--socket=x11, notfallback-x11— Compose Desktop renders through AWT/Skiko and JavaFX through GTK; neither has a Wayland backend, so both need XWayland even in a Wayland session. The shim pinsGDK_BACKEND=x11.--filesystem=xdg-pictures/documents/download— the pickers arejava.awt.FileDialog, which browses the sandbox filesystem directly and never reaches the document portal.Reviewer notes
flatpak-builderneeds Linux and this was authored on macOS. JVM compile passes and ktfmt is clean, but the manifest, theWM_CLASSvalue, and the app-image directory name the CI step globs for are unverified against a real build.sha256is a placeholder until a release publishes the tarball.flathub/flathub.x-checker-datadrives version bumps via Flathub's external-data-checker.🤖 Generated with Claude Code