# Copyright 1999-2008 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit subversion eutils flag-o-matic games DESCRIPTION="A fork of Mupen64 Nintendo 64 (N64) emulator" HOMEPAGE="http://code.google.com/p/mupen64plus/" ESVN_FETCH_CMD="svn checkout --username mupen64 --password Dyson5632-kart" ESVN_REPO_URI="svn://fascination.homelinux.net:7684/mupen64plus/trunk" ESVN_PROJECT="mupen64plus" LICENSE="GPL-2" SLOT="0" KEYWORDS="~amd64 ~x86" IUSE="gtk lirc custom-cflags" RDEPEND="virtual/opengl media-libs/libsdl media-libs/sdl-ttf media-libs/libsamplerate gtk? ( >=x11-libs/gtk+-2 ) lirc? ( app-misc/lirc )" DEPEND="${RDEPEND} >=dev-lang/yasm-0.6.2 dev-util/pkgconfig" S=${WORKDIR}/trunk pkg_setup() { games_pkg_setup } src_unpack() { subversion_src_unpack cd ${S} sed -i -e "s:/share/mupen64plus/:/mupen64plus/:" main/main.c || die "sed failed" MARCH=`get-flag "-march"` sed -i -e "s:\$\(STRIP\)\ \$\@::" Makefile || die "sed failed" sed -i -e "s:-march=athlon64\|-march=i686:${MARCH}:" pre.mk glide64/Makefile || die "sed failed" if use custom-cflags;then sed -i -e "s:-ffast-math\ -funroll-loops\ -fexpensive-optimizations:${CFLAGS}:" 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() { dogamesbin ${PN} || die "dogamesbin failed" dodir "${GAMES_DATADIR}/${PN}/plugins" || die "dodir failed" exeinto "${GAMES_DATADIR}/${PN}/plugins" doexe plugins/* || die "doexe failed" insinto "${GAMES_DATADIR}/${PN}" doins -r config lang icons mupen64plus.ini || die "doins failed" dodoc doc/HiRezTexture.txt || die "dodoc failed" doman doc/${PN}.1.gz || die "doman failed" newicon icons/logo.png "${PN}.png" || die "newicon failed" make_desktop_entry "${GAMES_BINDIR}/${PN}" Mupen64Plus || die "make_desktop_entry failed" 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 }