# Maintainer: Maxime Gauduin <alucryd@archlinux.org>
# Contributor: Cravix <dr.neemous@gmail.com>

pkgname=python2-pygame-sdl2
pkgver=2.1.0.r357.6474370
pkgrel=1
epoch=1
pkgdesc='Reimplementation of portions of the pygame API using SDL2'
arch=(x86_64)
url=https://github.com/renpy/pygame_sdl2
license=(
  LGPL2.1
  zlib
)
depends=(
  python2
  sdl2_image
  sdl2_mixer
  sdl2_ttf
)
makedepends=(
  cython2
  git
)
source=(
  git+https://github.com/renpy/pygame_sdl2.git#commit=6474370f2e67ed392c4685c98f2eb88dce79cff6
  cython.patch
)
sha256sums=(
  SKIP
  fe2ec4d84444ee72c3607ac9e02bf309f069c2b289b5f3d43483db145d741b01
)

pkgver() {
  cd pygame_sdl2

 echo "2.1.0.r$(git rev-list --count HEAD).$(git rev-parse --short HEAD)"
}

prepare() {
  cd pygame_sdl2

  patch -Np1 -i ../cython.patch
}

build() {
  cd pygame_sdl2

  python2 setup.py build
}

package() {
  cd pygame_sdl2

  python2 setup.py install --root="${pkgdir}" --prefix=/usr --optimize=1 --skip-build
  install -Dm 644 COPYING.ZLIB -t "${pkgdir}"/usr/share/licenses/python2-pygame-sdl2/
}

# vim: ts=2 sw=2 et:
