Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flatpak: build from source #8

Closed

Conversation

cassidyjames
Copy link
Collaborator

This PR adds quite a bit of setup that luckily is mostly set-and-forget. It's the "technically more correct" approach compared to #7 (and Flathub prefers compiling from source versus downloading binaries), but I don't love it as it requires compiling all of Godot Engine just to export the PCK file when we'd want to update the Flatpak—it isn't the end of the world, but seems like overkill and just makes it take longer.

The gist is:

  • export/flatpak/net.hhoney.rota.json is your game's Flatpak manifest; it's what tells Flatpak Builder how to actually package your app as a Flatpak

  • export/flatpak/modules/ contains build dependencies that are referenced in the manifest; things like Godot Engine itself and its dependencies

  • The manifest's build-commands step walks through the actual process:

    1. Copy the Godot Engine export templates into the expected place
    2. Use the Godot Engine CLI with --export-pack to just export the PCK file
    3. "Install" the required files into the correct directories within the Flatpak

I think the alternative approach of #7 of automatically exporting the PCK file in CI when you make a release is perfectly reasonable, and is similar to what other (albeit possibly closed source) Godot Engine games do. It's less reproducible from source code and it requires exporting the PCK file out of band from the Flatpak build (and making releases on GitHub), but it feels a lot simpler.

Either way, the manifest contents in this repo are really more for testing and reference, as a manifest needs to be submitted to Flathub as a PR; I can get that started for you and make sure you get added as the maintainer, and we'll probably get some good feedback from people who know more about Flatpak than me!

I'll also ask around in the Flatpak and Flathub Matrix chat rooms to get a second opinion; I know there has been talk of improving the process of packaging Godot Engine games, and maybe this is the push it takes to get that to happen. 😁

Full disclosure that this PR as-is is probably not ready—I'm almost certain we should include some cleanup rules in the manifest to prevent shipping build dependencies in the final Flatpak.

@cassidyjames
Copy link
Collaborator Author

The feedback I got from Flathub folks is that building Godot Engine from source and using that to export the PCK is unnecessary; exporting the PCK in CI upon release (like we have set up) is reasonable and the recommended approach, thanks to the "BaseApp" that Flathub has which only requires a PCK file to Flatpak the game.

As such, I'll close this PR—but this branch itself may still be of interest to anyone deploying a Godot game Flatpak somewhere other than Flathub.

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.

1 participant