Bug 1968508 - sdl-config fails to locate SDL.h and libSDL.so
Summary: sdl-config fails to locate SDL.h and libSDL.so
Alias: None
Product: Fedora
Classification: Fedora
Component: sdl12-compat
Version: rawhide
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Neal Gompa
QA Contact:
Depends On:
Blocks: 1967544
TreeView+ depends on / blocked
Reported: 2021-06-07 13:18 UTC by Petr Pisar
Modified: 2021-06-10 12:17 UTC (History)
3 users (show)

Fixed In Version: sdl12-compat-0.0.1~git.20210609.efe9791-1.fc35
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2021-06-09 12:08:36 UTC
Type: Bug

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Github libsdl-org sdl12-compat pull 82 0 None open Fix sdl-config and sdl12_compat contents 2021-06-07 13:59:34 UTC

Description Petr Pisar 2021-06-07 13:18:25 UTC
I copied checkkeys.c from SDL-1.2.15/docs to /tmp to verify that sdl12-compat-devel is API-compatible. It's a simple SDL application starting with:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "SDL.h"

and written in line with SDL_Quit(3) etc. manual pages. Look how it works with SDL-devel:

$ gcc $(sdl-config --cflags) checkkeys.c $(sdl-config --libs)
$ echo gcc $(sdl-config --cflags) checkkeys.c $(sdl-config --libs)
gcc -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT checkkeys.c -lSDL -lpthread
$ scanelf -n ./a.out
ET_EXEC libSDL-1.2.so.0,libpthread.so.0,libc.so.6 ./a.out

Now upgrade to sdl12-compat-0.0.1~git.20210602.cc5826a-3.fc35.x86_64:

$ rm ./a.out
$ gcc $(sdl-config --cflags) checkkeys.c $(sdl-config --libs)
checkkeys.c:11:10: fatal error: SDL.h: No such file or directory
   11 | #include "SDL.h"
      |          ^~~~~~~
compilation terminated.
$ echo gcc $(sdl-config --cflags) checkkeys.c $(sdl-config --libs)
gcc -I/usr/include/SDL2 -D_GNU_SOURCE=1 -D_REENTRANT checkkeys.c -lSDL

So the new sdl-config places SDL.h to /usr/inclue/SDL2, but there none:

$ rpm -ql sdl12-compat-devel | grep SDL.h

I think there is a typo in the new sdl-config and it should point to /usr/include/SDL instead.

But that's not all. Lets correct on the command line:

$ gcc -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT checkkeys.c -lSDL
/usr/bin/ld: cannot find -lSDL
collect2: error: ld returned 1 exit status

There is no libSDL.so file:

$ rpm -ql sdl12-compat-devel | grep lib64

In addition, sdl12_compat pkg-config also does not work:

$ cat /usr/lib64/pkgconfig/sdl12_compat.pc
# sdl12_compat pkg-config source file


Name: sdl12_compat
Description: An SDL-1.2 compatibility layer that uses SDL 2.0 behind the scenes.
Version: 0.0.1
Provides: sdl = 1.2.50
Libs: -L${libdir}  -lSDL  -lpthread
Libs.private: -lSDL  -lpthread  -lm -ldl -lpthread
Cflags: -I${includedir}/SDL -D_GNU_SOURCE=1 -D_REENTRANT

because it cannot locate libSDL.so:

$ echo gcc $(pkg-config --cflags sdl) checkkeys.c $(pkg-config --libs sdl)
gcc -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT checkkeys.c -lSDL -lpthread
$ gcc $(pkg-config --cflags sdl) checkkeys.c $(pkg-config --libs sdl)
/usr/bin/ld: cannot find -lSDL
collect2: error: ld returned 1 exit status

Comment 1 Neal Gompa 2021-06-07 13:58:43 UTC
There's a PR upstream to fix this issue: https://github.com/libsdl-org/sdl12-compat/pull/82

Once merged, I'll update the package to resolve this.

Comment 2 Neal Gompa 2021-06-09 11:09:04 UTC
I've just pushed a new build that should have this fixed now: https://koji.fedoraproject.org/koji/buildinfo?buildID=1767135

Can you test, Petr?

Comment 3 Petr Pisar 2021-06-09 12:08:36 UTC
Awesome. Both sdl-config and pkg-config work now. Also perl-Alien-SDL stopped failing.

Comment 4 Sergio Basto 2021-06-09 14:22:21 UTC
Packages mlt and pinball built successfully .

Thank you.

Note You need to log in before you can comment on or make changes to this bug.