The sdl2-compat package provides a compatibility layer for packages that require SDL2, utilizing SDL3 as the backend.
Development versions of BLFS may not build or run some packages properly if LFS or dependencies have been updated since the most recent stable versions of the books.
Download (HTTP): https://www.libsdl.org/release/sdl2-compat-2.32.58.tar.gz
Download MD5 sum: ce17260dfcf7a7548747d09882974bef
Download size: 2.7 MB
Estimated disk space required: 63 MB (add 29 MB for tests)
Estimated build time: less than 0.1 SBU (using parallelism=4; add 0.3 SBU for tests)
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
If you want to build the tests, issue the following commands:
mkdir ../build-tests &&
cd ../build-tests &&
cmake -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 &&
DESTDIR=$PWD/TESTS ninja 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
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.