# 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="ZSNESS_0514" DESCRIPTION="SNES (Super Nintendo) emulator that uses x86 assembly" HOMEPAGE="http://www.zsnes.com/ http://ipherswipsite.com/zsnes/" SRC_URI="http://files.ipherswipsite.com/zsnes/${MY_P}.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. 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}/zsnes" pkg_setup() { games_pkg_setup use amd64 && export ABI=x86 } PATCH_VER="1.43_pre20060329" src_unpack() { unpack ${A} cd "${S}"/src cp "icons/48x48x32.png" "${T}/zsnes.png" epatch "${FILESDIR}"/${PATCH_VER}-configure.patch epatch "${FILESDIR}"/${PATCH_VER}-psrMakeRule.patch einfo "Modifying all .asm files to have non-executable stacks" bash "${FILESDIR}"/tagWithNoStackExec.sh `find . -name "*.asm"` 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 }