# $Id: Portfile 58210 2009-09-24 06:56:08Z ryandesign@macports.org $

PortSystem 1.0

name		mednafen
version		0.8.1
revision	1
platforms	darwin
categories	emulators games
maintainers	freebsd.org:adamw
description	Super-fast and super-compatible emulator for many video game systems
long_description	Medfafen is a portable (utilizing OpenGL and SDL) \
			argument-driven multi-system emulator with many \
			advanced features. The Atari Lynx, GameBoy, GameBoy \
			Colour, GameBoy Advance, NES, PC Engine (TurboGrafx 16) \
			and SuperGrafx are emulated. Mednafen has the ability \
			to remap hotkey functions and virtual system inputs \
			to a keyboard, a joystick, or both simultaneously. \
			Save states are supported, as is real-time game \
			rewinding.

homepage	http://mednafen.sourceforge.net/
master_sites	sourceforge
use_bzip2	yes
checksums	md5 71067abd527d1e57f7124e31301a7201
depends_lib	path:lib/pkgconfig/sdl.pc:libsdl \
		port:libsdl_net \
		port:libsndfile \
		port:libcdio \
		port:zlib

# Just an FYI: even though it takes a billion years to compile
# src/gba/arm.cpp, it *does* finish eventually.

patchfiles	patch-src_selblur.cpp

worksrcdir	${name}

post-destroot {
	xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}
	xinstall -m 755 ${worksrcpath}/README ${destroot}${prefix}/share/doc/${name}
	xinstall -m 755 ${worksrcpath}/ChangeLog ${destroot}${prefix}/share/doc/${name}
	eval xinstall [glob ${worksrcpath}/Documentation/*] ${destroot}${prefix}/share/doc/${name}
}

post-activate {

ui_msg "\n
Mednafen works by executing the ROM file of a game console you'd like to emulate.  Note
that no ROM files are included with Mednafen, so first you must obtain the game console
ROM file of your choice, by legal means of course.  

Supported ROM file formats are listed in section 'File Formats/Expansion Hardware'
in the Mednafen documenation at ${prefix}/share/doc/${name}.  Once you've obtained a
supported type of game console ROM file, start the Mednafen command-line executable and use
the ROM filename (including path) as an argument.  See the documentation for more options.
\n"
}
