tetrio / issues

Report issues and discuss improvements / feature requests around TETR.IO
https://tetr.io
393 stars 21 forks source link

Package for flatpak/flathub #960

Open axtloss opened 2 years ago

axtloss commented 2 years ago

Checklist

Is your feature request related to a problem? Please describe.

Sort of, when using a linux distro that doesn't use apt (fedora silverblue in my case), I'd have to download the tarball you offer and play tetrio that way, sadly doesn't integrate with the desktop well.

Describe the solution you'd like

It would be nice if tetr.io could be published as a flatpak and also on flathub, I have also made an example build manifest which works, I would also be ok with maintaining the flathub version myself if you don't want to maintain it.

Describe alternatives you've considered

The only alternatives would be to just use the tarball, which works, but in my opinion isn't very optimal. As well as playing in the browser, which is what I'm trying not to do.

Additional context

No response

netthier commented 2 years ago

The AUR package is community-maintained and could be considered prior art: https://aur.archlinux.org/packages/tetrio-desktop

migtorr commented 1 year ago

Any update on this? On the steam deck a .deb and web shortcut aint it

ZaptorZap commented 1 year ago

You can definitely use the provided tarball to make an ergonomic shortcut to TETR.IO Desktop within the Steam Deck's Game mode—I've done it.

Just get the tarball, extract it somewhere(I used ~/Documents), and pursue adding it as a non-Steam game through the Steam desktop UI.

migtorr commented 1 year ago

@ZaptorZap any trick on doing this? I added it as non steam game but doesn't run. Can run if I open it through the file manager

migtorr commented 1 year ago

this solved it https://www.reddit.com/r/SteamDeck/comments/vc6mcy/comment/iowaz8t/?utm_source=reddit&utm_medium=web2x&context=3

ZaptorZap commented 1 year ago

Oh, LD_PRELOAD= %command% as an advanced launch command also works. Sorry for the late response.

forvate commented 9 months ago

I have also made an example build manifest which works

Honestly I think this solves the issue. I looked through the YAML and it seems to be working perfectly I'm just not sure why it hasn't been uploaded to Flathub yet, this would solve many issues related to packaging (like #1227).

I think why this issue was in hell since 2022, I assume it's because unclear stance about packaging tetrio-desktop itself, I'm pretty sure it's permitted by osk (both AUR and Nix do have the launcher already) but having it somewhere written that YES packages of tetrio-desktop are indeed allowed would be nice.

I assume what the OP wanted from this issue is making Flathub another official release of TETR.IO Desktop, which I would see as really beneficial, as it is becoming the main distro-agnostic packaging format, it would also add additional burden from maintaining this package.

It is far more maintainable by developers to just provide a tarball with a release and distros accommodating that package into their own repos, same does discord, same does vscode.

axtloss commented 9 months ago

The reason why I have not uploaded it to flathub yet is because 1) flathub requires permission from the developers to redistribute the app, which is what I wish to gain with this issue 2) a download link based on actual releases, not rolling release like what is currently provided.

I wouldn't mind having to mark the package as not official, as it would not change a lot on the functionality of the package.

vulpes2 commented 8 months ago

The reason why I have not uploaded it to flathub yet is because

1. flathub requires permission from the developers to redistribute the app, which is what I wish to gain with this issue

2. a download link based on actual releases, not rolling release like what is currently provided.

@ZaptorZap Could you please make a statement in regard to permission to distribute the client on flathub? I can help with packaging and ongoing maintenance/support of the flatpak. On top of that, the only required change on your side would be providing a versioned download link, something like https://tetr.io/about/desktop/builds/TETR.IO%20Setup-8.0.0.tar.gz. Publishing the builds on GitHub with the releases feature will also work, and in that case a non-versioned filename is preferable.

forvate commented 8 months ago

AFAIK now Flatpak support seems to be stalled mainly because of Gamepad API not working and xdg not providing a portal for devices other than keyboard and mouse. (https://github.com/flatpak/flatpak/issues/7 yes, issue no. 7...)

At least me and Zaptor couldn't figure it out. Definitely Flatpak would still be optimal way of redistributing TETR.IO Desktop for Steam Deck users, but it just provides worse experience over tarball and probably shouldn't be listed on Flathub anyway.

vulpes2 commented 8 months ago

Yeah, I'm very well aware of the infamous input device issue. The only broken part (afaik) is hotplugging, and it seems like there hasn't been much progress so far on that front. Most, if not all applications (even chromium) suffer from this in the form of requiring a complete restart of the application to detect newly added devices like a security key, since those are USB HID too. Personally I think this is a huge pain for a browser with many windows open, but not a significant road-blocker for a game that loads in pretty much instantly.

ZaptorZap commented 8 months ago

I don't represent TETR.IO in a way that would allow me to legally give a statement on TETR.IO's licensing. What I can confirm is that there were no prior conversations for the Arch, Nix, or Winget releases. Needless to say, legal action has become a bit of a stigma for the community, after The Tetris Company's ill-sought actions.

Yes, the lack of acceptable controller support is a worry. I've personally compiled your example, and have changed some options within it. Here's a brief list of differences:

axtloss commented 8 months ago

I do not own any usable gamepad so I cannot really test that part, however the Rich Presence most likely requires some changes in the Tetr.io flatpak build, but that should not be too hard to fix.

About the legal thing, I believe the only reason flathub requires this is to ensure that they can distribute binaries of the application, especially since (from what I could gather) tetr.io is proprietary, not having explicit approval would technically violate copyright. This can be avoided in some ways, like making the flatpak simply a launcher that downloads tetr.io when its first launched, allowing flathub to not directly distribute the binaries.

ZaptorZap commented 8 months ago

Specifically, I added --filesystem=xdg-run/app/com.discordapp.Discord:create into finish-args, and modified tetrio-run to include

for i in {0..9}; do
    test -S $XDG_RUNTIME_DIR/discord-ipc-$i || ln -sf {app/com.discordapp.Discord,$XDG_RUNTIME_DIR}/discord-ipc-$i;
done

The errors persisted.

In addition, Flatpak's linter wasn't exactly happy with including both --socket=x11 and --socket=wayland. TETR.IO definitely wasn't designed to support Wayland and I'm not exactly sure if its antiquated Electron version is either. I went ahead and removed that, although I can't realistically test the impact this has on Wayland-powered devices. (issues with owning an Nvidia card…)

axtloss commented 8 months ago

Hm yeah the modification suggested by vesktop also do not work when I test them, maybe its with the way tetr.io sets up discord rpc?

In addition, Flatpak's linter wasn't exactly happy with including both --socket=x11 and --socket=wayland

That is an error on my end, the permissions should be --socket=x11-fallback and --socket=wayland From my testing tetr.io runs perfectly fine on wayland, even with nvidia

axtloss commented 8 months ago

Although either way, seeing that the issues you brought up don't seem to be easily fixable, it may not be the best idea to publish tetr.io on flathub, since it does degrade user experience quite a bit

ZaptorZap commented 8 months ago

Yeah, sorry. I'll leave the issue open, since we are interested in maintaining it ourselves, but controller support is a pain point, especially with our undetermined plans regarding that.

eternal-sorrow commented 8 months ago

I just tested and tetrio desktop definitely doesn't work with wayland even with --enable-features=UseOzonePlatform --ozone-platform=wayland, which is an old way to run chromium/electron apps on wayland. Which means Electron version of terio is ancient. This is an issue by itself and should probably be filed separately. Please update Electron when a new version comes out, it's very important.

ZaptorZap commented 8 months ago

This issue has been filed separately and is being tracked at #1068.

vulpes2 commented 8 months ago

The controller issue is particularly weird, jstest_gtk doesn't seem have any problems picking up controllers in a flatpak when I last tried it, and there are many other applications that can use controllers packaged as flatpaks. I'm not familiar with electron itself from a developer's perspective, I suppose it'd be worth a shot to update electron and then try again. Either way I agree that it shouldn't be shipped on flathub unless controller support is working properly. Discord RPC can definitely be fixed but it's pointless to spend time fixing that if controllers don't work.

forvate commented 8 months ago

doesn't seem have any problems picking up controllers in a flatpak

Issue with solutions like that implies the usage of --device=all, which works so-so i guess... but kinda defeats the whole point of sandboxing the application in the first place, for the additional cost of extra runtime, bigger downloads and extra attention needed from developers to maintain it.

Compare it to the tarball, which:

  1. Just works™
  2. Simple to install, just extract it wherever and run the executable. (At least to Windows users, which just download programs from the website anyway)
  3. Is actually distro-agnostic.

As far as Steam Deck goes you can just add the tarball to steam launcher and have a very good experience with extra perks like Steam Input. It looks like SteamOS 3.5 comes with native /nix/ support, only needing the user nix package manager, if you wish to have your TETR.IO Desktop experience with the update certainty of a package manager, this feels like a way to go for now. Probably until 9.0.0 version of the client at least.

ZaptorZap commented 8 months ago

--device=all didn't work at all in my testing. Believe me I tried lol

The controller's picked up as-expected on my desktop with other applications. I did install xpad for a different unrelated issue, but that's not impacted my compatibility with any app as-of-yet. Regardless, as far as I know this shouldn't impact a DualSense 4 either. I even tried --filesystem=/dev///dev/uinput:ro, IIRC.