Index | Thread | Search

From:
Thomas Frohwein <tfrohwein@fastmail.com>
Subject:
New: sdl12-compat - SDL1 reimplentation layered on top of SDL2
To:
ports@openbsd.org
Date:
Thu, 6 Aug 2026 23:37:00 -0700

Download raw body.

Thread
Hi,

Please find a tarball of sdl12-compat in the attachment. This is the
upstream-endorsed way of running SDL-1.2 applications at this point,
since SDL 1.2 has been end-of-life for a while and isn't receiving
updates anymore. It reimplements SDL 1.2 on top of SDL2.

It is supposed to be a full replacement of devel/sdl. There are a few
environment variables that can help with tweaking and debugging. A
useful one is `SDL12COMPAT_DEBUG_LOGGING=1` which prints a message when
a program uses the library, to ensure that this is what is truly used.

Portswise, there is a warning about unimplemented OS_GetExeName on this
platform. This doesn't seem to exist in devel/sdl and I think it's only
used for the debugging environment variables.

There aren't a lot of SDL1-using ports left (many already switched to
SDL2 or SDL3), and they are mostly leaf ports. I've tested the following
and they build and run (working audio, video, controller input) without
observed issues:

WORKING:
comms/gnuradio (some python error on running, seems unrelated to sdl)
devel/sdl-gfx
devel/sdl-image
devel/smpeg
devel/sdl-mixer
devel/sdl-net
devel/sdl-pango
devel/sdl-sound
devel/sdl-ttf
emulators/dosbox
emulators/gambatte
games/clonekeen
games/dxx-rebirth
games/love/0.8
games/openxcom
games/sdl-jstest
x11/mplayer

The consumers may need tweaking of PLIST (some .a files now showing with
@static-lib tag) and WANTLIB (iconv, sndio, and usbhid now show as
Extra WANTLIBs when doing port-lib-depends-check).

To build sdl12-compat, devel/sdl needs to be uninstalled because of the
conflict in library and header files. To build consumers, if they
depend on devel/sdl directly, this needs to be adjusted to
devel/sdl12-compat.

If I get an ok, would need to update the consumer for the different
dependency, and retire devel/sdl with quirks entry.

At least a few Linux distros are already building against sdl12-compat
instead of sdl1, for example Fedora [2].

[1] https://github.com/libsdl-org/sdl12-compat#configuration-options
[2] https://github.com/libsdl-org/sdl12-compat/issues/78