# Contributor: Alex McGrath <amk@amk.ie>
# Maintainer: Alex McGrath <amk@amk.ie>
pkgname=mupen64plus
pkgver=2.6.0
pkgrel=0
pkgdesc="Mupen64Plus is a cross-platform plugin-based N64 emulator."
url="https://mupen64plus.org/"
# build fails or is not officially supported for this release for all but x86_64
arch="x86_64"
license="GPL-2.0-only"
makedepends="
	bash
	boost-dev
	freetype-dev
	glu-dev
	libpng-dev
	libsamplerate-dev
	nasm
	sdl2-dev
	vulkan-loader-dev
	zlib-dev
	"
source="https://github.com/mupen64plus/mupen64plus-core/releases/download/$pkgver/mupen64plus-bundle-src-$pkgver.tar.gz
	fix-null-usage.patch
	"
options="!check" # no test suite
subpackages="$pkgname-doc"
builddir="$srcdir/mupen64plus-bundle-src-$pkgver"

build() {
	PIE=1 USE_GLES=1 ./m64p_build.sh
}

package() {
	PIE=1 USE_GLES=1 ./m64p_install.sh DESTDIR="$pkgdir" PREFIX='/usr'
}

sha512sums="
e8e88add21908c3967adf9b210ab4d0e7f0b5bc3e8d962755cd16e0964c80cb7b3fad96f1855b992f4cee87ed09eddb3f85e16168d9a30135caed733a4fe78af  mupen64plus-bundle-src-2.6.0.tar.gz
c3d24b5c83d7f3f87fb7cde8e8a16848b3bf2888f11b7b4b66cec819d8c880b6183fdb2c6ca13228ad20eb89197e0e63b231a43aaedb092167980e885409388d  fix-null-usage.patch
"
