Repository navigation
feat(plugin): linux { flathub { } } and generateFlathubRepository - #900
Merged
Merged
Conversation
Writes the Flathub repository of an app (github.com/flathub/<appId>)
from its DSL: a manifest that repackages the released Linux tar.gz, the
AppStream metainfo, the desktop entry, the icon, the shared-mime-info
XML and, for a subset of architectures, flathub.json. flathub { } only
holds what Flathub alone needs; name, description, vendor, homepage,
categories, icon, file associations and URL protocols come from the rest
of the DSL, the executable from the GraalVM image name.
Archives are hashed from archiveUrl ({version}, {arch}), or taken from
-Pnucleus.flathub.localArchive for the local repository loop. The task
fails with everything Flathub would reject before writing anything.
The Lab now uses it instead of its hand-written template and script; its
output matches theirs and passes flathub-build and flatpak-builder-lint.
generateFlathubRepository can now write into a clone of
github.com/flathub/<appId> (flathub { outputDir }, or
-Pnucleus.flathub.outputDir for one run). It no longer wipes its output
directory: it replaces only the files it writes and removes flathub.json
or the MIME file when they no longer apply, so the clone's .git and
files of its own are left alone.
Flathub's stable remote refuses a release version containing alpha, beta, rc, pre or dev (appstream-latest-release-is-prerelease, never granted an exception), which the new-submission CI enforces. The store version can now differ from the package version, which the archive URL keeps using, and generateFlathubRepository refuses a pre-release one with the same regex as the linter. The Lab publishes a dev build under the date of its tag (v3.0.0-dev-202611011507 -> 2026.11.01).
…put directory With outputDir pointing at a clone of the Flathub repository, Gradle fingerprinted the whole clone, Flatpak build directories included, whose var/run links to /run: the task failed on an unreadable /run/snapd/ns/prompting-client.mnt. The task is now untracked; it only writes a few small files and always runs.
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.
What
A plugin DSL that writes the Flathub repository of any Nucleus app (
github.com/flathub/<appId>), for apps that Flathub repackages from their released Linuxtar.gz. Flathub builds nothing from source in that setup, which is the path a closed-source app takes. The Lab used a hand-written template and script for this; it now uses the DSL.linux { flathub { appId = "com.example.App" summary = "Edit example documents" projectLicense = "LicenseRef-proprietary" archiveUrl = "https://example.com/releases/{version}/app-{version}-linux-{arch}.tar.gz" screenshot("https://example.com/shots/main.png", "The main window") } }./gradlew generateFlathubRepositorywritesbuild/flathub/<appId>/:flathub.json, only when the app targets a subset of architectures.flathub { }only holds what Flathub alone needs. The other values come from the rest of the DSL:fileAssociation, which gives the MIME types;protocol, which givesx-scheme-handler;packageVersion;bin/<packageName>for a jpackage build).This is independent of
flatpak { }, which builds a.flatpakbundle that Flathub does not accept.archiveUrl({version},{arch}→x64/arm64) to compute itssha256. With-Pnucleus.flathub.localArchive=<tar.gz>, the task uses that file instead, for the local repository loop.#rrggbbbranding colors, and a square PNG icon of 256 px or more.Verification
v3.0.0-dev-202611011507, gives the samesha256values as the hand-written script, and its content is identical apart from formatting.flathub-build,flatpak-builder-linton both manifest and repo,appstreamcli validateanddesktop-file-validate.FlathubRepositoryTesthas 10 tests. ktlint passes. detekt reports nothing in the new code; the plugin's existing detekt findings are unchanged.docs/internals/flathub.mddocuments the DSL, the local loop and linting.