#### Beyond Linux® From Scratch (System V Edition) - Version 12.3

### Chapter 42. Multimedia Libraries and Drivers

- Prev

  sdl12-compat-1.2.68

- Next

  sound-theme-freedesktop-0.8

- Up
- Home

# SDL2-2.30.11

## Introduction to SDL2

The Simple DirectMedia Layer Version 2 (SDL2 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.3 platform.

### Package Information

- Download (HTTP): https://www.libsdl.org/release/SDL2-2.30.11.tar.gz

- Download MD5 sum: bea190b480f6df249db29eb3bacfe41e

- Download size: 7.2 MB

- Estimated disk space required: 188 MB (with docs)

- Estimated build time: 0.5 SBU (using parallelism=4; with docs)

### SDL2 Dependencies

#### Recommended

libxkbcommon-1.8.0, wayland-protocols-1.40, and Xorg Libraries (if those are not present, the corresponding modules are not built)

#### Optional

alsa-lib-1.2.13, Doxygen-1.13.2 (to create documentation), ibus-1.5.31, libsamplerate-0.2.2, libunwind-1.8.1, NASM-2.16.03, pipewire-1.2.7, PulseAudio-17.0, a graphical environment, DirectFB, fcitx, jack, and sndio

## Installation of SDL2

Install SDL2 by running the following commands:

    ./configure --prefix=/usr &&
    make

If you have Doxygen-1.13.2 installed and want to build the html documentation, run the following commands:

    pushd docs  &&
      doxygen   &&
    popd

### Note

If you wish to build and run the package regression tests, do not delete the static libraries below until after the tests are built.

Now, as the `root` user:

    make install              &&
    rm -v /usr/lib/libSDL2*.a

If you built the documentation, install it as the `root` user:

    install -v -m755 -d        /usr/share/doc/SDL2-2.30.11/html &&
    cp -Rv  docs/output/html/* /usr/share/doc/SDL2-2.30.11/html

## Testing SDL2

If you wish to, test the installation of SDL2 using the included test programs. None of the resulting binaries need to be installed. Issue the following commands to build the test programs:

    cd test &&
    ./configure &&
    make

Each of the test programs (they are listed in the `README` file in this directory) will need to be run individually. Many of them will need to be manually killed. Additionally, speakers need to be on with the volume at a suitable level.

## Command Explanations

rm -v /usr/lib/libSDL2*.a: Normally static libraries can be disabled with a `--disable-static` option to configure, but that breaks the build in this package.

## Contents

Installed Program: sdl2-config
Installed Libraries: libSDL2.so
Installed Directories: /usr/include/SDL2, /usr/lib/cmake/SDL2, and /usr/share/doc/SDL-2.30.11

### Short Descriptions

sdl2-config | determines the compile and linker flags that should be used to compile and link programs that use `libSDL2`
`libSDL2.so` | contains functions that provide low level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL, and the 2D frame buffer across multiple platforms

- Prev

  sdl12-compat-1.2.68

- Next

  sound-theme-freedesktop-0.8

- Up
- Home