The sdl2-compat package provides a compatibility layer for packages that require SDL2, utilizing SDL3 as the backend.
Download (HTTP): https://www.libsdl.org/release/sdl2-compat-2.32.58.tar.gz
Install sdl2-compat by running the following commands:
mkdir build &&
cd build &&
cmake -D CMAKE_INSTALL_PREFIX=/usr \
-D CMAKE_BUILD_TYPE=Release \
-D CMAKE_SKIP_INSTALL_RPATH=ON \
-D SDL2COMPAT_STATIC=OFF \
-D SDL2COMPAT_TESTS=OFF \
-W no-dev -G Ninja .. &&
ninja
Now, as the root user:
ninja install && rm -vf /usr/lib/libSDL2_test.a
Install lib32-sdl2-compat by running the following commands:
rm -rf * &&
CC="gcc -m32" CXX="g++ -m32" \
PKG_CONFIG_PATH=/usr/lib32/pkgconfig \
cmake -D CMAKE_INSTALL_PREFIX=/usr \
-D CMAKE_INSTALL_LIBDIR=lib32 \
-D CMAKE_BUILD_TYPE=Release \
-D CMAKE_SKIP_INSTALL_RPATH=ON \
-D SDL2COMPAT_STATIC=OFF \
-D SDL2COMPAT_TESTS=OFF \
-W no-dev -G Ninja .. &&
ninja
Now, as the root user:
DESTDIR=$PWD/DESTDIR ninja install && rm -vf DESTDIR/usr/lib32/libSDL2_test.a && cp -vr DESTDIR/usr/lib32/* /usr/lib32 && rm -rf DESTDIR && ldconfig
-D
CMAKE_SKIP_INSTALL_RPATH=ON: This switch makes
cmake remove
hardcoded library search paths (rpath) when installing a binary
executable file or a shared library. This package does not need
rpath once it's installed into the standard location, and rpath may
sometimes cause unwanted effects or even security issues.
-D SDL2COMPAT_STATIC=OFF:
This parameter disables building the static libraries.
-D SDL2COMPAT_TESTS=OFF:
This parameter disables building the tests.
rm -vf /usr/lib/libSDL2_test.a: This command removes a useless static library.