# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils flag-o-matic games MY_P="${PN}${PV/'.'/}" DESCRIPTION="SNES (Super Nintendo) emulator that uses x86 assembly" HOMEPAGE="http://www.zsnes.com/ http://ipherswipsite.com/zsnes/" SRC_URI="mirror://sourceforge/zsnes/${MY_P}src.tar.bz2" LICENSE="GPL-2" SLOT="0" KEYWORDS="-* ~amd64 ~x86" IUSE="debug opengl png release" # The debug USE flag makes a "zsnesd" binary with # debugging enabled. # The release USE flag makes nasm run more than 2 passes. # This means you will get a potentially more optimized binary # at the expense of increased compile time. export MAKEOPTS="-j1" RDEPEND=">=media-libs/libsdl-1.2.0 >=sys-libs/zlib-1.1 amd64? ( app-emulation/emul-linux-x86-sdl ) opengl? ( virtual/opengl ) png? ( media-libs/libpng )" DEPEND="${RDEPEND} >=dev-lang/nasm-0.98 sys-devel/automake >=sys-devel/autoconf-2.58" S="${WORKDIR}/${PN}_${PV//./_}" pkg_setup() { games_pkg_setup use amd64 && export ABI=x86 } CONFIG_PATCH_VER="1.50" src_unpack() { unpack ${A} cd "${S}"/src cp "icons/48x48x32.png" "${T}/zsnes.png" epatch "${FILESDIR}"/${CONFIG_PATCH_VER}-configure.patch aclocal && autoconf || die "autotools failed" } src_compile() { cd src egamesconf \ $(use_enable png libpng) \ $(use_enable opengl) \ $(use_enable debug) \ $(use_enable release) \ || die emake || die "emake failed" } src_install() { local ZSNES_BIN= if use debug ; then ZSNES_BIN=zsnesd else ZSNES_BIN=zsnes fi dogamesbin src/${ZSNES_BIN} || die "dogamesbin failed" newman src/linux/zsnes.1 zsnes.6 dodoc docs/{*.txt,README.LINUX} dohtml -r docs/Linux/* make_desktop_entry ${ZSNES_BIN} ZSNES zsnes.png doicon "${T}/zsnes.png" prepgamesdirs }