Topic: Help needed: Building WL with SDL3 and the future of flatpak packaging

tothxa
Avatar
Topic Opener
Joined: 2021-03-24, 12:44 UTC+1.0
Posts: 527
OS: antix / Debian
Version: some new PR I'm testing
Ranking
One Elder of Players
Posted at: Yesterday 00:43 UTC+2.0

While updating the beta flatpak to have the new metainfo file to flathub(redhat)'s liking, I tried to switch to this year's runtime version, which is now RC1 on flathub-beta, but I had to revert it, because SDL2-image wasn't found by cmake. I looked up the contents of the new runtime, and it looks like they switched to SDL3. They provide SDL2-compat, but as far as I can tell, SDL doesn't have similar backward compatibility layers for the external SDL parts we use, ie. SDL-image, SDL-mixer and SDL-ttf, and the runtime only includes the SDL3 versions of these.

It looks like some of you ( @kaputtnik face-wink.png ) already managed to build with SDL3 and SDL2-compat. Could you please tell me how you dealt with the other components? Or do your distros still have the SDL2 versions of the other libs?

I'd really like to switch the flatpak to the new runtime for WL1.3 (ie. start testing it ASAP), because the current one will likely go EOL before we release 1.4, and that would make flathub put big warnings up against us.

BTW and in general, how important you think keeping the flatpak is? flathub (controlled by redhat) is going in a direction I very much not like, so I'd much rather spend my time on actual improvements to Widelands than on chasing down flatpak deprecations. After all, we've had appimages too for quite a while now as an alternative distro-ndependent install method. Or, if somebody steps up to take over the flatpak maintenance, I'd be more than happy to pass it on.


Top Quote
kaputtnik
Avatar
Joined: 2013-02-18, 20:48 UTC+1.0
Posts: 2694
OS: Archlinux
Version: current master
Ranking
One Elder of Players
Location: Germany
Posted at: Yesterday 11:04 UTC+2.0

tothxa wrote

It looks like some of you ( @kaputtnik face-wink.png ) already managed to build with SDL3 and SDL2-compat. Could you please tell me how you dealt with the other components? Or do your distros still have the SDL2 versions of the other libs?

AFAIK sdl2-compat is a compatibility layer for just this use case, it replaces sdl2. Applications that need other sdl2 libraries, like sdl2-mixer or sdl2-image, should work OOTB with sdl2-compat. The output of dependencies on my machine:

$:> pacman -Qi sdl2-compat
Name            : sdl2-compat
Version         : 2.32.56-2
Description     : An SDL2 compatibility layer that uses SDL3 behind the scenes
Architecture    : x86_64
URL             : https://github.com/libsdl-org/sdl2-compat
Licenses        : Zlib
Groups          : None
Provides        : sdl2=2.32.56
Depends On      : sdl3  glibc
Optional Deps   : None
Required By     : blobby2  ffmpeg  freerdp  plasma-desktop  qemu-audio-sdl  qemu-ui-sdl  sdl2_image
                  sdl2_mixer  sdl2_net  sdl2_ttf  wxwidgets-gtk3
Optional For    : gegl  mlt  mpg123
Conflicts With  : sdl2
Replaces        : sdl2

Widelands has not switched to sdl3 so the depnecies are still sdl2 libraries:

$:> pacman -Qi widelands
Name            : widelands
Version         : 1:1.2.1-2
Description     : A realtime strategy game with emphasis on economy and transport
Architecture    : x86_64
URL             : https://widelands.org/
Licenses        : GPL
Groups          : None
Provides        : None
Depends On      : sdl2_mixer  sdl2_image  sdl2_ttf  lua  glew  python  dbus  minizip
[…]

If flatpak doesn't provide the sdl2 packages this is an issue of flatpak, imho.

BTW and in general, how important you think keeping the flatpak is? flathub (controlled by redhat) is going in a direction I very much not like, so I'd much rather spend my time on actual improvements to Widelands than on chasing down flatpak deprecations. After all, we've had appimages too for quite a while now as an alternative distro-ndependent install method. Or, if somebody steps up to take over the flatpak maintenance, I'd be more than happy to pass it on.

I have no meaning about that. In general i think it's good to have distro independent package managers, but as ever in the opensource economy this goal is split into several independent and incompatible projects. In result application developers have more work, or more possibilities, to provide a package.

If appimage do work across different Os, i am fine to have only this possibility.


Top Quote
tothxa
Avatar
Topic Opener
Joined: 2021-03-24, 12:44 UTC+1.0
Posts: 527
OS: antix / Debian
Version: some new PR I'm testing
Ranking
One Elder of Players
Posted at: Yesterday 18:25 UTC+2.0

kaputtnik wrote

AFAIK sdl2-compat is a compatibility layer for just this use case, it replaces sdl2. Applications that need other sdl2 libraries, like sdl2-mixer or sdl2-image, should work OOTB with sdl2-compat. The output of dependencies on my machine:

> $:> pacman -Qi sdl2-compat
> Name            : sdl2-compat
> Version         : 2.32.56-2
...
> Required By     : blobby2  ffmpeg  freerdp  plasma-desktop  qemu-audio-sdl  qemu-ui-sdl  sdl2_image
>                   sdl2_mixer  sdl2_net  sdl2_ttf  wxwidgets-gtk3

Widelands has not switched to sdl3 so the depnecies are still sdl2 libraries:

> $:> pacman -Qi widelands
> Name            : widelands
> Version         : 1:1.2.1-2
...
> Depends On      : sdl2_mixer  sdl2_image  sdl2_ttf  lua  glew  python  dbus  minizip

I think this means you still have sdl2_{image|mixer|ttf} packages, while the flatpak runtime dropped them... Tough luck for me... (also, SDL2-compat doesn't seem to provide the other headers in /usr/include/SDL2/)


Top Quote
kaputtnik
Avatar
Joined: 2013-02-18, 20:48 UTC+1.0
Posts: 2694
OS: Archlinux
Version: current master
Ranking
One Elder of Players
Location: Germany
Posted at: Yesterday 19:00 UTC+2.0

tothxa wrote

I think this means you still have sdl2_{image|mixer|ttf} packages,

Yes, exactly. I guess those packages are just compiled against sdl2-compat instead of sdl2. And all sdl2-compat is doing is to make sdl2 calls work with sdl3.

while the flatpak runtime dropped them... Tough luck for me...

I can't imagine that flatpack dropped those packages while nearly every game depends on sdl2 yet. And for what reason do one wants to use flatpak if he/she can't install games with it face-grin.png

Anyway, i do not understand much about flatpak…


Top Quote