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://www.libsdl.org/release/SDL2-${pkgver}.tar.gz"{,.sig})
19 sha512sums=('ca4b690433cd4d9d73b797da98666317128e7e817ab60e874a49d94791ea41e8a6b4fc43649593120daa0702190c0f8a6ed326c908d87375c8da9f369d994f6a'
21 validpgpkeys=('1528635D8053A57F77D1E08630A59377A7763BE6') # Sam Lantinga
24 CFLAGS+=" -ffat-lto-objects"
25 cmake -S SDL2-${pkgver} -B build -G Ninja \
26 -D CMAKE_INSTALL_PREFIX=/usr \
33 DESTDIR="${pkgdir}" cmake --install build
35 # For some reason, this isn't named correctly and we have to fix it to reflect the actual staticlib name.
36 sed -i "s/libSDL2\.a/libSDL2main.a/g" "$pkgdir"/usr/lib/cmake/SDL2/SDL2Targets-noconfig.cmake
38 install -Dm644 SDL2-${pkgver}/LICENSE.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
41 # vim:set ts=2 sw=2 et: