The Simple DirectMedia Layer Version 3 (SDL3 for short) is a cross-platform library designed to make it easy to write multimedia software, such as games and emulators.
This package is known to build and work properly using an LFS 12.4 platform.
Download (HTTP): https://www.libsdl.org/release/SDL3-3.3.4.tar.gz
Download SHA256 Sum: fe9d1f842bc26816dc39ae48d62ed70b13291f4589e61b5942387e4b0f2d2c6c
Download MD5 sum: a60471a07f2985f4aabae2c4fb7247ac
Download size: 48,083.5 KB
Estimated disk space required: 104,107.0 KB
Estimated build time: less than 1.0 SBU
alsa-lib-1.2.14, libusb-1.0.29, libxkbcommon-1.13.0, Mesa-25.2.7, PulseAudio-17.0, Vulkan-Loader-1.4.328.1, wayland-protocols-1.45, and Xorg7 Libraries (if those are not present, the corresponding modules are not built)
Prepare SDL3 by running the following commands:
cmake -D CMAKE_INSTALL_PREFIX=/usr \
-D CMAKE_BUILD_TYPE=Release \
-D SDL_TEST_LIBRARY=OFF \
-D SDL_STATIC=OFF \
-D SDL_RPATH=OFF \
-W no-dev -G Ninjaninja -C build
Now Install the package, as the root user:
ninja -C build install
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 SDL_STATIC=OFF \
-D SDL_RPATH=OFF \
-D SDL_TESTS=ON \
-D SDL_INSTALL_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/SDL3. 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 SDL_TEST_LIBRARY=OFF: This parameter disables
building an unnecessary static library meant for the tests. It gets built
in the testing section.
-D SDL_STATIC=OFF: This parameter disables
building static libraries.
-D SDL_RPATH=OFF: This parameter disables
installing with rpath. It can cause security issues otherwise.