supertuxkart / stk-code

The code base of supertuxkart
Other
4.39k stars 1.03k forks source link

Flatpak build of supertuxkart #2785

Closed alexlarsson closed 1 month ago

alexlarsson commented 7 years ago

Hi, I'm the flatpak developer, and I happened to need an app to test OpenGL stuff, so i made a flatpak package of supertuxkart: https://gist.github.com/alexlarsson/55d2f1ea8307a808aa94280a8a4ca945

If you want to test it, you can build it and install it locally like this:

# Install runtime and sdk
flatpak --user remote-add --if-not-exists gnome https://sdk.gnome.org/gnome.flatpakrepo
flatpak --user install gnome org.freedesktop.Sdk//1.4 org.freedesktop.Platform//1.4
# build the app
flatpak-builder --force-clean --repo=repo app net.supertuxkart.SuperTuxKart.json
# install it
flatpak --user remote-add --no-gpg-verify  local-supertuxcart repo
flatpak --user install local-supertuxcart net.supertuxkart.SuperTuxKart

At this point supertuxkart is installed and available in the regular desktop menus. (You might need to log in/out the first time after you installed flatpak before it appears in the menus.)

You can also launch it manually as flatpak run net.supertuxkart.SuperTuxKart

If you copy the repo directory to a webserver others can also install/update from there. However, in that case i recommend you sign the build with a gpg key (pass --gpg-sign=KEY to flatpak-builder).

This uses the freedesktop sdk/runtime, so you don't need any development packages on the build machine, and all users will be using exactly the same files to run the game, so no cross-distro issues.

Anyway, this isn't exactly an "issue", but if you're interested in this here you go, otherwise just close this.

Arthur-D commented 7 years ago

Hi, wanted to try it out but had some issues on Kubuntu 16.10: flatpak --user install gnome org.freedesktop.Sdk//1.4 org.freedesktop.Platform//1.4 error: GPG verification enabled, but no summary signatures found (use gpg-verify-summary=false in remote config to disable)

alexlarsson commented 7 years ago

That is very weird, it works fine here. Can you try again, and if there is a problem, what is the output of:

flatpak --version
flatpak --user remote-list -d
flatpak --user -v --ostree-verbose install gnome org.freedesktop.Platform//1.4
Arthur-D commented 7 years ago

Same issue when trying again.

flatpak --version
Flatpak 0.6.11
flatpak --user remote-list -d
gnome - https://sdk.gnome.org/gnome.flatpakrepo 1
flatpak --user -v --ostree-verbose install gnome org.freedesktop.Platform//1.4
error: Unknown option --ostree-verbose
alexlarsson commented 7 years ago

Ah, i see. That version of flatpak is a bit old and doesn't support flatpakref files. I would recommend using some 0.8.x version. What distro are you on?

alexlarsson commented 7 years ago

ubuntu ppa is here: https://launchpad.net/~alexlarsson/+archive/ubuntu/flatpak

alexlarsson commented 7 years ago

Oh, and if you re-try with the new one, you need to start by removing the old remote that got the wrong uri:

flatpak --user remote-delete gnome
Arthur-D commented 7 years ago

Thanks a lot, does not seem completely user-friendly yet but newer versions in distros will probably help. Also it seems to have gotten stuck at

Installing: org.freedesktop.Sdk/x86_64/1.4 from gnome

Receiving delta parts: 17/17 1,2 MB/s 267,3 MB/267,4 MB remaining

I've been waiting several minutes for it to finish but nothing more happens.

Arthur-D commented 7 years ago

Hmm it seems to have finished, would be nice with some feedback as to what is happening while installing. Now I get stuck at

flatpak-builder --force-clean --repo=repo app net.supertuxkart.SuperTuxKart.json
Can't load 'net.supertuxkart.SuperTuxKart.json': Feil under åpning av fil «net.supertuxkart.SuperTuxKart.json»: Fila eller mappa finnes ikke

I reckon you don't read Norwegian, but it says the file doesn't exist, do I need to put it somewhere locally?

alexlarsson commented 7 years ago

I actually do read norwegian fine (being swedish). But, you need to download https://gist.githubusercontent.com/alexlarsson/55d2f1ea8307a808aa94280a8a4ca945/raw/edcbfb4cb133d3ccaab3ce3cd0ae1dd16ce21a5f/net.supertuxkart.SuperTuxKart.json and run the command from the same directory.

Arthur-D commented 7 years ago

Ah, a fellow Nord, trevligt. :) Seems like I'm getting into permissions issues. Do I need to start the process again with sudo?

CMake Error at cmake_install.cmake:48 (file):
  file cannot create directory: /usr/local/lib.  Maybe need administrative
  privileges.

Makefile:72: recipe for target 'install' failed
make: *** [install] Error 1
Error: module openal: Underprosess avsluttet med kode 2
[magne@magne-kubuntu ~/SuperTuxKart/Flatpak]$ 
sudo flatpak-builder --force-clean --repo=repo app net.supertuxkart.SuperTuxKart.json
[sudo] passord for magne: 
Emptying app dir 'app'
Downloading sources
Starting build of net.supertuxkart.SuperTuxKart
Cache miss, checking out last cache hit
========================================================================
Building module openal in /home/magne/SuperTuxKart/Flatpak/.flatpak-builder/build/openal-2
========================================================================
Can't find source path /home/magne/.local/share/flatpak/runtime/org.freedesktop.Sdk/x86_64/1.4/7829ca4848cb5ac282812dee3d3ce49c54950916485a9eb4d53c2b80a0fd4233/files: Permission denied
Error: module openal: Underprosess avsluttet med kode 1
alexlarsson commented 7 years ago

There was an issue in the json file, can you re-download and try again?

Arthur-D commented 7 years ago

That worked, however starting gave me this issue:

Irrlicht Engine version 1.8.0
Linux 4.8.0-37-lowlatency #39-Ubuntu SMP PREEMPT Thu Jan 26 03:43:39 UTC 2017 x86_64
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
[warn   ] [IrrDriver Temp Logger]: Level 2: X Error: BadMatch (invalid parameter attributes)

[warn   ] [IrrDriver Temp Logger]: Level 2: From call : unknown

[warn   ] [IrrDriver Temp Logger]: Level 2: X Error: BadMatch (invalid parameter attributes)

[warn   ] [IrrDriver Temp Logger]: Level 2: From call : unknown

[warn   ] [IrrDriver Temp Logger]: Level 2: X Error: BadMatch (invalid parameter attributes)

[warn   ] [IrrDriver Temp Logger]: Level 2: From call : unknown

[warn   ] [IrrDriver Temp Logger]: Level 2: X Error: BadValue (integer parameter out of range for operation)

[warn   ] [IrrDriver Temp Logger]: Level 2: From call : unknown

[warn   ] [IrrDriver Temp Logger]: Level 2: X Error: GLXBadContext

[warn   ] [IrrDriver Temp Logger]: Level 2: From call : unknown

[warn   ] [IrrDriver Temp Logger]: Level 2: X Error: 0

[warn   ] [IrrDriver Temp Logger]: Level 2: From call : unknown

[warn   ] [IrrDriver Temp Logger]: Level 2: Could not make context current.

[warn   ] [IrrDriver Temp Logger]: Level 2: X Error: GLXBadContext

[warn   ] [IrrDriver Temp Logger]: Level 2: From call : unknown

[warn   ] [IrrDriver Temp Logger]: Level 2: OpenGL driver version is not 1.2 or better.

[warn   ] [IrrDriver Temp Logger]: Level 2: Warning: OpenGL device only has one texture unit. Disabling multitexturing.

[info   ] IrrDriver: OpenGL version: 2.1
[info   ] IrrDriver: OpenGL vendor: (null)
[info   ] IrrDriver: OpenGL renderer: (null)
[info   ] IrrDriver: OpenGL version string: (null)
[fatal  ] GLEW: Glew initialisation failed with error Missing GL version
alexlarsson commented 7 years ago

Hmm, what OpenGL driver are you using?

Arthur-D commented 7 years ago

I'm using the proprietary NVIDIA driver, on my phone currently but I can find out the version etc if it's relevant.

Arthur-D commented 7 years ago

That is, I am writing this on my phone, not that I am trying this on it. ;)

alexlarsson commented 7 years ago

Ah, yeah, then you need to install a driver. The latest flatpak (0.8.3) version does this automatically, but you should be able to do it manually. For instance, assuming you're on nvidia driver 375.26, you can do:

flatpak --user install gnome org.freedesktop.Platform.GL.nvidia-375-26//1.4
Arthur-D commented 7 years ago

I do have flatpak 0.8.3 now, but I guess since I had only 0.8.2 when doing the previous steps it did not to do it automatically. I'm using NVIDIA 367.57 currently (can upgrade if needed), but in any case I get this again:

[magne@magne-kubuntu ~/SuperTuxKart/Flatpak]$ 
flatpak --user -v --ostree-verbose install gnome org.freedesktop.Platform.GL.nvidia-367-57//1.4
error: GPG verification enabled, but no summary signatures found (use gpg-verify-summary=false in remote config to disable)
[magne@magne-kubuntu ~/SuperTuxKart/Flatpak]$ flatpak --version
Flatpak 0.8.3
[magne@magne-kubuntu ~/SuperTuxKart/Flatpak]$ 
flatpak --user -v --ostree-verbose install gnome org.freedesktop.Platform.GL.nvidia-375-26//1.4
error: GPG verification enabled, but no summary signatures found (use gpg-verify-summary=false in remote config to disable)

As you can see I tried just substituting the driver version for the one I'm using, but I guess older versions may not be available as flatpak. So I tried with the version you suggested to no avail, is there some command I should run after the upgrade from 0.8.2 to 0.8.3 so it sees the new NVIDIA stuff?

Arthur-D commented 7 years ago

I got it to work, now with the 375.39 driver. Thanks a lot! However there were some sudden crashes, one while in the menu and next time while racing. Unfortunately nothing in stdout gave any indication as to why - is there a way I can enable some debug output for this?

alexlarsson commented 7 years ago

You can run flatpak run -d --command=sh net.supertuxkart.SuperTuxKart which should give you a debug shell in the app sandbox where you can run gdb or whatever you would normally do.

alexlarsson commented 7 years ago

Oh, for maximal usability of that you may also want to install org.freedesktop.Sdk.Debug and net.supertuxkart.SuperTuxKart.Debug so that you have debug info etc, but that is optional.

Arthur-D commented 7 years ago

Unfortunately I haven't been able to reproduce it after the initial two times it crashed, so it looks like it may be a Heisenbug. On the other hand, that means it works as it should from what I can tell.

Thank you very much for all your patience and help, and maybe I'll be able to make my own Flatpak deployment, hopefully with Wiiuse as well. :)

Alayan-stk-2 commented 1 month ago

Flathub offers a Flatpak of SuperTuxKart for people interested.

https://flathub.org/apps/net.supertuxkart.SuperTuxKart

Closing this issue, as there is nothing special that should be done on our side.