Skip to content

Prepare repo for Flathub build process#2093

Open
TB516 wants to merge 82 commits intoebkr:developfrom
TB516:develop
Open

Prepare repo for Flathub build process#2093
TB516 wants to merge 82 commits intoebkr:developfrom
TB516:develop

Conversation

@TB516
Copy link
Copy Markdown
Contributor

@TB516 TB516 commented Mar 17, 2026

Prepare r2modman repository for Flathub build processes

This PR updates the current Flatpak build process to mirror the one used by Flathub, adding and changing the files needed to do this. This will be a large step toward completing #729.

App changes

Changes to the actual runtime behavior of the app

  • Added a guard to the auto updater to skip checking for/applying updates when the app is running as a Flatpak

Project changes

Changes to the project structure/repo and CI

  • Updated mise to add python/pipx as a project tool (needed to install flatpak-node-generator)
  • Added Flatpak-related files to the flatpak directory
    • io.github.ebkr.r2modman.yaml is the Flatpak manifest that contains the instructions to build the Flatpak
    • io.github.ebkr.r2modman.metainfo.xml is the appstream metadata used by storefronts
    • io.github.ebkr.r2modman.desktop is the .desktop file that is used to launch the Flatpak
    • io.github.ebkr.r2modman is a launch script that is used to run the r2modman binary inside of the Flatpak
    • generate-release-manifest.js is a quick script to take the manifest that is in the git repo, and update the flatpak sources to pull from git instead of using the local file system

Documentation

  • Added images of r2modman to the docs directory, which will be used in the Flathub metainfo

Build config

  • Removed previous Flatpak building config from quasar and package.json
  • Added a script to build an unpackaged Linux build (built with electron binaries, but not packaged into a distribution format)
  • Added a script to generate a modified Flatpak manifest file that can be used on Flathub & other CI runners
  • Added a script to generate generated-sources.json, a mapping of yarn lockfile deps to flatpak sources
  • Added a script (and helper scripts) to build r2modman as a Flatpak

CI

  • Removed old flatpak build step from build workflow and release workflow
  • Added a new build-flatpak workflow to run a standalone flatpak build using the new manifest
  • Added a new job to the release workflow that builds and releases a standalone r2modman.flatpak file using the new manifest and flatpak-builder (mimicks how Flathub would build the app)

What's missing

Currently, this PR doesn't have any workflows to automatically update the Flathub repo, as the submission hasn't started yet. If/once r2modman is accepted, then workflows can be added to push the generated manifest and the other files in the Flatpak directory to the Flathub repo.

@TB516
Copy link
Copy Markdown
Contributor Author

TB516 commented Mar 18, 2026

I addressed some of the smaller issues. For building a standalone flatpak file, im going to bring the conversation over to the Discord for better communication, but here is a quick summary of my thoughts: if we still want to build a standalone flatpak file, I think the best approach would be to add a job to the release worklfow that uses flatpak-builder to build from the flathub manifest, as that would make sure that our standalone flatpak file is the same as the one people would get from flathub, and ensure there isnt any drift between the two.

@TB516 TB516 marked this pull request as draft March 19, 2026 07:20
@TB516
Copy link
Copy Markdown
Contributor Author

TB516 commented Mar 19, 2026

Moving this to draft while the changes are being addressed.

@WesCook
Copy link
Copy Markdown

WesCook commented Apr 6, 2026

I just want to say that I'm looking forward to having r2modman available via flatpak. It should make modding certain games on immutable Linux much easier. Thanks for your efforts, Thomas and Cade.

@TB516
Copy link
Copy Markdown
Contributor Author

TB516 commented Apr 6, 2026

Made the changes to generate the node sources locally with flatpak-node-generator, and updated the scripts to build a local version instead of building and installing it. I added some helper scripts to do this, and added python/pipx as a dependency in mise as it is probably the easiest way to get flatpak-node-generator for development.

I wana make a note that while for local dev, yarn build-flatpak is used, im still using the flatpak/flatpak-github-actions/flatpak-builder action in CI because it takes care of a few extra steps that aren't needed for locally building the flatpak.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants