News:

Simutrans.com Portal
Our Simutrans site. You can find everything about Simutrans from here.

SDL2.2 -> SDL2.3

Started by m.vanderwulp, March 19, 2025, 06:49:47 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

m.vanderwulp

Dear,
I am responsible for building simutrans for OpenSuse at:
https://build.opensuse.org/package/show/games/simutrans

For Leap 15.6, since recently, it fails to build with this error:
 unresolvable: nothing provides libSDL2-2_0-0 = 2.28.5-150600.1.4 needed by SDL2-devel, (got version 2.32.52-lp156.4.1)

Ideed, on my Leap 15.6 system, the "libSDL2-2_0-0" old version 2.28.5 is now replaced with 2.32.52 (as can be seen in the screenshot).



Hence my first question: is Simutrans supposed to work with SDL 2.32?

Then, how do I fix this?

prissi

#1
We do not ask for a certain SDL version so this rather looks like a problem of the SDL2 package itself, i.e. SDL2 devel seems broken.

SDL3 breaks the sound system, but any SDL2 should work. I mean, otherwise there is no reason to introduce a SDL 3.x if you do not keep the interface. (Although recently, more and more programmers fresh from the university seem keen to break stuff working for ages just because, the last update of Debian was a very bad example of how not to do this.)

I think MinGW uses SDL2 2.31 and bookworm uses 2.26 and both work. In the makefile is
SDL2_CONFIG      ?= pkg-config sdl2which the makefile uses if there is no default. Please check the output of this command for " --libs" or "--static --libs". I strongly suspect it to be broken.

m.vanderwulp

OK, thanks. Good to know.

I'll look into it

prissi

I guess it is an issue with this: https://github.com/libsdl-org/sdl2-compat

I.e. using SDL3 via headers but instead tries to link (via the pkg-config) to SDL2 which does not exist. pkg-config might be broken for the SDL2-compat Maybe that only works with cmake but they never removed the pkg-config?

SDL3 is a long term goal but wide compatibility with it will take time given how many systems Simutrans can compile.

m.vanderwulp

I did some tests today on OpenSuse Tumbleweed, and Leap 15.6. Just noting down what I learned so far.

The good news is that Simutrans works on Tumbleweed, since installing the latest version includes these:
libSDL2-2_0-0 : 2.32.52-1.1 : SDL-2.0 Compatibility Layer for Simple DirectMedia Layer 3.0
libSDL3-0 : Simple DirectMedia Layer Library

On my OpenSuse Leap, I have the same versions available, and also this older one:
libSDL2-2_0-0 : 2.28.5-150600.1.4 : Simple DirectMedia Layer Library

Mind the name!
So, apparently, when going from SDL 2.28 to 2.32, they switched to the "compatibility layer", which requires to install SDL3 also.
I can confirm that: if I start the simutrans I still have on my Leap system, it did initially not work, with this error: "Failed loading SDL3 library". Installing "libSDL3-0" fixes this problem.

Now back to the building process at "https://build.opensuse.org/package/show/games/simutrans". As said before, it fails with " unresolvable: nothing provides libSDL2-2_0-0 = 2.28.5-150600.1.4 needed by SDL2-devel, (got version 2.32.52-lp156.4.1) ".

I'll look into this later.

prissi

As said, I highly suspect that the wrong binary header is linked as an SDL program is called by the SDL library header. Please check the output of "pkg-config sdl2 --libs --static" "pkg-config sdl2 --libs" and "pkg-config sdl2 --cflags" in a shell. With the compatibility layer (just a guess), it should print a lot of SDL3 (maybe) if the compatibility layer are just headers as I understood.

If there is nothing returned, then simutrans just tries to link against SDL2. Maybe the old library must be deleted, or the pkg-config needs updating?

You could also try a cmake build.

m.vanderwulp

Problem solved!

I did not do anything, I have no idea what changed yet, but now it works.
If I figure out what the problem was, I'll let you know.