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: 20
Joined: Thu Nov 09, 2023 11:05 pm

Re: I packaged the game as a flatpak

Post by sharpenedblade »

This looks like your flatpak is broken, I don't think its related to oolite specifically
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 9:04 pm
This looks like your flatpak is broken, I don't think its related to oolite specifically
Your flatpak :lol: I'm just trying to build it, and for some reason, failing.

I get exactly the same issues on a second machine running LinuxMint 22.1. The first was 21.3.

I've tried several times, including of course deleting and starting over. On both I have successfully installed various things from flathub.
User avatar
Stormrider
Deadly
Deadly
Posts: 242
Joined: Sat Jan 25, 2014 2:35 am
Location: At work

Re: I packaged the game as a flatpak

Post by Stormrider »

MrFlibble wrote: Tue May 27, 2025 1:11 pm
I get exactly the same issues on a second machine running LinuxMint 22.1. The first was 21.3.
I get the same result with LinuxMint 20.3. Flatpak is part of Mint's default package management system so if it is broken it would be by the developers of Mint.
I've got other flatpaks installed and they seem to work fine.
Image
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 »

Stormrider wrote: Tue May 27, 2025 4:31 pm
MrFlibble wrote: Tue May 27, 2025 1:11 pm
I get exactly the same issues on a second machine running LinuxMint 22.1. The first was 21.3.
I get the same result with LinuxMint 20.3. Flatpak is part of Mint's default package management system so if it is broken it would be by the developers of Mint.
Flatpak is not an essential part of LinuxMint. The flatpak package is from Ubuntu. The update manager (mintupdate) can (optionally) update installed Flatpaks (default on), and the software manager will list Flatpaks. Most of the Flatpak gubbins (all bar xdg-desktop-portal) can be removed without issue. On setups which won't need it, I rip it out for one less update.

Code: Select all

Package: flatpak
Architecture: amd64
Version: 1.12.7-1
Priority: optional
Section: universe/admin
Origin: Ubuntu
Maintainer: Ubuntu Developers <[email protected]>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Stormrider wrote: Tue May 27, 2025 4:31 pm
I've got other flatpaks installed and they seem to work fine.
Installing stuff works fine with Flatpak on all versions for me too. The issue is with building, not installing. I'd have thought that any issue with Flatpak on LinuxMint would likely not affect three versions spanning several years. Is it possible there's an issue with your source that only manifests on certain systems, or on "not your" setup?

To get and test the 1.91 Oolite Flatpak, I need to build it. I don't mind that at all, as it'll mean I can update at the drop of a hat, and it may also help me improve my fork where I'm trying to nail down better library bundles for the old-school installer.

Assuming LinuxMint has a broken Flatpak build system, what distro and version did your instructions successfully build the Flatpak on? I can always conjure a VM for the purpose. I'll worry about delving into any LinuxMint buggyness later.
sharpenedblade
Above Average
Above Average
Posts: 20
Joined: Thu Nov 09, 2023 11:05 pm

Re: I packaged the game as a flatpak

Post by sharpenedblade »

The error on your system is coming from `org.flatpak.builder`, which is a upstream project that should work. I think what happened is that mint does not configure flathub as a user level remote, so you need to run this, then build as a normal user without using sudo.

Code: Select all

flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo --user
I built it on fedora 42, but it also worked on the ubuntu-latest github runner.

These are the instuructions from upstream: https://docs.flatpak.org/en/latest/first-build.html and https://docs.flatpak.org/en/latest/flatpak-builder.html
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: Tue May 27, 2025 9:12 pm
The error on your system is coming from `org.flatpak.builder`, which is a upstream project that should work. I think what happened is that mint does not configure flathub as a user level remote, so you need to run this, then build as a normal user without using sudo.

Code: Select all

flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo --user
I built it on fedora 42, but it also worked on the ubuntu-latest github runner.

These are the instuructions from upstream: https://docs.flatpak.org/en/latest/first-build.html and https://docs.flatpak.org/en/latest/flatpak-builder.html
Cool beans! That got it. Thank you. I'd tried a variant of the remote-add, but IIRC not with '--user'.

So, for anyone wanting to build, this worked for me:

Code: Select all

flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo --user
sudo flatpak install flathub org.flatpak.Builder
git clone --branch add-oolite https://github.com/sharpenedblade/flathub
cd flathub
git submodule update --init
# for 1.91
sed -i "s/0b1ff49a78653669bfe8e153ae09699ba49cc496/dc597d5c51923e7210b39e83375b156cb08dfb01/g" space.oolite.oolite.yml
flatpak run org.flatpak.Builder --force-clean --sandbox --user --install --install-deps-from=flathub --ccache --repo=repo builddir space.oolite.oolite.yml
Got to go do some things, but when I get back I'll throw the fresh flatpak at as many distros as I can muster.
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 »

So far so good.

An issue:
I built 1.91 flatpack on LinuxMint 21.3. It runs as expected, and the window shows 1.91, however the one line of sed to change the build to 1.91 may need enhancing, as the flatpak is listed as 1.90 using "flatpak list"

A request:
Is it trivial to tweak this to build the 'test' and/or debug variants of 1.91?

A road block:
I'm looking for a way to easily test this across different distros without building 'per-host'. If you know a quick and painless way to achieve that from my local build, please let me know. I've tried fudging my way there with flatpak create-usb, but I'm clearly not grokking something.

Code: Select all

flatpak remote-modify --collection-id=org.oolite.Oolite oolite-origin
flatpak remote-modify --collection-id=org.flathub.Stable flathub
flatpak update
flatpak create-usb /tmp/flat space.oolite.oolite
And to install on "other-box", either use a USB stick (as flatpak will search mounts for .ostree, or as I did, make a symlink to the files.

Code: Select all

sudo mkdir -p /.ostree/repos.d
sudo ln -s /tmp/flat/.ostree/repo /.ostree/repos.d/myrepo
flatpak remote-add --user oolite-origin org.oolite.Oolite
flatpak update
flatpak install oolite
Looking for matches…
F: An error was encountered searching remote ‘oolite-origin’ for ‘space.oolite.oolite’: Unable to load summary from remote oolite-origin: GPG verification enabled, but no summary found (check that the configured URL in remote config is correct)
error: No remote refs found for ‘space.oolite.oolite’
sharpenedblade
Above Average
Above Average
Posts: 20
Joined: Thu Nov 09, 2023 11:05 pm

Re: I packaged the game as a flatpak

Post by sharpenedblade »

MrFlibble wrote: Wed May 28, 2025 7:41 pm
So far so good.

An issue:
I built 1.91 flatpack on LinuxMint 21.3. It runs as expected, and the window shows 1.91, however the one line of sed to change the build to 1.91 may need enhancing, as the flatpak is listed as 1.90 using "flatpak list"

A request:
Is it trivial to tweak this to build the 'test' and/or debug variants of 1.91?

A road block:
I'm looking for a way to easily test this across different distros without building 'per-host'. If you know a quick and painless way to achieve that from my local build, please let me know. I've tried fudging my way there with flatpak create-usb, but I'm clearly not grokking something.

Code: Select all

flatpak remote-modify --collection-id=org.oolite.Oolite oolite-origin
flatpak remote-modify --collection-id=org.flathub.Stable flathub
flatpak update
flatpak create-usb /tmp/flat space.oolite.oolite
And to install on "other-box", either use a USB stick (as flatpak will search mounts for .ostree, or as I did, make a symlink to the files.

Code: Select all

sudo mkdir -p /.ostree/repos.d
sudo ln -s /tmp/flat/.ostree/repo /.ostree/repos.d/myrepo
flatpak remote-add --user oolite-origin org.oolite.Oolite
flatpak update
flatpak install oolite
Looking for matches…
F: An error was encountered searching remote ‘oolite-origin’ for ‘space.oolite.oolite’: Unable to load summary from remote oolite-origin: GPG verification enabled, but no summary found (check that the configured URL in remote config is correct)
error: No remote refs found for ‘space.oolite.oolite’
The version information comes from the space.oolite.oolite.metainfo.xml, you can edit that to change the version. You can build the debug/test builds by opening up the manifest in a text editor and changing the make command. Upstream published documentation for creating .flatpak files (https://docs.flatpak.org/en/latest/sing ... ndles.html), there are a lot of guides online too.
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 »

I had poked around t'internet, but went down the wrong path. Thanks for the pointer. Bundle appears to be the sane way.
All that shenanigans yesterday can be replaced with:-

Code: Select all

flatpak build-bundle flathub/repo oolite-1.91.flatpak space.oolite.oolite
and at the target:-

Code: Select all

flatpak install oolite-1.91.flatpak
Quick. Simple. Sorted!
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6819
Joined: Wed Feb 28, 2007 7:54 am

Re: I packaged the game as a flatpak

Post by another_commander »

May I kindly ask for the 1.91 flatpak file to be uploaded somewhere for additional testing?
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 »

another_commander wrote: Thu May 29, 2025 2:50 pm
May I kindly ask for the 1.91 flatpak file to be uploaded somewhere for additional testing?
I've used the latest prerelease. I tried to make the test version, but I'm in a bit of a rush and don't know the incantations to allow the networking stuff in Flatpak, and I probably guessed the change to the build instructions wrong. Ergo debug may not work.

In flathub/builddir/files/manifest.json line 121 I added test=yes. The flatpak build command seemed to remove it. A subsequent attempt alerted me to hardlinks to that file so I just ran with what I'd done for now.

Here's a link to oolite-1.91.0.7677-250528-09ed63a-test.flatpak which as i said, is not the test version really. The link will self-destruct in 30 days.

Will do another later if I get a better clue how to roll the test version using GNUmakefile
sharpenedblade
Above Average
Above Average
Posts: 20
Joined: Thu Nov 09, 2023 11:05 pm

Re: I packaged the game as a flatpak

Post by sharpenedblade »

You can build using the regular make file, I was just using the GNUMakefile because I wanted to set `strip=no` so flatpak-builder can generate debuginfo files then run strip by itself. I think you edited the wrong file, the manifest is actually at space.oolite.oolite.yml, builddir/ is a temporary cache dir, you can safely delete it and the only change will be that it takes longer to build next time.

There is no network access during flatpak builds, anything that needs to be available at build time needs to be added to the `sources:` list. When I tried to build the debug build there was also a dependency error, I'm going to try to fix that soon.

The flatpak build for 1.91 is uploaded as an artifact to this CI run https://github.com/sharpenedblade/oolit ... 5286007000 (its the same as the pr I made, I just had to fix the submodule paths). Its not the test or debug version, I will post those here once I get them working.

What does the following line do in the Makefile for the test and debug targets? I don't use the AddOns folder after building, the flatpak only copies the oolite.app folder. As far as I can tell everything works fine, is there something subtle that breaks?

Code: Select all

mkdir -p AddOns && rm -rf AddOns/Basic-debug.oxp && cp -rf DebugOXP/Debug.oxp AddOns/Basic-debug.oxp
sharpenedblade
Above Average
Above Average
Posts: 20
Joined: Thu Nov 09, 2023 11:05 pm

Re: I packaged the game as a flatpak

Post by sharpenedblade »

Setting -DOO_OXP_VERIFIER_ENABLED=0 (which is implied by DEPLOYMENT_RELEASE_CONFIGURATION=yes) breaks the build with a linking error for me, switching that flag to 1 makes the compile start working again. I used gcc 15.1.1, it might be that the code is broken on newer toolchains. For now I'm just not setting DEPLOYMENT_RELEASE_CONFIGURATION in the flatpak because the GNUmakefile does not let me override that flag.

Code: Select all

 Linking objc_program oolite ...
/usr/lib/gcc/x86_64-unknown-linux-gnu/14.2.0/../../../../x86_64-unknown-linux-gnu/bin/ld: ./obj.spk/oolite.obj/OOCheckDemoShipsPListVerifierStage.m.o:(.data.rel.ro+0x10): undefined reference to `__objc_class_name_OOFileHandlingVerifierStage'
/usr/lib/gcc/x86_64-unknown-linux-gnu/14.2.0/../../../../x86_64-unknown-linux-gnu/bin/ld: ./obj.spk/oolite.obj/OOModelVerifierStage.m.o:(.data.rel.ro+0x30): undefined reference to `__objc_class_name_OOTextureHandlingStage'
Post Reply