# Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ EAPI="2" inherit eutils games DESCRIPTION="A fork of Mupen64 Nintendo 64 emulator" HOMEPAGE="http://code.google.com/p/mupen64plus/" SRC_URI="" MY_REPO_BASE="https://bitbucket.org/richard42" MY_REPO_MODULES="mupen64plus-core mupen64plus-ui-console mupen64plus-audio-sdl mupen64plus-input-sdl mupen64plus-rsp-hle mupen64plus-video-rice" MY_PLUGIN_BASE="https://bitbucket.org/wahrhaft" MY_PLUGIN_MODULES="mupen64plus-rsp-z64 mupen64plus-video-arachnoid mupen64plus-video-glide64 mupen64plus-video-z64" LICENSE="GPL-2" SLOT="0" KEYWORDS="~amd64 ~x86" IUSE="debug libsamplerate lirc pic plugins profile sse" RDEPEND="virtual/opengl dev-vcs/mercurial media-libs/freetype:2 media-libs/libpng media-libs/libsdl media-libs/sdl-ttf media-fonts/dejavu sys-libs/zlib libsamplerate? ( media-libs/libsamplerate ) lirc? ( app-misc/lirc ) app-arch/xz-utils" DEPEND="${RDEPEND} dev-lang/yasm dev-util/pkgconfig" src_unpack() { # Fetch source from all repos for REPO in ${MY_REPO_MODULES[@]}; do einfo "\nRetrieving ${REPO}..." hg clone "${MY_REPO_BASE}/${REPO}" || die "clone ${REPO} failed" done # Fetch source for plugins if use plugins; then for REPO in ${MY_PLUGIN_MODULES[@]}; do einfo "\nRetrieving ${REPO}..." hg clone "${MY_PLUGIN_BASE}/${REPO}" || die "clone ${REPO} failed" done fi # Apply patches here instead of prepare since source must be retrieved first epatch "${FILESDIR}"/ftbfs-gvariant-type-conflicts.patch # Fix man path sed -e 's:$(PREFIX)/share/man:/usr/share/man:' \ -i "${PN}-ui-console/projects/unix/Makefile" || die "sed man path failed" } src_compile() { # Note: Variables cannot be quoted or ui-console will not build OPTS="PREFIX=${GAMES_PREFIX} LIBDIR=$(games_get_libdir)/${PN} COREDIR=$(games_get_libdir)/${PN}/ PLUGINDIR=$(games_get_libdir)/${PN}/plugins SHAREDIR=${GAMES_DATADIR} DESTDIR=${D}" #INCDIR= " use debug && OPTS+=" DEBUG=1 DEBUGGER=1 PLUGINDBG=1" use libsamplerate || OPTS+=" NO_RESAMP=1" use lirc && OPTS+=" LIRC=1" use pic && OPTS+=" PIC=1" use profile && OPTS+=" PROFILE=1" use sse || OPTS+=" NO_ASM=1" # Build all modules for REPO in ${MY_REPO_MODULES[@]}; do einfo "\nBuilding ${REPO}..." emake -C "${REPO}/projects/unix" all $OPTS || die "make ${REPO} failed" done # Build all plugins if use plugins; then for REPO in ${MY_PLUGIN_MODULES[@]}; do einfo "\nBuilding ${REPO}..." emake -C "${REPO}/projects/unix" all $OPTS || die "make ${REPO} failed" done fi } src_install() { # Install binary/libraries and documentation for REPO in ${MY_REPO_MODULES[@]}; do einfo "\nInstalling ${REPO}..." emake -C "${REPO}/projects/unix" install $OPTS || die "install ${REPO} failed" newdoc "${REPO}/RELEASE" "RELEASE.${REPO}" [ -f "${REPO}/README" ] && newdoc "${REPO}/README" "README.${REPO}" [ -f "${REPO}/README" ] && newdoc "${REPO}/README" "README.${REPO}" done # Install plugins if use plugins; then for REPO in ${MY_PLUGIN_MODULES[@]}; do einfo "\nInstalling ${REPO}..." emake -C "${REPO}/projects/unix" install $OPTS || die "install ${REPO} failed" newdoc "${REPO}/RELEASE" "RELEASE.${REPO}" [ -f "${REPO}/README" ] && newdoc "${REPO}/README" "README.${REPO}" [ -f "${REPO}/README" ] && newdoc "${REPO}/README" "README.${REPO}" done fi prepgamesdirs } pkg_postinst() { games_pkg_postinst elog "As of 2.0, Mupen64Plus includes only a command line launcher." elog "Run 'mupen64plus --help' for options." echo elog "If you would prefer to use a GUI frontend, see the following for options:" elog "http://code.google.com/p/mupen64plus/wiki/ThirdPartyPlugins#Third-Party_Front-end_Applications" if use lirc; then echo elog "For lirc configuration see:" elog "http://code.google.com/p/mupen64plus/wiki/LIRC" fi }