winesapOS icon indicating copy to clipboard operation
winesapOS copied to clipboard

Install Lutris as a Flatpak

Open LukeShortCloud opened this issue 2 years ago • 14 comments

Lutris developers are now priorotizing Flatpak support now that they got a Steam Deck about a month ago. It is still in-development. Once it reaches the stable Flathub repository, we should consider switching over to that.

https://www.gamingonlinux.com/2022/04/game-manager-lutris-continues-flatpak-improvements/

I also want to wait until Steam is Flatpak ready as those improvements may be related: https://github.com/LukeShortCloud/winesapOS/issues/328

Related issue (winesapOS switching to using Flatpaks): https://github.com/LukeShortCloud/winesapOS/issues/300

LukeShortCloud avatar Apr 20 '22 19:04 LukeShortCloud

Reports from users suggest that Wine works and most of the lingering issues with the Flatpak are regarding game console emulators which is not a focus for us currently.

LukeShortCloud avatar Apr 30 '22 17:04 LukeShortCloud

https://github.com/flathub/net.lutris.Lutris/issues/198 https://github.com/flathub/net.lutris.Lutris/issues/200 https://github.com/flathub/net.lutris.Lutris/issues/53 (solved)

soredake avatar Jul 02 '22 17:07 soredake

https://github.com/flathub/net.lutris.Lutris/issues/53 are solved now

soredake avatar Aug 30 '22 16:08 soredake

@soredake That's great news! Having all of the required dependencies (i.e., both the 64-bit and now also the 32-bit libraries) of Lutris is a huge step in the right direction.

All that's left now is (1) performance issues due to seccomp and (2) AppImage/FUSE compatibility issues. Regarding # 1, we can make a desktop shortcut for Steam that runs it without seccomp. Regarding # 2, there's no workaround and I'm not sure if that will ever be fixed. That sounds like a bigger engineering effort from the Flatpak developers.

LukeShortCloud avatar Sep 01 '22 06:09 LukeShortCloud

About seccomp, https://github.com/flathub/com.valvesoftware.Steam/issues/810#issuecomment-1221448642, let's think performance issues are from mesa, not seccomp. Regarding fuse, appimage games can run in flatpak without fuse using --appimage-extract-and-run, dunno if they will be unpacked every time when running appimage with this option though, another option is to unpack appimage in lutris installer with --appimage-extract, the last option is to wait ~5 years for flatpak to implement this https://github.com/flatpak/xdg-desktop-portal/issues/695

soredake avatar Sep 01 '22 06:09 soredake

That's great that seccomp was not the issue! The reporter mentioned that it was because they were on an old version of Mesa (and presumably were able to update to a newer version that's faster?). One less thing for us to worry about.

You're absolutely right, it sounds like we would have to wait a long time for Flatpak to have proper FUSE support. I doubt many users will even be installing AppImage games. Either way, we can at least document the --appimage-extract-and-run workaround.

It sounds like everything upstream is in a good state for us to seriously consider switching to Flatpak versions of these applications. I've been using Lutris as a Flatpak on my Steam Deck for months now and it's been great. Controller support and all.

LukeShortCloud avatar Sep 25 '22 19:09 LukeShortCloud

@LukeShortCloud when you are going to document this parameter, also mention that it's better to set NO_CLEANUP=1 to prevent cleaning up extracted appimage contents after exit.

soredake avatar Sep 26 '22 07:09 soredake

Acknowledged. For Lutris, I'll document that Flatpaks need to (1) be passed the --appimage-extract-and-run parameter and (2) should run with the NO_CLEANUP=1 environment variable for the best results.

LukeShortCloud avatar Sep 27 '22 03:09 LukeShortCloud

Actually, there is no need to document this, you can just add flatpak --user override --env=APPIMAGE_EXTRACT_AND_RUN=1 net.lutris.Lutris to post-install script and that's all, some appimages will work inside lutris (i decided not to use NO_CLEANUP as i realized it will leave extracted contents forever clogging /tmp).

I've tested minetest appimage, and it works, osu!lazer appimage is not (missing xdg-icon-resource command), i will report this to lutris flatpak bugtracker later, another one tested is openra appimage, it crashes in x11.txt but works in wayland.

soredake avatar Sep 27 '22 06:09 soredake

There are many appimage based installers on lutris https://lutris.net/games?page=1&paginate_by=25&ordering=name&q=appimage&search-installers=on, some of them will need adjustments (example), some deps may need to be added to lutris flatpak to satisfy needs of appimages. Another problem that there can be big appimages (>1gb), as they will be unpacked to /tmp by default, those who have 8gb or less will lose usable considerable amount of usable ram, this can be workarounded by setting TMPDIR=~/<non tmpfs directory> NO_CLEANUP=1.

soredake avatar Sep 27 '22 10:09 soredake

Even better! I didn't know it was possible to permanently set environment variables in a Flatpak with overrides.

Our /tmp directory was recently switched from ramfs to tmpfs. That was actually to support AppImages. Now that storage will use RAM + swap (instead of RAM only), it slightly helps in terms of storage needs. The swap size is configured by end-users during our first-time setup with a suggested size of 8 GB. It won't hurt for me to add some documentation about the temporary files either way.

Thanks for helping test these things and getting upstream reports open to further improve the wider Linux community!

LukeShortCloud avatar Sep 28 '22 02:09 LukeShortCloud

I decided to submit pr with this env to lutris flatpak directly: https://github.com/flathub/net.lutris.Lutris/pull/300

soredake avatar Oct 06 '22 16:10 soredake

Pr merged to lutris flatpak.

soredake avatar Oct 11 '22 06:10 soredake

@soredake Thanks for all of your hard working helping out with the winesapOS project and, even more importantly, the wider upstream Flatpak community!

I wanted to extend an invite and see if you'd be interested in doing some freelance or even full-time work regarding making a Linux gaming OS. If you're interested, e-mail me at ekultails a.t. gmail.com (it's the same e-mail I use here on GitHub) and I can fill you in with more details.

Either way, hoping you are well and still having fun in the Linux gaming community! :-)

LukeShortCloud avatar May 18 '23 21:05 LukeShortCloud