# $Id: PKGBUILD 120641 2014-10-14 11:36:10Z spupykin $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Tiago Pierezan Camargo <tcamargo@gmail.com>
# Contributor: robb_force <robb_force@holybuffalo.net>

pkgname=nestopia
pkgver=1.46.2
pkgrel=1
pkgdesc='An NES emulator featuring cycle exact emulation, a ridiculous number of mappers, and lots of custom sound chips.'
url='http://0ldsk00l.ca/nestopia/'
license=('GPL')
arch=('i686' 'x86_64')
depends=('sdl2' 'alsa-lib' 'gtk3' 'glu' 'libarchive' 'libao')
makedepends=('unzip' 'mesa' 'xdg-utils')
source=("$pkgname-$pkgver.tar.gz::https://github.com/rdanbrook/nestopia/tarball/$pkgver"
	"build-fix.patch")
md5sums=('3af8ed8ce084803a50a2d058b6d77e6e'
         '4a852d8e484c2fe214377ec18a68356f')

prepare() {
  cd ${srcdir}/rdanbrook-nestopia-*
  patch -p1 <$srcdir/build-fix.patch
}

build() {
  cd ${srcdir}/rdanbrook-nestopia-*
  make PREFIX=/usr
}

package() {
  cd ${srcdir}/rdanbrook-nestopia-*
  mkdir -p $pkgdir/usr/{bin,share/nestopia}
  make install PREFIX=$pkgdir/usr
}
