The sdl2-compat package provides a compatibility layer for packages that require SDL2, utilizing SDL3 as the backend.
This package is known to build and work properly using an LFS 12.4 platform.
Download (HTTP): https://www.libsdl.org/release/sdl2-compat-2.32.60.tar.gz
Download SHA256 Sum: 5ef7b1ddd315d5c57f0cece9cf97e1ce044581b1b692044440e61463c25aece8
Download MD5 sum: 87a86bb196197eaa701bd60c06c2de72
Download size: 56,542.7 KB
Estimated disk space required: 59,178.6 KB
Estimated build time: less than 0.5 SBU
Prepare sdl2-compat by running the following commands:
cmake -B build -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 Ninjaninja -C build
Now Install the package, as the root user:
ninja -C build install rm -vf /usr/lib/libSDL2_test.a
If you want to build the tests, issue the following commands:
cmake -B build-tests -D CMAKE_INSTALL_PREFIX=/usr \
-D CMAKE_BUILD_TYPE=Release \
-D CMAKE_SKIP_INSTALL_RPATH=ON \
-D SDL2COMPAT_INSTALL_TESTS=ON \
-D SDL2COMPAT_STATIC=OFF \
-D SDL2COMPAT_TESTS=ON \
-W no-dev -G Ninja
ninja -C build-tests
DESTDIR=$PWD/TESTS ninja -C build-tests install
Now you will be able to run the tests in TESTS/usr/libexec/installed-tests/SDL2_compat.
You will have to run the tests individually. Some of them may need to be
manually killed and audio will need to be working so that you can hear
from the default audio output.
-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.