# Copyright 1999-2008 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils flag-o-matic games MY_P="Mupen64Plus-1-3-src" DESCRIPTION="A fork of Mupen64 Nintendo 64 (N64) emulator" HOMEPAGE="http://code.google.com/p/mupen64plus/" SRC_URI="http://mupen64plus.googlecode.com/files/${MY_P}.zip" LICENSE="GPL-2" SLOT="0" KEYWORDS="~amd64 ~x86" IUSE="gtk lirc custom-cflags" RDEPEND="virtual/opengl media-libs/libsdl media-libs/sdl-ttf gtk? ( >=x11-libs/gtk+-2 ) lirc? ( app-misc/lirc )" DEPEND="${RDEPEND} dev-lang/yasm dev-util/pkgconfig" S=${WORKDIR}/${MY_P} pkg_setup() { games_pkg_setup } src_unpack() { unpack ${A} cd ${S} epatch "${FILESDIR}"/${P}-paths.patch sed -i \ -e "s:GENTOO_BINDIR:${GAMES_BINDIR}:" \ -e "s:GENTOO_DATADIR:${GAMES_DATADIR}/${PN}:" \ install.sh \ || die "sed failed" MARCH=`get-flag "-march"` sed -i -e "s:\$\(STRIP\)\ \$\@::" Makefile sed -i -e "s:-march=athlon64\|i686:${MARCH}:" pre.mk glide64/Makefile if use custom-cflags;then sed -i -e "s:CFLAGS\ =\ -pipe\ -O3\ -ffast-math\ -funroll-loops\ -fexpensive-optimizations\ -fno-strict-aliasing::" pre.mk sed -i -e "s:-ffast-math\ -funroll-loops:${CFLAGS}:" glide64/Makefile fi if use lirc;then LIRC="LIRC=1" else LIRC="LIRC=0" fi if use gtk;then NOGUI="NOGUI_ONLY=0" else NOGUI="NOGUI_ONLY=1" fi } src_compile() { make PREFIX=${GAMES_DATADIR} ${LIRC} ${NOGUI} all || die "make failed" } src_install() { ./install.sh ${D} || or die "install.sh failed" newicon icons/logo.png "${PN}.png" make_desktop_entry "${GAMES_BINDIR}/${PN}" Mupen64Plus dodoc README RELEASE TODO prepgamesdirs } pkg_postinst() { games_pkg_postinst if use lirc;then echo elog "For lirc configuration see" elog "http://code.google.com/p/mupen64plus/wiki/LIRC" echo fi }