app=sdl
version=1.2.15
build=1sml
homepage="https://www.libsdl.org"
download="https://www.libsdl.org/release/SDL-1.2.5.tar.gz"
desc="C Library providing low-level I/O access to hardware devices via OpenGL and 2D framebuffer"
requires="alsa-lib libx11 libxext libxrender glu mesa"

build() {
  mkandenterbuilddir
  rm -rf SDL-$version

  tar xf $srcdir/SDL-$version.tar.?z*
  cd SDL-$version
  fixbuilddirpermissions

  applypatch $srcdir/grabnotviewable.patch
  applypatch $srcdir/xdata32.patch

  ./configure \
    --prefix="" \
    --sysconfdir=/etc \
    --disable-nasm \
    --disable-esd \
    --disable-video-svga \
    --disable-video-ggi \
    --disable-video-aalib \
    --enable-alsa \
    --with-x \
    --disable-rpath \
    --disable-static \
    --disable-pulseaudio \
    $builddist

  make
  make install DESTDIR=$pkg

  cp COPYING $pkgdocs/
  removestaticlibs
  
  mkfinalpkg
}

sha512sums="
750c7ddcb72218e3b67d4149281d24da50f4633e47f73ad54d0d9e0e8f717784c982babe481d0017835c276a5b8f2159ef0d765835e051aa335d672cb2c40c20  SDL-1.2.15.tar.lz
20049408d4c00d895c39a7901d889d1874ebcd382e93b2e8df38bd3726e2236f4e9a980720724cf176a35d05fb0db5dbcabd42089423adeb404f2dba16d52b7b  grabnotviewable.patch
ae7cdb61930199a7989e1690be37133eddeb8d446fef3fb5bbe0008d5e3b30abb28f4cc8ffea5d7a186ec242f158ed06dbd2b9ea98ca3e3caeed5ab12bac6875  xdata32.patch
"
