archrelease: copy trunk to extra-x86_64
[arch-packages.git] / sdl2 / trunk / PKGBUILD
blob260fa7d404db9101ef8233b78803ab000e4b2baf
1 # Maintainer: Sven-Hendrik Haase <svenstaro@archlinux.org>
2 pkgname=sdl2
3 pkgver=2.26.5
4 pkgrel=2
5 pkgdesc="A library for portable low-level access to a video framebuffer, audio output, mouse, and keyboard (Version 2)"
6 arch=('x86_64')
7 url="https://www.libsdl.org"
8 license=('MIT')
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'
12              'libdecor')
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'
20             'SKIP')
21 validpgpkeys=('1528635D8053A57F77D1E08630A59377A7763BE6') # Sam Lantinga
23 build() {
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 \
28     -D SDL_STATIC=OFF \
29     -D SDL_RPATH=OFF
30   cmake --build build
33 package() {
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: