I packaged the game as a flatpak

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

Moderators: another_commander, winston, Getafix

sharpenedblade
Competent
Competent
Posts: 41
Joined: Thu Nov 09, 2023 11:05 pm

Re: I packaged the game as a flatpak

Post by sharpenedblade »

I had to use gnustep 1.28, but modern gcc and gnustep-make worked for me. I'm not sure how much stuff from linux-deps ends up being used. By "legacy" I meant that it doesn't follow modern linux desktop conventions and that I don't know any new codebases using it, so there isn't much interest from toolkit/desktop/xdg devs.
sharpenedblade
Competent
Competent
Posts: 41
Joined: Thu Nov 09, 2023 11:05 pm

Re: I packaged the game as a flatpak

Post by sharpenedblade »

MrFlibble, I build your fork as a flatpak (see the flatpak-new-linux-deps branch in my fork) and it looks like it works the same as master when I tested. I don't know if Oolite is using its bundled libs or the "system" (flatpak runtime) libs, is there a way to check?

I could reproduce the mouse capture bug by going into fullscreen, enabling mouse mode, and then leaving fullscreen. Attempting to enable mouse mode outside of fullscreen didn't do anything, which is probably related. This is probably caused by the SDL1->SDL2 compat layer, but using SDL1 directly crashes on startup for me, so I don't know what to do about it.
User avatar
MrFlibble
---- E L I T E ----
---- E L I T E ----
Posts: 507
Joined: Sun Feb 18, 2024 12:13 pm

Re: I packaged the game as a flatpak

Post by MrFlibble »

sharpenedblade wrote: Thu Jul 24, 2025 12:44 am
MrFlibble, I build your fork as a flatpak (see the flatpak-new-linux-deps branch in my fork) and it looks like it works the same as master when I tested. I don't know if Oolite is using its bundled libs or the "system" (flatpak runtime) libs, is there a way to check?
You might use strace to see what's pulled in. It'll need to be inserted in the script that launches the binary.
sharpenedblade
Competent
Competent
Posts: 41
Joined: Thu Nov 09, 2023 11:05 pm

Re: I packaged the game as a flatpak

Post by sharpenedblade »

It was using the bundled libs. Also it still works if I delete every .so file except for libjs_static.a, so thats what im using in the flatpak now because the runtime can keep things up to date automatically.
User avatar
mcarans
---- E L I T E ----
---- E L I T E ----
Posts: 660
Joined: Sun Jun 20, 2010 6:00 pm

Re: flatpak working locally

Post by mcarans »

sharpenedblade wrote: Thu Jul 24, 2025 11:31 pm
It was using the bundled libs. Also it still works if I delete every .so file except for libjs_static.a, so thats what im using in the flatpak now because the runtime can keep things up to date automatically.
Using your work as a starting point (thanks for all you did!), I have managed to get the Oolite flatpak working locally with the modern build. (It is not on flathub.)

I ran the game with flatpak run org.OoliteProject.oolite. Flatpak put the game folders, GNUstep, oolite-saves and .Oolite in ~/.var/app/org.OoliteProject.oolite/. I could save and load a game. I could also add OXPs in the game and an OXP I put in ~/.var/app/org.OoliteProject.oolite/.Oolite/AddOns was correctly loaded.

The Flatpak build file is here:

Code: Select all

https://github.com/mcarans/oolite/blob/flatpak/installers/flatpak/org.OoliteProject.oolite.yaml
sharpenedblade
Competent
Competent
Posts: 41
Joined: Thu Nov 09, 2023 11:05 pm

Re: I packaged the game as a flatpak

Post by sharpenedblade »

The new package is org.ooliteproject.Oolite, but I don't think the domain ooliteproject.org is registered (If I'm wrong and it is actually used by oolite then you can ignore this). Its better to use space.oolite.Oolite because flatpaks are expected to be under a domain that is controlled by the developer, if someone else buys the ooliteproject.org domain and releases a flatpak on flathub under that domain it will cause problems because you can not have multiple flatpaks with the same identifier installed, even if they are from different remotes.
User avatar
mcarans
---- E L I T E ----
---- E L I T E ----
Posts: 660
Joined: Sun Jun 20, 2010 6:00 pm

Re: I packaged the game as a flatpak

Post by mcarans »

sharpenedblade wrote: Tue Dec 23, 2025 11:18 pm
The new package is org.ooliteproject.Oolite, but I don't think the domain ooliteproject.org is registered (If I'm wrong and it is actually used by oolite then you can ignore this). Its better to use space.oolite.Oolite because flatpaks are expected to be under a domain that is controlled by the developer, if someone else buys the ooliteproject.org domain and releases a flatpak on flathub under that domain it will cause problems because you can not have multiple flatpaks with the same identifier installed, even if they are from different remotes.
Thanks, that's helpful to know. I had taken ooliteproject from the GitHub organisation name. I had wondered why you chose space.oolite.Oolite, but that's clear now and I will change to that.
User avatar
mcarans
---- E L I T E ----
---- E L I T E ----
Posts: 660
Joined: Sun Jun 20, 2010 6:00 pm

Re: I packaged the game as a flatpak

Post by mcarans »

sharpenedblade wrote: Tue Dec 23, 2025 11:18 pm
The new package is org.ooliteproject.Oolite, but I don't think the domain ooliteproject.org is registered (If I'm wrong and it is actually used by oolite then you can ignore this). Its better to use space.oolite.Oolite because flatpaks are expected to be under a domain that is controlled by the developer, if someone else buys the ooliteproject.org domain and releases a flatpak on flathub under that domain it will cause problems because you can not have multiple flatpaks with the same identifier installed, even if they are from different remotes.
Flatpak redone including Oolite directly using correct folders (~/.var/space.oolite.Oolite/...) in this PR:
https://github.com/OoliteProject/oolite/pull/536
sharpenedblade
Competent
Competent
Posts: 41
Joined: Thu Nov 09, 2023 11:05 pm

Re: I packaged the game as a flatpak

Post by sharpenedblade »

I haven't actually tested the PR, but I read through the changes and it looks like it should work.
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 7138
Joined: Wed Feb 28, 2007 7:54 am

Re: I packaged the game as a flatpak

Post by another_commander »

We now have flatpak packages in the github pre-releases. Any willing testers?
sharpenedblade
Competent
Competent
Posts: 41
Joined: Thu Nov 09, 2023 11:05 pm

Re: I packaged the game as a flatpak

Post by sharpenedblade »

I tested 1.91.0.7734-260108-81282f8, the actual game is working fine (I tested a new save and the OXP manager), but data isn't persisted across restarts now. Saves are at ~/oolite-saves and the GNUStep folder is at ~/GNUStep (including OXPs at ~/GNUstep/Library/ApplicationSupport/Oolite/ManagedAddOns/), so they are lost when the flatpak exits. By default flatpak only saves XDG_CONFIG_HOME, XDG_DATA_HOME, XDG_CACHE_HOME, and XDG_STATE_HOME which are all paths under ~/.var/app/space.oolite.Oolite.
User avatar
mcarans
---- E L I T E ----
---- E L I T E ----
Posts: 660
Joined: Sun Jun 20, 2010 6:00 pm

Re: I packaged the game as a flatpak

Post by mcarans »

sharpenedblade wrote: Thu Jan 08, 2026 9:07 pm
I tested 1.91.0.7734-260108-81282f8, the actual game is working fine (I tested a new save and the OXP manager), but data isn't persisted across restarts now. Saves are at ~/oolite-saves and the GNUStep folder is at ~/GNUStep (including OXPs at ~/GNUstep/Library/ApplicationSupport/Oolite/ManagedAddOns/), so they are lost when the flatpak exits. By default flatpak only saves XDG_CONFIG_HOME, XDG_DATA_HOME, XDG_CACHE_HOME, and XDG_STATE_HOME which are all paths under ~/.var/app/space.oolite.Oolite.
Please can you see if there are any folders in ~/.var/app/space.oolite.Oolite/. That is where it saves for me. The startup script should detect flatpak and use that folder. ~/oolite-saves, ~/GNUStep etc. are not mapped using persist.

I just downloaded the same version flatpak as you from here, uninstalled any existing Oolite flatpak and then installed from that download. I started the game and installed an addon. I then exited and reloaded the game and the addon was still installed. The addon itself was installed in ~/.var/app/space.oolite.Oolite/.ManagedAddOns/
sharpenedblade
Competent
Competent
Posts: 41
Joined: Thu Nov 09, 2023 11:05 pm

Re: I packaged the game as a flatpak

Post by sharpenedblade »

Saves and OXPs aren't persisted for me. I ran flatpak enter space.oolite.Oolite bash while oolite was running, and everything was saved in $HOME as seen from inside the sandbox.

Code: Select all

❯ flatpak enter space.oolite.Oolite bash
bash-5.3$ ls
GNUstep  oolite-saves
bash-5.3$ ls -R
.:
GNUstep  oolite-saves

./GNUstep:
Defaults  Library

./GNUstep/Defaults:
OoliteDefaults.plist

./GNUstep/Library:
ApplicationSupport  Caches

./GNUstep/Library/ApplicationSupport:
Oolite

./GNUstep/Library/ApplicationSupport/Oolite:
ManagedAddOns

./GNUstep/Library/ApplicationSupport/Oolite/ManagedAddOns:
oolite.oxp.Switeck.Cargo-Contract-Mod.oxz

./GNUstep/Library/Caches:
org.aegidian.oolite

./GNUstep/Library/Caches/org.aegidian.oolite:
Oolite-cache.plist  Oolite-manifests.plist

./oolite-saves:
Jameson.oolite-save
Below is what is actually saved on the host system (I ignored cache because the only thing in there is a bunch of mesa files)

Code: Select all

❯ fd -u . --exclude cache ~/.var/app/space.oolite.Oolite/
/home/abcd/.var/app/space.oolite.Oolite/.ld.so/
/home/abcd/.var/app/space.oolite.Oolite/.ld.so/a6d674d53e3e2e4578fe249edf4441c9d69df7ea5e65a30b2d3d6229c8e23576
/home/abcd/.var/app/space.oolite.Oolite/.ld.so/active
/home/abcd/.var/app/space.oolite.Oolite/.local/
/home/abcd/.var/app/space.oolite.Oolite/.local/state/
/home/abcd/.var/app/space.oolite.Oolite/config/
/home/abcd/.var/app/space.oolite.Oolite/config/pulse/
/home/abcd/.var/app/space.oolite.Oolite/config/pulse/cookie
/home/abcd/.var/app/space.oolite.Oolite/data/
User avatar
mcarans
---- E L I T E ----
---- E L I T E ----
Posts: 660
Joined: Sun Jun 20, 2010 6:00 pm

Re: I packaged the game as a flatpak

Post by mcarans »

sharpenedblade wrote: Fri Jan 09, 2026 4:20 am
Saves and OXPs aren't persisted for me. I ran flatpak enter space.oolite.Oolite bash while oolite was running, and everything was saved in $HOME as seen from inside the sandbox.

Code: Select all

❯ flatpak enter space.oolite.Oolite bash
bash-5.3$ ls
GNUstep  oolite-saves
bash-5.3$ ls -R
.:
GNUstep  oolite-saves

./GNUstep:
Defaults  Library

./GNUstep/Defaults:
OoliteDefaults.plist

./GNUstep/Library:
ApplicationSupport  Caches

./GNUstep/Library/ApplicationSupport:
Oolite

./GNUstep/Library/ApplicationSupport/Oolite:
ManagedAddOns

./GNUstep/Library/ApplicationSupport/Oolite/ManagedAddOns:
oolite.oxp.Switeck.Cargo-Contract-Mod.oxz

./GNUstep/Library/Caches:
org.aegidian.oolite

./GNUstep/Library/Caches/org.aegidian.oolite:
Oolite-cache.plist  Oolite-manifests.plist

./oolite-saves:
Jameson.oolite-save
Below is what is actually saved on the host system (I ignored cache because the only thing in there is a bunch of mesa files)

Code: Select all

❯ fd -u . --exclude cache ~/.var/app/space.oolite.Oolite/
/home/abcd/.var/app/space.oolite.Oolite/.ld.so/
/home/abcd/.var/app/space.oolite.Oolite/.ld.so/a6d674d53e3e2e4578fe249edf4441c9d69df7ea5e65a30b2d3d6229c8e23576
/home/abcd/.var/app/space.oolite.Oolite/.ld.so/active
/home/abcd/.var/app/space.oolite.Oolite/.local/
/home/abcd/.var/app/space.oolite.Oolite/.local/state/
/home/abcd/.var/app/space.oolite.Oolite/config/
/home/abcd/.var/app/space.oolite.Oolite/config/pulse/
/home/abcd/.var/app/space.oolite.Oolite/config/pulse/cookie
/home/abcd/.var/app/space.oolite.Oolite/data/
Please try the following:

flatpak run --command=sh space.oolite.Oolite

then: echo $FLATPAK_ID

Do you see space.oolite.Oolite ?

Then: ls /app/bin

Do you see run_oolite.sh in there? That is what should be executing and setting the environment variables to ~/.var/app/space.oolte.Oolite/...if it finds FLATPAK_ID.

Try launching run_oolite.sh and see if the game persists data to ~/.var/app/space.oolte.Oolite/..

If not, what happens if you do: export GAMEDATA="$HOME/.var/app/$FLATPAK_ID" (which is what the script does) and then launch run_oolite.sh?
sharpenedblade
Competent
Competent
Posts: 41
Joined: Thu Nov 09, 2023 11:05 pm

Re: I packaged the game as a flatpak

Post by sharpenedblade »

It works when explicitly running the wrapper script with flatpak run --command=run_oolite.sh space.oolite.Oolite. I think this is because the .desktop file still uses the oolite binary:

Code: Select all

❯ cat /var/lib/flatpak/app/space.oolite.Oolite/current/active/export/share/applications/space.oolite.Oolite.desktop
[Desktop Entry]
Name=Oolite
Comment=An OpenGL Elite-like space game
Exec=/usr/bin/flatpak run --branch=master --arch=x86_64 --command=oolite space.oolite.Oolite
Icon=space.oolite.Oolite
Terminal=false
Type=Application
Categories=Game;Simulation;
StartupWMClass=oolite
X-Desktop-File-Install-Version=0.28
X-Flatpak=space.oolite.Oolite

Code: Select all

❯ flatpak run --command=sh space.oolite.Oolite
[📦 space.oolite.Oolite ~]$ echo $FLATPAK_ID
space.oolite.Oolite
[📦 space.oolite.Oolite ~]$  ls /app/bin
autogsdoc  defaults   gdomap          HTMLLinker    openapp   pldes    plser          sfparse
classes    espeak     gnustep-config  make_strings  opentool  plget    plutil         speak
cvtenc     espeak-ng  gnustep-tests   notify-send   pl        plmerge  Resources      speak-ng
debugapp   gdnc       gspath          oolite        pl2link   plparse  run_oolite.sh  xmlparse
[📦 space.oolite.Oolite ~]$ /app/bin/run_oolite.sh
2026-01-08 22:01:03.947 oolite[49:50] Truncating thread name 'OOLogOutputHandler logging thread' to 15 characters due to platform limitations
Post Reply