ZDoom / Raze

Build engine port backed by GZDoom tech. Currently supports Duke Nukem 3D, Blood, Shadow Warrior, Redneck Rampage and Powerslave/Exhumed.
691 stars 59 forks source link

[Feature] Please make a flatpak package for Linux #403

Open CamJRP opened 3 years ago

CamJRP commented 3 years ago

I know that this is asking too much, but could anyone please make a Flatpak package in the near future. That would help a lot to the Linux adoption of this awesome source port.

Cacodemon345 commented 3 years ago

I don't think Flatpak is the right solution here. AppImage is, since you can dynamically link with system GTK without fusing it into the executable and thus don't run into issues with theme mismatch due to differing GTK versions.

coelckers commented 3 years ago

Please let's not start philosophical debates about which app distribution format is better. From past experience I can tell that these discussions never end well because too much personal bias gets into the discussion. One more such post and they'll all get deleted!

CamJRP commented 3 years ago

Please let's not start philosophical debates about which app distribution format is better. From past experience I can tell that these discussions never end well because too much personal bias gets into the discussion. One more such post and they'll all get deleted!

I don't think this is a philosophical debate, i'm just proposing a way to facilitate linux adoption of the source port. It could be flatpak or appimage, i really don't care

coelckers commented 3 years ago

I was addressing Cacodemon who brought in that "opinion" nonsense.

Cacodemon345 commented 3 years ago

TBH, I don't really care. It's ultimately going to be the developers' decision about whether to make use of Linux app packaging and if so, which format to use.

Gaerzi commented 3 years ago

As far as I know, there's no obstacle to supporting both Flatpak and AppImage, so supporting Flatpak now doesn't preclude also supporting AppImage later. It's not really a choice to make. (Cue Mia Agraviador.)

Calinou commented 3 years ago

For reference, GZDoom already has a Flatpak: https://flathub.org/apps/details/org.zdoom.GZDoom Its source code is here: https://github.com/flathub/org.zdoom.gzdoom

It shouldn't be too difficult to do the same for Raze. I'll start looking into it :slightly_smiling_face:

https://github.com/Calinou/org.zdoom.Raze (not working yet)

Calinou commented 3 years ago

Some progress: The Flatpak builds and runs, but it can't find game data, even if I install it to ~/.var/app/org.zdoom.Raze/.config/raze/duke/DUKE3D.GRP (with DUKE.RTS besides it). I've also tried command line arguments to force specific paths to no avail (even when --filesystem=host is added).

Note that the expected path is ~/.var/app/org.zdoom.Raze/.config with .config, not config. (I'm not sure why this is the case.)

I've tested the GZDoom Flatpak which uses the same logic to sandbox and place files, and it works there.

cc @Eonfge

CamJRP commented 3 years ago

Some progress: The Flatpak builds and runs, but it can't find game data, even if I install it to ~/.var/app/org.zdoom.Raze/.config/raze/duke/DUKE3D.GRP (with DUKE.RTS besides it). I've also tried command line arguments to force specific paths to no avail (even when --filesystem=host is added).

Note that the expected path is ~/.var/app/org.zdoom.Raze/.config with .config, not config. (I'm not sure why this is the case.)

I've tested the GZDoom Flatpak which uses the same logic to sandbox and place files, and it works there.

cc @Eonfge

Thanks a lot. Maybe Flatseal could solve the problem.

Unrud commented 2 years ago

Some progress: The Flatpak builds and runs, but it can't find game data

It can't find raze.pk3. The path /app/share/games/raze is not in FileSearch.Directories.

The paths that are added to the default configuration are here:

https://github.com/coelckers/Raze/blob/b6eadbccb5c733c7710ca8651e8e934a276eab6a/source/core/gameconfigfile.cpp#L135-L142

Note that the expected path is ~/.var/app/org.zdoom.Raze/.config with .config, not config. (I'm not sure why this is the case.)

Because XDG_CONFIG_HOME is not respected. It uses $HOME/.config.

The wrapper script with raze +fluid_patchset /app/share/sounds/sf2/raze.sf2 ... is not required if you install raze.sf2 to a path in SoundfontSearch.Directories.

The paths that are added to the default configuration are here:

https://github.com/coelckers/Raze/blob/b6eadbccb5c733c7710ca8651e8e934a276eab6a/source/core/gameconfigfile.cpp#L158-L162

mjr4077au commented 1 year ago

Some progress: The Flatpak builds and runs, but it can't find game data, even if I install it to ~/.var/app/org.zdoom.Raze/.config/raze/duke/DUKE3D.GRP (with DUKE.RTS besides it). I've also tried command line arguments to force specific paths to no avail (even when --filesystem=host is added).

Note that the expected path is ~/.var/app/org.zdoom.Raze/.config with .config, not config. (I'm not sure why this is the case.)

I've tested the GZDoom Flatpak which uses the same logic to sandbox and place files, and it works there.

cc @Eonfge

@Calinou if you didn't mind adding this again, I added some code to specify SYSTEMINSTALL (i.e. it's a packaged app) in 0033826544c8905883283e5193cb5cdaed9c80c8. Between that, overridding CMAKE_INSTALL_PREFIX and overriding INSTALL_PK3_PATH, you should be able fix your "couldn't find data" issue, hopefully.

Calinou commented 1 year ago

@mjr4077au Thanks!

I've pushed an update: https://github.com/Calinou/org.zdoom.Raze

However, Raze still loads game data from my $HOME/.config/raze/ (when it should be using the Flatpak-specific $HOME/.var/app/org.zdoom.Raze/config/raze/ instead).

What's very strange is that even if I move $HOME/.config/raze/ to another folder (so Raze can't find it), Raze is still able to load while printing the path of $HOME/.config/raze/ as the game data location…

I've double-checked $HOME/.var/app/org.zdoom.Raze/ and it doesn't contain any Raze data folder that I may have manually created in the past.

mjr4077au commented 1 year ago

You're going to have to patch the locations in gameconfigfile.cpp to remove what you don't want and add what you do want.

For ZMusic, you'll have to patch where you're storing the soundfont. A similar patch used in Arch Linux is here: https://aur.archlinux.org/cgit/aur.git/tree/0001-Use-correct-soundfont-path.patch?h=zmusic-git

parherman commented 1 year ago

@Calinou

Maybe paths in source/common/platform/posix/unix/i_specialpaths.cpp needs to be patched as well?

Or maybe you could use configure --prefix $HOME? (found in the ChangeLog)

I made a test build with your repo + update commits, updated runtime and - --filesystem=xdg-config/raze:create and it runs fine here!

smirnov commented 7 months ago

I've updated the version and built myself a working flatpak version here: https://github.com/smirnov/org.zdoom.Raze

Would any of the devs object if I put it up on Flathub?

smirnov commented 6 months ago

Just as a small update, Raze is now available on Flathub, I hope noone minds, if any of the devs have anything against that or would like to be owner/collaborator - please let me know. I'm happy to keep maintaining for the foreseeable future, but do not intend to "hijack" the project representation.

Eonfge commented 6 months ago

I've never actually played Duke Nukem so perhaps this is the excuse I need. Either way, it's cool that somebody finally had the time and energy to see this though. Congratulations.

The hardest part is done, it now comes down to maintenance.

bobberb commented 5 months ago

@smirnov thank you for your effort in stepping up to maintain. I have already placed a new Issue in your honor :D !

CamJRP commented 5 months ago

Thanks a lot to everyone involved in supporting the flatpak. I just installed it in my debian machine, but is not able to find the game data. Anyone knows how to fix this problem?

smirnov commented 5 months ago

You can place the data in ~/.var/app/org.zdoom.Raze/.config/raze/ or use flatpak override org.zdoom.Raze --filesystem=/OTHER/LOCATION/WITH/GRPS --user

Calinou commented 5 months ago

@coelckers This issue can be closed now, as issues specific to the Flatpak distribution should be reported on https://github.com/flathub/org.zdoom.Raze.