Skip to content

feat(packaging): add flatpak manifest for flathub#164

Merged
InstaZDLL merged 5 commits into
mainfrom
feat/packaging-flatpak
May 26, 2026
Merged

feat(packaging): add flatpak manifest for flathub#164
InstaZDLL merged 5 commits into
mainfrom
feat/packaging-flatpak

Conversation

@InstaZDLL
Copy link
Copy Markdown
Owner

@InstaZDLL InstaZDLL commented May 26, 2026

Summary

  • Adds packaging/flatpak/ with a Flathub-ready manifest, .desktop, AppStream metainfo, and offline-built cargo + npm source manifests so the build runs without network in the Flatpak sandbox.
  • Gates tauri-plugin-updater behind a default-on cargo feature so the Flatpak (and any future app-store) build can compile it out; the in-app updater would otherwise fight flatpak update on the read-only /app mount.
  • Drops the GNOME 50 runtime which already ships webkit2gtk-4.1 + libsoup3 natively — no custom webkit module needed. libayatana-appindicator ships from a vendored Flathub shared-modules subtree to keep the main repo submodule-free.

How I tested

  • flatpak-builder end-to-end: every module commits cleanly (intltool → dbus-glib → libdbusmenu → libindicator → libappindicator → waveflow). Final 41 MB stripped binary in /app/bin/waveflow.
  • ldd on the binary confirms it links against the runtime's libwebkit2gtk-4.1.so.0, libgtk-3.so.0, libsoup-3.0.so.0, libjavascriptcoregtk-4.1.so.0.
  • flatpak run --user app.waveflow.WaveFlow: app starts, SQLite migrations run, default profile is created, cpal opens an F32 @ 44.1 kHz output stream.
  • cargo check --no-default-features --all-targets: passes (confirms the updater plugin is properly excluded from the dep graph when the feature is off).
  • cargo check --all-targets (default features): passes, updater plugin present, capability auto-regenerated.
  • appstreamcli validate --pedantic + desktop-file-validate: clean (one informational note about uppercase in app.waveflow.WaveFlow which is AppStream-spec-compliant, see org.kde.Kdenlive, tv.plex.PlexDesktop).

Screenshots / clips

The visual chrome is GTK3-era (window decorations) because Tauri 2.11 hard-links against webkit2gtk-4.1 (the GTK3 variant); see tauri-apps/tauri#3961. Not a Flatpak regression — same chrome on AUR/COPR builds. Will catch up when Tauri ships a webkitgtk-6-0 feature.

Checklist

  • Title uses Conventional Commits (type(scope): subject, kebab-case scope)
  • bun run lint + bun run typecheck pass locally
  • cargo check --manifest-path src-tauri/Cargo.toml --all-targets passes locally
  • If UI strings changed: every locale in src/i18n/locales/ updated (none touched)
  • If cross-cutting pattern changed: CLAUDE.md and docs/ updated (packaging-only; will document in a follow-up after the first Flathub release)
  • Breaking change? Called out in the summary above (none — opt-in feature, default behavior unchanged)

Follow-ups (not in this PR)

  • Pin the source commit: SHA at each release tag (will be automated via release.yml).
  • <internet>offline-only</internet> in metainfo → limited (cosmetic, doesn't block submission).
  • Frontend useUpdater / UpdateBanner invoke the plugin via Tauri command; on Flatpak the invoke returns an error. Currently silent — should be gated on a runtime "is Flatpak" check so the banner never tries.
  • CI workflow that builds the manifest on PRs to catch regressions early.
  • Custom title bar (Spotify-style) to escape the GTK3 chrome cross-platform.

Summary by CodeRabbit

  • New Features

    • Ajout du support de packaging Flatpak complet (manifeste, metainfo, desktop, icônes, intégrations MPRIS/notifications/tray).
  • Bug Fixes

    • Corrections diverses pour libappindicator (stabilité des signaux, itération d’icônes, suppression de bindings Python).
  • Chores

    • Rend l’auto‑updater optionnel dans la configuration de build et synchronisation du fichier de capacités.
    • Ajout de scripts/manifestes et règles d’ignorance (gitignore, ESLint).
  • Documentation

    • Nouveau document "upstream-blockers" et mise à jour de la section Contributing.

Review Change Stack

InstaZDLL added 3 commits May 26, 2026 10:44
Add a `default = ["updater"]` cargo feature in src-tauri/Cargo.toml so
distribution channels that own their own update flow (Flatpak, future
MAS/MS Store) can compile out `tauri-plugin-updater` with
`--no-default-features`.

The capability registration is generated/removed by build.rs since
tauri-build auto-discovers `capabilities/*.json` and rejects dangling
permission references at compile time.
Ship a Flathub-ready manifest at packaging/flatpak/. Built end-to-end
against org.gnome.Platform//50 which carries webkit2gtk-4.1 + libsoup3
natively, so Tauri 2 needs no custom webkit module.
libayatana-appindicator (system tray) ships from a vendored copy of
the Flathub shared-modules libappindicator subtree to keep the main
repo submodule-free.

Cargo + npm dependencies are vendored offline via
packaging/flatpak/generate-sources.sh (wraps flatpak-cargo-generator
and flatpak-node-generator at a pinned upstream commit). The build
invocation passes --no-bundle --no-sign --no-default-features so
flatpak update — not the in-app updater — owns the upgrade flow.

Verified: 41 MB stripped binary links against the runtime's
webkit2gtk-4.1 / gtk-3 / libsoup-3.0 / javascriptcoregtk-4.1; app
launches inside the sandbox, runs SQLite migrations, opens a cpal
F32@44.1 kHz output stream.
The Flatpak generator caches a Python venv under
packaging/flatpak/.cache/ that includes embedded .js shipped by pip
deps (urllib3 emscripten worker, flatpak-node-generator's
flatpak-yarn.js). They're not part of the repo and have nothing to do
with the app, but eslint walks them anyway. Same for the vendored
shared-modules subtree.
@InstaZDLL InstaZDLL added scope: frontend React/Vite frontend (src/) scope: backend Rust/Tauri backend (src-tauri/) scope: deps Dependencies labels May 26, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 26, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 9c5346ab-1955-41f5-9889-5b0a6e774066

📥 Commits

Reviewing files that changed from the base of the PR and between 673b2c2 and 55e0a76.

📒 Files selected for processing (4)
  • docs/README.md
  • docs/upstream-blockers.md
  • packaging/flatpak/app.waveflow.WaveFlow.yaml
  • src-tauri/build.rs

📝 Walkthrough

Walkthrough

PR ajoute le packaging Flatpak complet (manifeste, desktop/metainfo, modules partagés, script de génération offline) et rend la feature Tauri "updater" optionnelle avec synchronisation du fichier capabilities/updater.json et gate d'activation en release.

Changes

Updater feature gating et Flatpak packaging

Layer / File(s) Summary
Feature updater Tauri
src-tauri/Cargo.toml, src-tauri/build.rs, src-tauri/capabilities/default.json, src-tauri/src/lib.rs, .gitignore
tauri-plugin-updater devient optionnelle via la feature Cargo updater (activée par défaut). build.rs écrit/supprime capabilities/updater.json selon la feature. Le plugin est enregistré uniquement en release quand la feature est activée. .gitignore ignore le fichier généré et le cache Flatpak.
Flatpak manifest et build system
packaging/flatpak/app.waveflow.WaveFlow.yaml, packaging/flatpak/generate-sources.sh, packaging/flatpak/app.waveflow.WaveFlow.desktop, packaging/flatpak/app.waveflow.WaveFlow.metainfo.xml, eslint.config.js
Manifeste Flatpak complet (GNOME 50, Rust/Node extensions, finish-args sandbox). generate-sources.sh produit generated/cargo-sources.json et generated/node-sources.json pour builds offline; le module applicatif est buildé sans la feature updater. Desktop entry et metainfo ajoutés; ESLint ignore packaging/**.
Flatpak shared modules et patches
packaging/flatpak/shared-modules/dbus-glib/dbus-glib.json, packaging/flatpak/shared-modules/intltool/intltool-0.51.json, packaging/flatpak/shared-modules/intltool/intltool-perl5.26-regex-fixes.patch, packaging/flatpak/shared-modules/libappindicator/libappindicator-gtk3-12.10.json, packaging/flatpak/shared-modules/libappindicator/patches/*.patch
Ajout de modules partagés (dbus-glib, intltool, libappindicator) et plusieurs patches pour libappindicator : correction FTBFS, suppression des bindings Python, alignement des signatures des signaux GObject, et correction de l'itération des thèmes d'icônes.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Suggested labels

scope: docs

Poem

📦 Flatpak empaquete, l'updater patient,
Le build offline fredonne son ancien chant,
Patches appliqués, métadonnées posées,
WaveFlow prend son envol, soigneusement empaqueté. 🎵

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed Le titre suit la convention Conventional Commits avec un scope kebab-case approprié et décrit le changement principal : ajout du manifeste Flatpak pour Flathub.
Description check ✅ Passed La description couvre les points clés : résumé des changements (manifeste Flatpak, gating de l'updater, runtime GNOME 50), tests menés en détail (flatpak-builder, ldd, validation appstreamcli), et checklist complétée.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/packaging-flatpak

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


Comment @coderabbitai help to get the list of available commands and usage tips.

@InstaZDLL InstaZDLL added type: feat New feature size: xl > 500 lines labels May 26, 2026
@InstaZDLL InstaZDLL self-assigned this May 26, 2026
@InstaZDLL InstaZDLL enabled auto-merge (squash) May 26, 2026 08:48
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packaging/flatpak/app.waveflow.WaveFlow.metainfo.xml`:
- Around line 112-115: Mettre à jour la balise <internet> sous <recommends> dans
app.waveflow.WaveFlow.metainfo.xml : remplacer la valeur "offline-only" par
"always" si les fonctionnalités réseau sont optionnelles mais peuvent dégrader
l’expérience sans Internet, ou par "first-run" si le réseau n’est utilisé
uniquement au premier lancement; assurez-vous d’éditer la balise <internet> qui
se trouve à l’intérieur de l’élément <recommends> et de conserver le reste du
bloc intact.

In `@packaging/flatpak/app.waveflow.WaveFlow.yaml`:
- Line 44: Supprime l'entrée --device=all (trop large) et remplace-la par
permissions minimales pour audio/portals : retire la ligne contenant
'--device=all' et ajoute au manifest des sockets ciblés comme
'--socket=pulseaudio' et/ou '--socket=pipewire' et, si nécessaire pour l'accès
aux fichiers ou dialogues, les portals correspondants (ex. Flatpak portals) afin
de limiter le scope tout en conservant l'accès audio requis par le selecteur
ALSA/cpal.

In `@src-tauri/build.rs`:
- Around line 45-50: The write error to capabilities file currently only emits a
cargo:warning and should instead fail the build; change the fs::write error
handling in build.rs (the if let Err(err) = fs::write(&path, contents) block) to
call panic! or use expect with a clear message including path.display() and the
err so the build aborts on failure; apply the same change to the second similar
block (the Err handling at the 53-58 region) so both file-write failures cause a
hard failure rather than a warning.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 465625b0-f107-4fe1-8181-e8fd84656a81

📥 Commits

Reviewing files that changed from the base of the PR and between 12a13e8 and 673b2c2.

⛔ Files ignored due to path filters (3)
  • packaging/flatpak/generated/cargo-sources.json is excluded by !**/generated/**
  • packaging/flatpak/generated/node-sources.json is excluded by !**/generated/**
  • packaging/flatpak/generated/package-lock.json is excluded by !**/package-lock.json, !**/generated/**
📒 Files selected for processing (18)
  • .gitignore
  • eslint.config.js
  • packaging/flatpak/app.waveflow.WaveFlow.desktop
  • packaging/flatpak/app.waveflow.WaveFlow.metainfo.xml
  • packaging/flatpak/app.waveflow.WaveFlow.yaml
  • packaging/flatpak/generate-sources.sh
  • packaging/flatpak/shared-modules/dbus-glib/dbus-glib.json
  • packaging/flatpak/shared-modules/intltool/intltool-0.51.json
  • packaging/flatpak/shared-modules/intltool/intltool-perl5.26-regex-fixes.patch
  • packaging/flatpak/shared-modules/libappindicator/libappindicator-gtk3-12.10.json
  • packaging/flatpak/shared-modules/libappindicator/patches/0001-libappindicator-ftbfs.patch
  • packaging/flatpak/shared-modules/libappindicator/patches/0002-libappindicator-no-python.patch
  • packaging/flatpak/shared-modules/libappindicator/patches/0003-libappindicator-fix-crash-from-incorrect-signal-emission.patch
  • packaging/flatpak/shared-modules/libappindicator/patches/0004-libappindicator-fix-crash-iterating-icon-themes.patch
  • src-tauri/Cargo.toml
  • src-tauri/build.rs
  • src-tauri/capabilities/default.json
  • src-tauri/src/lib.rs
💤 Files with no reviewable changes (1)
  • src-tauri/capabilities/default.json

Comment thread packaging/flatpak/app.waveflow.WaveFlow.metainfo.xml
Comment thread packaging/flatpak/app.waveflow.WaveFlow.yaml Outdated
Comment thread src-tauri/build.rs Outdated
InstaZDLL added 2 commits May 26, 2026 11:01
Long-standing Tauri 2 / wry / tauri-bundler issues keep biting us
(GTK3 chrome via webkit2gtk-4.1, AppImage sidecars, etc.). Capture
the active ones, our workarounds, and a sober decision tree for
when to wait / patch out-of-tree / PR upstream / walk away — so the
default reaction stops being "let's fork the whole stack" when
frustration peaks.

Also documents the existing [patch.crates-io] vendor protocol we
already use for glib-0.18.5, so future patches follow the same
audit-friendly layout.
…ty sync

Two narrow fixes from review:

- Drop --device=all from the Flatpak finish-args. The PA socket
  already routes through PipeWire on every modern Linux desktop;
  raw /dev/snd access only buys us nicer device labels in the ALSA
  picker and is exactly the kind of permission Flathub reviewers
  reject on sight.
- Make src-tauri/build.rs panic when it can't write or remove the
  generated updater capability file. A silent miss resurfaced later
  as a tauri-build "unknown permission updater:default" error that
  was painful to map back to its real cause.

Skipped the suggested <internet> change in the AppStream metainfo:
per the spec, offline-only means "does not require internet". WaveFlow
plays local files without any network; Deezer / Last.fm / LRCLIB are
optional enhancements. The suggestion would have inverted the
semantic.
@InstaZDLL InstaZDLL added the scope: docs Docs, README, assets label May 26, 2026
@InstaZDLL InstaZDLL merged commit 5cfa5b4 into main May 26, 2026
14 checks passed
@InstaZDLL InstaZDLL deleted the feat/packaging-flatpak branch May 26, 2026 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: backend Rust/Tauri backend (src-tauri/) scope: deps Dependencies scope: docs Docs, README, assets scope: frontend React/Vite frontend (src/) size: xl > 500 lines type: feat New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant