flutpak 0.3.0
flutpak: ^0.3.0 copied to clipboard
CLI tool that generates Flatpak manifests and offline source bundles for Flutter applications. One command prepares everything needed for a Flathub-compatible offline build: generated-sources.json, ma [...]
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
Unreleased #
0.3.0 - 2026-05-26 #
Added #
-V/--versionglobal flag — printsflutpak <version>and exits;setup-flutpakaction now runsflutpak --versionto verify the installationtool/update_version.dart— generator script that readsversion:frompubspec.yamland writeslib/src/version.dart; run after every version bump:dart run tool/update_version.dart; thesetup-flutpakaction andrelease.ymlrun it automatically sopubspec.yamlis the single source of truthMakefile—make build(regenerate version + compile binary),make version(regenerate only),make test(run test suite)test/version_test.dart— enforces thatpackageVersioninlib/src/version.dartmatchespubspec.yaml; CI will fail if they diverge
Fixed #
setup-flutpakaction: whenversioninput is empty, build from$GITHUB_ACTION_PATH(the ref used in theuses:directive) instead of cloningmain; explicit tag/SHA/branch still supported viaversioninputprepare: warn whenflutter_version_fileis set but$FLUTTER_ROOTis unresolvable instead of silently skipping; no warning emitted for pure-Dart projects that do not setflutter_version_filerelease.yml: regeneratelib/src/version.dart(viadart run tool/update_version.dart) alongside thepubspec.yamlversion bump, so compiled binaries always report the correct release version
Fixed #
SdkExtensionGeneratornow usesFlutterSdkGenerator.readFlutterVersion()instead of reading theversionfile directly; this prevents aPathNotFoundExceptioncrash on Flutter ≥ 3.32 where the flatversionfile was removed (falls back togit describethenpackages/flutter/pubspec.yaml)RegistryEntry.versionConstraintis now evaluated when resolving registry patch entries; previously the field was declared but silently ignored, so constrained entries were applied to every matched package version- Pub archive URLs switched from deprecated
pub.dartlang.orgtopub.dev - Fixed duplicate step-5 comment in
FlutterSdkGenerator.generate();engine_stamp.jsonis now labelled step 6
Changed #
FlutterSdkGenerator._readFlutterVersionrenamed toFlutterSdkGenerator.readFlutterVersion(public static) so thatSdkExtensionGenerator(and external tooling) can reuse the multi-fallback version-resolution logicresolvePatchEntriesaccepts an optionalregistryEntriesparameter to allow injecting a custom registry in tests
0.2.8 - 2026-05-25 #
Removed #
exportcommand — removed; files can be copied manually if neededmanifestcommand — removed- Metainfo XML generation —
manifest.metainfo:config andMetainfoGeneratorremoved; maintain your<app_id>.metainfo.xmlmanually inapp/share/metainfo/ .desktopfile generation —manifest.desktop:config and desktop generator removed; maintain your<app_id>.desktopmanually inapp/share/applications/DesktopConfig,MetainfoConfig,DeveloperConfig,UrlConfig,ScreenshotConfigconfig classes removedreplaceMetainfoScreenshots()/patchMetainfoReleases()helpers removed
Added #
setup-flutpakcomposite action — installs theflutpakbinary (downloads pre-built release or compiles from source); replaces the inline build steps that were previously embedded inprepareandverifyactions
Removed #
preparecomposite action — removed; usesetup-flutpak+flutpak preparedirectlyverifycomposite action — removed
Changed #
- Generated manifest now installs shared assets directly from the
app/directory tree that must be present in the repository:app/share/metainfo/<app_id>.metainfo.xml→/app/share/metainfo/app/share/applications/<app_id>.desktop→/app/share/applications/app/share/icons/hicolor/512x512/apps/<app_id>.png→/app/share/icons/hicolor/512x512/apps/
- Config simplified:
manifest.metainfo:,manifest.desktop:,manifest.icons:sections no longer recognised prepareno longer pins screenshot URLs or patches release dates in metainfo
0.2.7 - 2026-05-20 #
Added #
DesktopConfig: newcommentfield →Comment=in.desktopfile (falls back tometainfo.summaryor pubspecdescriptionwhen omitted)DesktopConfig: newstartup_wm_classfield →StartupWMClass=in.desktopfile (defaults tomanifest.commandwhen omitted)MetainfoConfig: newmetadata_licensefield (default:MIT) — controls<metadata_license>in generated XMLMetainfoConfig: newproject_licensefield (default:MIT) — controls<project_license>in generated XML (e.g. set toGPL-3.0-onlyfor GPL apps)MetainfoConfig: newsupportslist — emits<supports><control>…</control></supports>block (e.g.[pointing, keyboard, touch])MetainfoConfig: newcontent_rating_attributesmap — emits<content_attribute id="…">value</content_attribute>children inside<content_rating>; when empty a comment placeholder is written instead.desktopand metainfo generation now fall back to pubspec.yamlname/descriptionwhen the corresponding config fields are absent
Fixed #
$VARenv placeholders that remain unresolved at runtime (e.g.$FLUTTER_ROOTnot set) now yieldnullinstead of the literal string, preventing aPathNotFoundExceptioncrash inFlutterSdkGenerator- Lock file paths containing unresolvable
$VARreferences are silently skipped instead of triggering a⚠ lock file not found: $FLUTTER_ROOT/…warning output:directory now controls paths for all generated artifacts — manifest,.desktop, and metainfo — not justgenerated-sources.json
0.2.6 - 2026-05-20 #
Removed #
lintcommand — useflatpak run --command=flatpak-builder-lint org.flatpak.Builderdirectly; wrapping an official tool added complexity without value and made it hard to keep up with upstream CLI changes (--exceptions,--user-exceptions, etc.)validatecommand —appstreamcliis only available on Ubuntu/Debian and not universally present in CI environments; call it directly when needed
0.2.5 - 2026-05-20 #
Fixed #
lintcommand: pass both--exceptionsand--user-exceptionstoflatpak-builder-lint;--exceptionsis required to activate exception filtering — without it--user-exceptionshas no effectlintcommand: use absolute path for--user-exceptionsso it is resolvable inside the Flatpak sandbox regardless of CWD
0.2.4 - 2026-05-20 #
Fixed #
lintcommand: auto-detectflathub.jsonin the manifest/repo directory and pass--user-exceptionstoflatpak-builder-lint, so local exception entries (e.g.appid-url-not-reachable) are respected without a PR to the central Flathub exceptions file
0.2.3 - 2026-05-20 #
Fixed #
lintcommand: pass--filesystem=hosttoflatpak runso the sandboxedflatpak-builder-lintprocess can readflathub.jsonfrom the host filesystem (without this theexceptionslist inflathub.jsonwas silently ignored)
0.2.2 - 2026-05-20 #
Fixed #
validatecommand: switched fromappstream-utiltoappstreamcli(the modern AppStream CLI available asappstreampackage on Debian/Ubuntu 22.04+). Added--explain(always on) and--no-net(on by default) flags.
0.2.1 - 2026-05-19 #
Added #
DeveloperConfig— newdeveloper:field inMetainfoConfig; generates<developer [id="..."]><name>...</name></developer>in metainfo XML (AppStream 1.0 / Flathub requirement)
Changed #
- Screenshot URL pinning is now config-driven:
replaceMetainfoScreenshots()rebuilds the entire<screenshots>block frommetainfo.screenshots:configrepo_slug+ ref, instead of regex-replacing/main/in the existing file. Works correctly regardless of what ref the file currently contains.
MetainfoGenerator.generate({ref})bakes the correct ref into screenshot URLs at generation time;mainis used as a fallback when no ref is provided.
0.2.0 - 2026-05-19 #
Added #
lintcommand —flatpak-builder-lintwrapper (requiresorg.flatpak.Builder)exportcommand — collects manifest,generated-sources.json, metainfo, and patches into a ready-to-submit directoryvalidatecommand —appstream-util validatewrapper for AppStream metainfo- Metainfo XML generation from
manifest.metainfo:config (name, summary, description, categories, keywords, URLs, screenshots, OARS content rating) .desktopfile generation frommanifest.desktop:configprepare --dry-run/-n— prints what would be written without touching any filespin-manifestcomposite action:flutter_version/flutter_version_fileinputs (one required),config,validate,flutpak_binarytest-action.yml— CI workflow that builds the binary from source and smoke-tests the action
Changed #
output:config field is now a directory (default:flatpak);generated-sources.jsonis always written as<output>/generated-sources.json--outputCLI flag is now a directory in all sub-commands (sources,pub,flutter,manifest)- All commands resolve paths relative to the config file directory, not CWD
pin-manifestaction: replacedflatpak_dirinput withconfig+flutter_version/flutter_version_file
Fixed #
- Screenshot URL pinning uses git tag date for deterministic release dates
ScreenshotConfig.fromYamlhandles non-Map input safely
0.1.0 - 2026-05-19 #
Added #
preparecommand — one-shot: generates sources, resolves patches, creates/updates manifest, pins metainfo screenshot URLs to tag/commit- Config in
pubspec.yaml(flutpak:section) or standaloneflutpak.yaml(error if both exist) - Manifest generation with
__FLATPAK_TAG__/__FLATPAK_COMMIT__placeholders that CI replaces on each release extra_modules— include verbatim YAML module files into the manifestextra_sources— arch-specific verbatim flatpak sources (e.g. prebuilt C libraries)envat manifest level merged withbuild_options.envflutter_version_file— writes the Flutter SDK version string to a file for CI.desktopfile generation fromdesktop:config (name,categories)sdk-extensionsauto-wires LLVM bin/lib paths intoappend-path/prepend-ld-library-path- Flutter SDK
bin/always appended toappend-pathautomatically - Patches registry —
objectbox_flutter_libsandsqflite_common_ffiresolved automatically when found inpubspec.lock - Project-level
patches:config with version auto-resolved from lock file - Patch paths made relative to the manifest directory for correct flatpak-builder resolution
- Retry with exponential back-off (2 s → 4 s → 8 s) on HTTP 429 / 5xx for pub.dev API and Flutter SDK artifact downloads
- Warning when
--commitis not available and__FLATPAK_COMMIT__would remain in the manifest - Warning when
extra_modulesfile is not found - Validation of required
manifest.app_idandmanifest.commandfields with clear error messages - SHA-256 download cache at
~/.cache/flutpak/to avoid redundant Flutter artifact downloads across runs # Generated by flutpakheader in manifest,.desktop, andflutter.versionoutput files- MIT License