I packaged the game as a flatpak
Moderators: winston, another_commander, Getafix
-
- Above Average
- Posts: 21
- Joined: Thu Nov 09, 2023 11:05 pm
I packaged the game as a flatpak
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.
- Cholmondely
- 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
Well done!sharpenedblade wrote: ↑Sun May 25, 2025 7:33 amI 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.
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?
•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?
-
- Quite Grand Sub-Admiral
- Posts: 6820
- Joined: Wed Feb 28, 2007 7:54 am
Re: I packaged the game as a flatpak
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.
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
Great!sharpenedblade wrote: ↑Sun May 25, 2025 7:33 amI managed to get the base game (but not OoliteStarter yet) working as a flatpak.
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.
-
- Above Average
- Posts: 21
- Joined: Thu Nov 09, 2023 11:05 pm
Re: I packaged the game as a flatpak
You can build and install the flatpak locally by running:
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?
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
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.
- Cholmondely
- 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
It is the same for Linux, Windows and AppleMac. And anything else one can get to play Oolite, I presume!sharpenedblade wrote: ↑Sun May 25, 2025 8:22 pmI couldn't find the file to change the OXP url for 1.90, is the location on the wiki the right one for Linux?
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?
•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?
-
- Above Average
- Posts: 21
- Joined: Thu Nov 09, 2023 11:05 pm
Re: I packaged the game as a flatpak
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?
-
- Above Average
- Posts: 21
- Joined: Thu Nov 09, 2023 11:05 pm
Re: I packaged the game as a flatpak
I looked under the directory the wiki says the file should be under and I can only find `oolite.plist`Cholmondely wrote: ↑Sun May 25, 2025 8:44 pmIt is the same for Linux, Windows and AppleMac. And anything else one can get to play Oolite, I presume!sharpenedblade wrote: ↑Sun May 25, 2025 8:22 pmI couldn't find the file to change the OXP url for 1.90, is the location on the wiki the right one for Linux?
- phkb
- 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
You'll need to have run the game at least once for the file to appear, I believe.sharpenedblade wrote: ↑Sun May 25, 2025 8:51 pmI looked under the directory the wiki says the file should be under and I can only find `oolite.plist`
-
- Above Average
- Posts: 21
- Joined: Thu Nov 09, 2023 11:05 pm
Re: I packaged the game as a flatpak
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.
- 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
Definitive yes!sharpenedblade wrote: ↑Sun May 25, 2025 8:51 pmIt's possible to build a .flatpak file with the other linux binaries in the "nightly" CI, should I make a PR to do that?
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
Re: I packaged the game as a flatpak
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:
The shared-modules directory was automatically created, but is empty.
Edit. Same on Linuxmint 22.1.
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
Edit. Same on Linuxmint 22.1.
-
- Above Average
- Posts: 21
- Joined: Thu Nov 09, 2023 11:05 pm
Re: I packaged the game as a flatpak
shared-modules is a git submodule, you need to run
Code: Select all
git submodule update --init
-
- Above Average
- Posts: 21
- Joined: Thu Nov 09, 2023 11:05 pm
Re: I packaged the game as a flatpak
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.hiran wrote: ↑Mon May 26, 2025 4:29 amDefinitive yes!sharpenedblade wrote: ↑Sun May 25, 2025 8:51 pmIt's possible to build a .flatpak file with the other linux binaries in the "nightly" CI, should I make a PR to do that?
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.
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
Thanks. That got me a tiny bit further.sharpenedblade wrote: ↑Mon May 26, 2025 6:19 pmshared-modules is a git submodule, you need to runCode: Select all
git submodule update --init
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
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
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