# Adapted from Arch Linux sdl3 PKGBUILD at:
# https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h=sdl3

require 'buildsystems/cmake'

class Sdl3 < CMake
  description 'A library for portable low-level access to a video framebuffer, audio output, mouse, and keyboard Version 3'
  homepage 'https://www.libsdl.org'
  version '3.2.26'
  license 'zlib'
  compatibility 'aarch64 armv7l x86_64'
  source_url 'https://github.com/libsdl-org/SDL.git'
  git_hashtag "release-#{version}"
  binary_compression 'tar.zst'

  binary_sha256({
    aarch64: 'e15bb9fb42ba699682c2f7df2ed7a33d8f3e209d9e79b54947bfd1ad5e6c9c1c',
     armv7l: 'e15bb9fb42ba699682c2f7df2ed7a33d8f3e209d9e79b54947bfd1ad5e6c9c1c',
     x86_64: 'f5671ad5fd62ffd3e653033b8e5341f159c566a1c3c6334f0aec582f5637409f'
  })

  depends_on 'alsa_lib' => :build
  depends_on 'glibc' # R
  depends_on 'libusb' => :build
  depends_on 'libx11' => :build
  depends_on 'libxcursor' => :build
  depends_on 'libxext' => :build
  depends_on 'libxinerama' => :build
  depends_on 'libxkbcommon' => :build
  depends_on 'libxrandr' => :build
  depends_on 'libxrender' => :build
  depends_on 'mesa' => :build
  depends_on 'pulseaudio' => :build
  depends_on 'wayland' => :build

  cmake_options '-DSDL_HIDAPI_LIBUSB=OFF \
    -DSDL_RPI=OFF \
    -DSDL_STATIC=OFF \
    -DSDL_RPATH=OFF'
end
