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

Manifest: Build Godot Engine from source #12

Closed

Conversation

cassidyjames
Copy link

@cassidyjames cassidyjames commented Dec 13, 2024

Opening more for your reference than suggesting you merge this; builds take a long time on my local machine… but if you can't ship the Godot Engine binary in our app without compiling it first, this is probably the only option unless/until elementary/appcenter-reviews#542 is tackled (or if you switch to Flathub and include the elementary stylesheet/icons in your manifest, instead).

Test with:

flatpak run org.flatpak.Builder --force-clean --sandbox --user --install --install-deps-from=appcenter --ccache --repo=repo builddir com.github.elliegames.sanctify-game.yml

The first build will take a long time, but Flatpak Builder does cache the result, so later builds are much faster.

@cassidyjames cassidyjames changed the base branch from main to godot-flatpak December 13, 2024 09:09
Copy link
Contributor

@davidmhewitt davidmhewitt left a comment

Choose a reason for hiding this comment

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

Hey @cassidyjames, nice work! I hadn't realised you were working on Godot Flatpak packaging too. If I'd known, I could have saved myself some time 😆

I've left a few comments here about improvements I think you could make in case they're useful to any other manifests where you're doing something similar.

x86_64:
env:
# Only enable when targeting x86_64 (causes issues on other architectures)
SCONS_FLAGS_EXTRA: production=yes
Copy link
Contributor

Choose a reason for hiding this comment

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

If you only use production=yes for the template_release build and not the editor, you'll probably get a slight build speedup. Since the editor executable isn't included in the final flatpak, it probably doesn't need to be optimized.

Copy link
Author

Choose a reason for hiding this comment

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

Good call, thanks!

Comment on lines +44 to +54
- name: glu
buildsystem: meson
sources:
- type: archive
url: https://archive.mesa3d.org/glu/glu-9.0.3.tar.xz
sha256: bd43fe12f374b1192eb15fe20e45ff456b9bc26ab57f0eee919f96ca0f8a330f
cleanup:
- /include
- /lib/*.a
- /lib/*.la
- /lib/pkgconfig
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- name: glu
buildsystem: meson
sources:
- type: archive
url: https://archive.mesa3d.org/glu/glu-9.0.3.tar.xz
sha256: bd43fe12f374b1192eb15fe20e45ff456b9bc26ab57f0eee919f96ca0f8a330f
cleanup:
- /include
- /lib/*.a
- /lib/*.la
- /lib/pkgconfig

AFAICT, this is no longer required to build godot: godotengine/godot@587826f

Copy link
Author

Choose a reason for hiding this comment

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

Ah, interesting. It's still included in the Flathub BaseApp manifest; I've reported that here: flathub/org.godotengine.godot.BaseApp#47


build-commands:
# Export the PCK file and install it alongside the Godot Engine runner
- godot-tools --path sanctify --headless --verbose --export-pack "Linux" ${FLATPAK_ID}.pck
Copy link
Contributor

Choose a reason for hiding this comment

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

If you --export here instead of --export-pack, and pass /app/bin/${FLATPAK_ID} as the dest, you can export the .pck and the correctly named executable at the same time, meaning you don't have to export the executable as part of the godot module above, allowing cleanup: [*], which maybe makes that module a bit cleaner to drop into other manifests.

Copy link
Contributor

Choose a reason for hiding this comment

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

Doesn't --export require export templates? Or is that produced as part of the godot build step?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, the previous module sets up the export template.

I'm using --export in my PR and it's tested and working.

Copy link
Author

Choose a reason for hiding this comment

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

@davidmhewitt ah yeah, I was coming from the Flathub world where a BaseApp provides the runner, so you only provide the PCK file. But of course if you're building it all from source anyway… this makes sense.

@cassidyjames
Copy link
Author

I think @davidmhewitt's #13 is a bit smarter, so I'll close this in favor of that. Sorry for stepping on each others' toes, but it was a fun learning exercise for me nonetheless. And I'm happy there are more people out there getting familiar with Godot×Flatpak. <3

@SubhadeepJasu
Copy link
Contributor

Thanks a lot @cassidyjames . It really means a lot. I'll incorporate some of the other changes that you made in the other PR as well.

@cassidyjames cassidyjames deleted the godot-from-source branch December 17, 2024 17:34
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.

3 participants