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. It is the new version of SDL and provides more features than SDL2.
After you install this package, you should also install sdl2-compat-2.32.56 for SDL2 support if you need it. The amount of packages that use this package are very low so consider SDL2 support a requirement.
Download (HTTP): https://www.libsdl.org/release/SDL3-3.2.16.tar.gz
alsa-lib, GBM (GBM from Mesa or Mesa), libdecor-0.2.3, libusb, OpenGL (libglvnd or Mesa), Pipewire, PulseAudio, Vulkan-Loader, Wayland-Protocols, libxkbcommon, and and Xorg Libraries
Install SDL3 by running the following commands:
mkdir build && cd build && 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 Ninja .. && ninja
Now, as the root
user:
ninja install
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 SDL_STATIC=OFF \
-D SDL_RPATH=OFF \
-D SDL_TESTS=ON \
-D SDL_INSTALL_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/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. Make sure SDL3 is installed before running the tests, or
use the LD_PRELOAD
variable to preload
libSDL3.so
from ../build
for each test.
Install lib32-SDL3 by running the following commands:
cd ../ && rm -rf build build-tests && mkdir build && cd build && 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 SDL_TEST_LIBRARY=OFF \ -D SDL_STATIC=OFF \ -D SDL_RPATH=OFF \ -W no-dev -G Ninja .. && ninja
Now, as the root
user:
DESTDIR=$PWD/DESTDIR ninja install && cp -vr DESTDIR/usr/lib32/* /usr/lib32 && rm -rf DESTDIR && ldconfig
-D SDL_TEST_LIBRARY=OFF
:
This parameter disables building an unnecessary static library
meant for the tests. It gets built in the tests compilation.
-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.