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

pkgname=libretro-mupen64plus-next
pkgver=374
pkgrel=1
epoch=1
pkgdesc='Nintendo 64 core'
arch=(x86_64)
url=https://github.com/libretro/mupen64plus-libretro-nx
license=(GPL2)
groups=(libretro)
depends=(
  gcc-libs
  glibc
  libgl
  libpng
  libretro-core-info
  minizip
  xxhash
  zlib
)
makedepends=(
  git
  mesa
  nasm
)
replaces=(libretro-mupen64plus)
_commit=b4024d75597da162bbc7cb693b8cef0d6da75105
source=(libretro-mupen64plus-next::git+https://github.com/libretro/mupen64plus-libretro-nx.git#commit=${_commit})
sha256sums=(SKIP)

pkgver() {
  cd libretro-mupen64plus-next

  git rev-list --count HEAD
}

build() {
  make \
    WITH_DYNAREC=x86_64 \
    HAVE_PARALLEL_RDP=1 \
    HAVE_PARALLEL_RSP=1 \
    HAVE_THR_AL=1 \
    SYSTEM_LIBPNG=1 \
    SYSTEM_MINIZIP=1 \
    SYSTEM_XXHASH=1 \
    SYSTEM_ZLIB=1 \
    -C libretro-mupen64plus-next
}

package() {
  install -Dm 644 libretro-mupen64plus-next/mupen64plus_next_libretro.so -t "${pkgdir}"/usr/lib/libretro/
}

# vim: ts=2 sw=2 et:
