# Template file for 'zsnes'
#
# 32bit
pkgname=zsnes
version=1.51
revision=5
archs="i686"
build_wrksrc="src"
build_style=gnu-configure
configure_args="force_arch=i686"
hostmakedepends="nasm pkg-config"
makedepends="MesaLib-devel sdl12-compat-devel libpng-devel ncurses-devel"
depends="desktop-file-utils hicolor-icon-theme"
short_desc="Super Nintendo emulator"
maintainer="Orphaned <orphan@voidlinux.org>"
license="GPL-2.0-only"
homepage="https://www.zsnes.com/"
distfiles="${SOURCEFORGE_SITE}/zsnes/zsnes151src.tar.bz2"
checksum=2856dedba272e9eed66cbf68dd4a9ae56797c373686c57371a65c7df35264623
lib32mode="full"

CFLAGS="-fcommon"
CXXFLAGS="-fcommon"

do_configure() {
	# The build system fails to honor -std=c++14 in CXXFLAGS,
	# so we'll force it in the compiler executable name
	CXX="${CXX} -std=c++14" ./configure ${configure_args}
}

post_install() {
	vmkdir usr/share
	mv ${DESTDIR}/usr/man ${DESTDIR}/usr/share

	vinstall ${FILESDIR}/zsnes.png 644 usr/share/pixmaps
	vinstall ${FILESDIR}/zsnes.desktop 644 usr/share/applications
}
