I packaged the game as a flatpak

For discussion of ports to POSIX based systems, especially using GNUStep.

Moderators: winston, another_commander, Getafix

sharpenedblade
Above Average
Above Average
Posts: 21
Joined: Thu Nov 09, 2023 11:05 pm

I packaged the game as a flatpak

Post 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.
User avatar
Cholmondely
Archivist
Archivist
Posts: 6013
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: I packaged the game as a flatpak

Post 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!
Comments wanted:
Missing OXPs? What do you think is missing?
Lore: The economics of ship building How many built for Aronar?
Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6820
Joined: Wed Feb 28, 2007 7:54 am

Re: I packaged the game as a flatpak

Post 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.
User avatar
MrFlibble
---- E L I T E ----
---- E L I T E ----
Posts: 408
Joined: Sun Feb 18, 2024 12:13 pm

Re: I packaged the game as a flatpak

Post 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.
sharpenedblade
Above Average
Above Average
Posts: 21
Joined: Thu Nov 09, 2023 11:05 pm

Re: I packaged the game as a flatpak

Post 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?
Last edited by sharpenedblade on Mon May 26, 2025 6:25 pm, edited 1 time in total.
User avatar
Cholmondely
Archivist
Archivist
Posts: 6013
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: I packaged the game as a flatpak

Post 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!
Comments wanted:
Missing OXPs? What do you think is missing?
Lore: The economics of ship building How many built for Aronar?
Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
sharpenedblade
Above Average
Above Average
Posts: 21
Joined: Thu Nov 09, 2023 11:05 pm

Re: I packaged the game as a flatpak

Post 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?
sharpenedblade
Above Average
Above Average
Posts: 21
Joined: Thu Nov 09, 2023 11:05 pm

Re: I packaged the game as a flatpak

Post 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`
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 5097
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: I packaged the game as a flatpak

Post 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.
sharpenedblade
Above Average
Above Average
Posts: 21
Joined: Thu Nov 09, 2023 11:05 pm

Re: I packaged the game as a flatpak

Post 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.
User avatar
hiran
Theorethicist
Posts: 2449
Joined: Fri Mar 26, 2021 1:39 pm
Location: a parallel world I created for myself. Some call it a singularity...

Re: I packaged the game as a flatpak

Post 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.
Sunshine - Moonlight - Good Times - Oolite
User avatar
MrFlibble
---- E L I T E ----
---- E L I T E ----
Posts: 408
Joined: Sun Feb 18, 2024 12:13 pm

Re: I packaged the game as a flatpak

Post 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.
sharpenedblade
Above Average
Above Average
Posts: 21
Joined: Thu Nov 09, 2023 11:05 pm

Re: I packaged the game as a flatpak

Post by sharpenedblade »

shared-modules is a git submodule, you need to run

Code: Select all

git submodule update --init
sharpenedblade
Above Average
Above Average
Posts: 21
Joined: Thu Nov 09, 2023 11:05 pm

Re: I packaged the game as a flatpak

Post 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.
User avatar
MrFlibble
---- E L I T E ----
---- E L I T E ----
Posts: 408
Joined: Sun Feb 18, 2024 12:13 pm

Re: I packaged the game as a flatpak

Post 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.
Post Reply