1 # Maintainer: Sven-Hendrik Haase <svenstaro@archlinux.org>
5 pkgdesc="A library for portable low-level access to a video framebuffer, audio output, mouse, and keyboard (Version 2)"
7 url="https://www.libsdl.org"
9 depends=('glibc' 'libxext' 'libxrender' 'libx11' 'libgl' 'libxcursor' 'hidapi' 'libusb')
10 makedepends=('alsa-lib' 'mesa' 'libpulse' 'libxrandr' 'libxinerama' 'wayland' 'libxkbcommon'
11 'wayland-protocols' 'ibus' 'fcitx5' 'libxss' 'cmake' 'jack' 'ninja' 'pipewire'
13 optdepends=('alsa-lib: ALSA audio driver'
14 'libpulse: PulseAudio audio driver'
15 'jack: JACK audio driver'
16 'pipewire: PipeWire audio driver'
17 'libdecor: Wayland client decorations')
18 source=("https://github.com/libsdl-org/SDL/releases/download/release-${pkgver}/SDL2-${pkgver}.tar.gz"{,.sig})
19 sha512sums=('0f37b443950bc89c3f3add2fc9a9970f42b47e933c106a1d676d1715c520125d5725ffcb9ff85bcf66ac3ff78d9d43d994f9c1935b7c0fd7951e10e251936bcc'
21 validpgpkeys=('1528635D8053A57F77D1E08630A59377A7763BE6') # Sam Lantinga
24 CFLAGS+=" -ffat-lto-objects"
25 cmake -S SDL2-${pkgver} -B build -G Ninja \
26 -D SDL_HIDAPI_LIBUSB=ON \
27 -D CMAKE_INSTALL_PREFIX=/usr \
34 DESTDIR="${pkgdir}" cmake --install build
36 # For some reason, this isn't named correctly and we have to fix it to reflect the actual staticlib name.
37 sed -i "s/libSDL2\.a/libSDL2main.a/g" "$pkgdir"/usr/lib/cmake/SDL2/SDL2Targets-noconfig.cmake
39 install -Dm644 SDL2-${pkgver}/LICENSE.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
42 # vim:set ts=2 sw=2 et: