Page 1 of 3

I packaged the game as a flatpak

Posted: Sun May 25, 2025 7:33 am
by sharpenedblade
I managed to get the base game (but not OoliteStarter yet) working as a flatpak. The game would not compile on Fedora 42 for me because of incompatible library versions, but works as a flatpak. This also fixes https://github.com/OoliteProject/oolite/issues/471 since the flatpak bundles libgnustep-base 1.28. 1.90 and the latest 1.91 commit both work, its just one line in the manifest file to change the oolite commit. Only the ~/GNUstep and ~/oolite-save directories are accessible by oolite, any other filesystem paths (outside of the XDG env vars) will be lost when restarting the game. The code is at https://github.com/sharpenedblade/flath ... add-oolite, I didn't submit it to flathub yet because I wanted to ask if it is okay to submit to flathub and if there is anything that needs to be changed in the metadata file.

Re: I packaged the game as a flatpak

Posted: Sun May 25, 2025 8:18 am
by Cholmondely
sharpenedblade wrote: Sun May 25, 2025 7:33 am
I managed to get the base game (but not OoliteStarter yet) working as a flatpak. The game would not compile on Fedora 42 for me because of incompatible library versions, but works as a flatpak. This also fixes https://github.com/OoliteProject/oolite/issues/471 since the flatpak bundles libgnustep-base 1.28. 1.90 and the latest 1.91 commit both work, its just one line in the manifest file to change the oolite commit. Only the ~/GNUstep and ~/oolite-save directories are accessible by oolite, any other filesystem paths (outside of the XDG env vars) will be lost when restarting the game. The code is at https://github.com/sharpenedblade/flath ... add-oolite, I didn't submit it to flathub yet because I wanted to ask if it is okay to submit to flathub and if there is anything that needs to be changed in the metadata file.
Well done!

Re: I packaged the game as a flatpak

Posted: Sun May 25, 2025 8:45 am
by another_commander
This is really great, congrats for reviving the Linux port.

I cannot comment on the pack itself as I am not using Linux, but probably one or more of our Linux users will be able to verify the functionality and contents of the package.

Looking forward to seeing it on flathub.

Re: I packaged the game as a flatpak

Posted: Sun May 25, 2025 9:22 am
by MrFlibble
sharpenedblade wrote: Sun May 25, 2025 7:33 am
I managed to get the base game (but not OoliteStarter yet) working as a flatpak.
Great!

Clues appreciated for faster testing.

I've got a range of distros to hand, and would be delighted to test this on a few. I can give a large chunk of tomorrow to that.

Re: I packaged the game as a flatpak

Posted: Sun May 25, 2025 8:22 pm
by sharpenedblade
You can build and install the flatpak locally by running:

Code: Select all

git clone --recurse-submodules --branch add-oolite https://github.com/sharpenedblade/flathub
cd flathub
# Uncomment for 1.91
# sed -i "s/0b1ff49a78653669bfe8e153ae09699ba49cc496/dc597d5c51923e7210b39e83375b156cb08dfb01/g" space.oolite.oolite.yml
flatpak install flathub org.flatpak.Builder
flatpak run org.flatpak.Builder --force-clean --sandbox --user --install --install-deps-from=flathub --ccache --repo=repo builddir space.oolite.oolite.yml
The save data will be in $HOME/.var/app/space.oolite.oolite/oolite-saves. OXPs go in $HOME/.var/app/space.oolite.oolite/GNUstep/Library/ApplicationSupport/Oolite/ManagedAddOns/.

PS: I couldn't find the file to change the OXP url for 1.90, is the location on the wiki the right one for Linux?

Re: I packaged the game as a flatpak

Posted: Sun May 25, 2025 8:44 pm
by Cholmondely
sharpenedblade wrote: Sun May 25, 2025 8:22 pm
I couldn't find the file to change the OXP url for 1.90, is the location on the wiki the right one for Linux?
It is the same for Linux, Windows and AppleMac. And anything else one can get to play Oolite, I presume!

Re: I packaged the game as a flatpak

Posted: Sun May 25, 2025 8:51 pm
by sharpenedblade
And its submitted now https://github.com/flathub/flathub/pull/6544, barring any reviews it should be on flathub soon. Only 1.90 is published since flathub doesn't accept development releases but building 1.91 locally is easy enough. It's possible to build a .flatpak file with the other linux binaries in the "nightly" CI, should I make a PR to do that?

Re: I packaged the game as a flatpak

Posted: Sun May 25, 2025 8:51 pm
by sharpenedblade
Cholmondely wrote: Sun May 25, 2025 8:44 pm
sharpenedblade wrote: Sun May 25, 2025 8:22 pm
I couldn't find the file to change the OXP url for 1.90, is the location on the wiki the right one for Linux?
It is the same for Linux, Windows and AppleMac. And anything else one can get to play Oolite, I presume!
I looked under the directory the wiki says the file should be under and I can only find `oolite.plist`

Re: I packaged the game as a flatpak

Posted: Sun May 25, 2025 10:31 pm
by phkb
sharpenedblade wrote: Sun May 25, 2025 8:51 pm
I looked under the directory the wiki says the file should be under and I can only find `oolite.plist`
You'll need to have run the game at least once for the file to appear, I believe.

Re: I packaged the game as a flatpak

Posted: Sun May 25, 2025 11:09 pm
by sharpenedblade
I ran the game quite a few times now, all of the other files are created. Im not sure if its just me, or if its a bug in the flatpak. Can someone run the flatpak and check if the file is created, and also make sure the file is created with the native build. It might be that GNUstep isn't working right inside a sandbox or that I didn't pass the right options when compiling it.

Re: I packaged the game as a flatpak

Posted: Mon May 26, 2025 4:29 am
by hiran
sharpenedblade wrote: Sun May 25, 2025 8:51 pm
It's possible to build a .flatpak file with the other linux binaries in the "nightly" CI, should I make a PR to do that?
Definitive yes!

While I do understand a repository for flatpack prefers only stable releases we need a way to test what would be submitted. So I'd be wondering why the flatpack build instructions should be hosted anywhere outside the OoliteProject.

Re: I packaged the game as a flatpak

Posted: Mon May 26, 2025 2:30 pm
by MrFlibble
First: A perhaps naive question from a user who only touches on FlatPak from time to time: For 1.91, couldn't we build the flatpak on github, and never mind flathub?

Second: My first stab at building this on LinuxMint 21.3 (which still supports my older nVidia card on a test machine) fail thus:

Code: Select all

flibble@RedDwarf:~/Oolite-scripts/flathub/flathub$ flatpak run org.flatpak.Builder --force-clean --sandbox --user --install --install-deps-from=flathub --ccache --repo=repo builddir space.oolite.oolite.yml

** (flatpak-builder:2): ERROR **: 15:23:34.067: Failed to load included manifest (/home/flibble/Oolite-scripts/flathub/flathub/shared-modules/SDL/sdl12-compat.json): Failed to open file “/home/flibble/Oolite-scripts/flathub/flathub/shared-modules/SDL/sdl12-compat.json”: No such file or directory
The shared-modules directory was automatically created, but is empty.

Edit. Same on Linuxmint 22.1.

Re: I packaged the game as a flatpak

Posted: Mon May 26, 2025 6:19 pm
by sharpenedblade
shared-modules is a git submodule, you need to run

Code: Select all

git submodule update --init

Re: I packaged the game as a flatpak

Posted: Mon May 26, 2025 6:23 pm
by sharpenedblade
hiran wrote: Mon May 26, 2025 4:29 am
sharpenedblade wrote: Sun May 25, 2025 8:51 pm
It's possible to build a .flatpak file with the other linux binaries in the "nightly" CI, should I make a PR to do that?
Definitive yes!

While I do understand a repository for flatpack prefers only stable releases we need a way to test what would be submitted. So I'd be wondering why the flatpack build instructions should be hosted anywhere outside the OoliteProject.
Flathub only lets some projects host the manifest outside of the flathub org (right now I think its only firefox and OBS), I don't think they will let us. I was going to copy the whole flatpak repo and put it somewhere in the oolite source tree, and then whenever there is a release copy any changes back to the flathub repo.

Edit: Flatpak repos are ostree repos and github doesn't have any way of hosting those, so users will have to manually download the .flatpak file for updates, which is why the stable release needs to be on flathub to get updates.

Re: I packaged the game as a flatpak

Posted: Mon May 26, 2025 6:52 pm
by MrFlibble
sharpenedblade wrote: Mon May 26, 2025 6:19 pm
shared-modules is a git submodule, you need to run

Code: Select all

git submodule update --init
Thanks. That got me a tiny bit further.

I'm running these commands to build now:

Code: Select all

git clone --branch add-oolite https://github.com/sharpenedblade/flathub
cd flathub
git submodule update --init
sed -i "s/0b1ff49a78653669bfe8e153ae09699ba49cc496/dc597d5c51923e7210b39e83375b156cb08dfb01/g" space.oolite.oolite.yml
sudo flatpak install flathub org.flatpak.Builder
flatpak run org.flatpak.Builder --force-clean --sandbox --user --install --install-deps-from=flathub --ccache --repo=repo builddir space.oolite.oolite.yml
Though the build still fails.

Code: Select all

$ flatpak run org.flatpak.Builder --force-clean --sandbox --user --install --install-deps-from=flathub --ccache --repo=repo builddir space.oolite.oolite.yml
Dependency Sdk: org.freedesktop.Sdk 24.08
Installing org.freedesktop.Sdk/x86_64/24.08 from flathub
error: No remote refs found similar to ‘flathub’
Error installing deps: running `flatpak --user install -y --noninteractive flathub org.freedesktop.Sdk/x86_64/24.08`: Child process exited with code 1
If I do a sudo -iH, then cd into the same dir and run the build part, I get this:

Code: Select all

# flatpak run org.flatpak.Builder --force-clean --sandbox --user --install --install-deps-from=flathub --ccache --repo=repo builddir space.oolite.oolite.yml
Dependency Sdk: org.freedesktop.Sdk 24.08
Installing org.freedesktop.Sdk/x86_64/24.08 from flathub
Error installing deps: running `flatpak --user install -y --noninteractive flathub org.freedesktop.Sdk/x86_64/24.08`: Cannot autolaunch D-Bus without X11 $DISPLAY
I've tried the usual 'copy Xauthority into /root' trick, other Xclients like xclock run from the sudo shell just fine and DISPLAY is set to :0.0 as expected.