Getting SDL3 on Linux

Get help with compiling or installing the game, and discuss announcements of new official releases.

Moderator: Forum Moderators

Post Reply
Shiki
Developer
Posts: 378
Joined: July 13th, 2015, 9:53 pm
Location: Germany

Getting SDL3 on Linux

Post by Shiki »

The development version of Wesnoth now requires SDL3 to be installed. Many Linux distributions do not yet have the version required for Wesnoth in their stable release, however, with the commands below one can get the up-to-date version on Debian, Ubuntu, Linux Mint etc …

Firstly, add the repository for the unstable Debian packages. This is the repository where software is packaged for future Debian releases.
To not update your whole system, the important trick is to only add deb-src and not deb. This will give you access to the source code only.

Code: Select all

Types: deb-src
URIs: https://ftp.tu-chemnitz.de/debian/
Suites: sid
Components: contrib main non-free non-free-firmware
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
Enabled: yes
Use the command sudo nano /etc/apt/sources.list.d/debian-sid.sources, paste the text with CTRL+SHIFT+V, press CTRL+O to save, and CTRL+X to quit afterwards.

On Ubuntu/Linux Mint, you need additionally: sudo apt install debian-archive-keyring

sudo apt update to read the newly created file and then
sudo apt build-dep libsdl3 will get you the dependencies to build SDL3 from the stable deb repository.

Now, to get SDL3:

Code: Select all

apt source libsdl3     # Gives you the source code from unstable deb-src
cd libsdl3-3.4.10+ds   # Change into the new directory. The version number will be different for you.
debuild -us -uc        # Create fully automatic a new deb package, for your stable Linux distribution.

cd ..
sudo apt install ./libsdl3-0_3.4.10+ds-1_amd64.deb libsdl3-dev_3.4.10+ds-1_amd64.deb
When installing it, please notice that you need to specify the packages as path with ./, to install your local packages instead of the ones from the repository.
You only need the libsdl3-0 and libsdl3-dev, other created packages such as tests or doc are optional.

Do the same again to get SDL3_mixer and SDL3_image:

Code: Select all

apt source libsdl3-mixer
cd libsdl3-mixer-3.2.4+ds
debuild -us -uc
cd ..
sudo apt install ./libsdl3-mixer0_3.2.4+ds-1_amd64.deb ./libsdl3-mixer-dev_3.2.4+ds-1_amd64.deb

apt source libsdl3-image
cd libsdl3-image-3.4.4+ds
debuild -us -uc
cd ..
sudo apt install ./libsdl3-image0_3.4.4+ds-1_amd64.deb ./libsdl3-image-dev_3.4.4+ds-1_amd64.deb
Try out the dark board theme.
User avatar
Elvish_Hunter
Posts: 1613
Joined: September 4th, 2009, 2:39 pm
Location: Lintanir Forest...

Re: Getting SDL3 on Linux

Post by Elvish_Hunter »

For everyone trying to compile Wesnoth 1.19/1.20 on Ubuntu 26.04, almost all the required libraries are available in the repositories (you still need to add deb-src, as Shiki wrote).
I said almost, because SDL3_mixer is still missing from the official repositories. I didn't want to waste time trying to compile it, so I took a lazy approach: I downloaded and installed the latest .deb packages from Debian Sid.
These are the links I used: EDIT: the libsdl3-mixer package appears to have become unavailable, so I guess that this one needs to be used instead: https://packages.debian.org/sid/libsdl3-mixer0.
Current maintainer of these add-ons:
1.19: The Sojournings of Grog
1.16: Children of Dragons, A Rough Life, Wesnoth Lua Pack, The White Troll (co-author)
Post Reply

Return to “Release Announcements, Compiling & Installation”