# Maintainer: Maxime Gauduin <alucryd@archlinux.org>

pkgname=libretro-melonds
pkgver=2016
pkgrel=1
pkgdesc='Nintendo DS core'
arch=(x86_64)
url=https://github.com/libretro/melonDS
license=(GPL2)
groups=(libretro)
depends=(
  libgl
  libretro-core-info
)
makedepends=(
  git
  libglvnd
)
_commit=7a3c11ff970cd36ca806961fae6db94b30dd5401
source=(libretro-melonds::git+https://github.com/libretro/melonDS.git#commit=${_commit})
sha256sums=('b3a7f9cb0a4626b2f9ecd9bf50e814373e82ce14f6c0cf4a4b9a0c7e47c4e170')

pkgver() {
  cd libretro-melonds

  git rev-list --count HEAD
}

build() {
  export LDFLAGS="$LDFLAGS -lpthread"

  make -C libretro-melonds
}

package() {
  install -Dm 644 libretro-melonds/melonds_libretro.so -t "${pkgdir}"/usr/lib/libretro/
}

# vim: ts=2 sw=2 et:
