# $OpenBSD$

COMMENT =	simple front-end for the libsnes library
V =		0.9.7
DISTNAME =	retroarch-${V}
CATEGORIES =	emulators

HOMEPAGE =	http://www.libretro.org/

MAINTAINER =	Ryan Freeman <ryan@slipgate.org>

# GPLv2
PERMIT_PACKAGE_CDROM =		Yes
PERMIT_PACKAGE_FTP =		Yes
PERMIT_DISTFILES_CDROM =	Yes
PERMIT_DISTFILES_FTP =		Yes

MASTER_SITES =	http://themaister.net/retroarch-dl/

RUN_DEPENDS = emulators/libretro-bsnes

WANTLIB += GL X11 Xext Xv c freetype m ossaudio pthread stdc++
WANTLIB += SDL SDL_image jpeg png tiff xml2 z

LIB_DEPENDS = 	devel/sdl \
		devel/sdl-image \
		graphics/jpeg \
		graphics/png \
		graphics/tiff \
		textproc/libxml

USE_GMAKE =	Yes
MAKE_FLAGS =	V=1

CONFIGURE_STYLE = simple

# disable many excess deps here so they don't get pulled
CONFIGURE_ARGS +=	--disable-ffmpeg \
			--disable-alsa \
			--disable-oss \
			--disable-rsound \
			--disable-roar \
			--disable-al \
			--disable-jack \
			--disable-coreaudio \
			--disable-pulse \
			--disable-python
		
post-extract:
	# fix Makefile to install man pages correctly
	@perl -pi -e "s,/share/man/man1,/man/man1," ${WRKSRC}/Makefile

#do-configure:
#	@cd ${WRKSRC} && ./configure # ${CONFIGURE_ARGS}

post-install:
	# install example configuration file to appropriate location
	${INSTALL_DATA_DIR} ${PREFIX}/share/examples/retroarch/
	${INSTALL_DATA} ${WRKDIST}/retroarch.cfg \
		${PREFIX}/share/examples/retroarch/

.include <bsd.port.mk>
