# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/games-emulation/xmame/xmame-0.105.ebuild,v 1.1 2006/04/17 08:52:58 mr_bones_ Exp $ inherit flag-o-matic toolchain-funcs eutils games TARGET="${PN}" DESCRIPTION="Multiple Arcade Machine Emulator for X11" HOMEPAGE="http://x.mame.net/" SRC_URI="http://x.mame.net/download/xmame-${PV}.tar.bz2" LICENSE="XMAME" SLOT="0" KEYWORDS="alpha ~amd64 ~hppa ia64 ppc sparc x86" IUSE="alsa arts dga esd expat ggi joystick lirc mmx net opengl sdl svga X xinerama xv" RDEPEND="sys-libs/zlib alsa? ( media-libs/alsa-lib ) arts? ( kde-base/arts ) dga? ( || ( ( x11-libs/libXxf86dga x11-libs/libXxf86vm ) virtual/x11 ) ) esd? ( >=media-sound/esound-0.2.29 ) expat? ( dev-libs/expat ) ggi? ( media-libs/libggi ) lirc? ( app-misc/lirc ) opengl? ( virtual/opengl virtual/glu ) sdl? ( >=media-libs/libsdl-1.2.0 ) svga? ( media-libs/svgalib ) xinerama? ( || ( x11-libs/libXinerama virtual/x11 ) ) xv? ( || ( x11-libs/libXv virtual/x11 ) ) X? ( || ( x11-libs/libXext virtual/x11 ) )" DEPEND="${RDEPEND} dga? ( || ( ( x11-proto/xf86dgaproto x11-proto/xf86vidmodeproto ) virtual/x11 ) ) xinerama? ( || ( x11-proto/xineramaproto virtual/x11 ) ) xv? ( || ( x11-proto/videoproto virtual/x11 ) ) x86? ( dev-lang/nasm )" # Icc sucks. bug #41342 # icc? ( dev-lang/icc ) S=${WORKDIR}/xmame-${PV} toggle_feature() { if use $1 ; then sed -i \ -e "/$2.*=/s:#::" Makefile \ || die "sed Makefile ($1 / $2) failed" fi } toggle_feature2() { use $1 && toggle_feature $2 $3 } src_unpack() { local mycpu= unpack ${A} cd "${S}" case ${ARCH} in x86) mycpu="i386";; ia64) mycpu="ia64";; amd64) mycpu="amd64";; ppc) mycpu="risc";; sparc) mycpu="risc";; hppa) mycpu="risc";; alpha) mycpu="alpha";; mips) mycpu="mips";; esac sed -i \ -e '/^BUILD_EXPAT/s/^/#/' \ -e "/^PREFIX/s:=.*:=/usr:" \ -e "/^MY_CPU/s:i386:${mycpu}:" \ -e "/^BINDIR/s:=.*:=${GAMES_BINDIR}:" \ -e "/^MANDIR/s:=.*:=/usr/share/man/man6:" \ -e "/^XMAMEROOT/s:=.*:=${GAMES_DATADIR}/${TARGET}:" \ -e "/^TARGET/s:mame:${TARGET:1}:" \ -e "/^CFLAGS =/d" \ -e "/\bCFLAGS +=/d" \ Makefile \ || die "sed Makefile failed" if use ppc ; then sed -i \ -e '/LD.*--relax/s:^# ::' Makefile \ || die "sed Makefile (ppc/LD) failed" fi if use mmx ; then cat >> src/unix/effect_asm.asm < /dev/null fi done insinto "${GAMES_DATADIR}/${PN}" doins -r ctrlr || die "doins failed" dodoc doc/{changes.*,*.txt,mame/*,${TARGET}rc.dist} README todo \ || die "dodoc failed" dohtml -r doc/* || die "dohtml failed" # default to sdl since the client is a bit more featureful if use sdl ; then dosym "${TARGET}.SDL" "${GAMES_BINDIR}/${TARGET}" elif [ ${disp} -eq 0 ] || use opengl || use X || use dga || use xv ; then dosym "${TARGET}.x11" "${GAMES_BINDIR}/${TARGET}" elif use svga ; then dosym ${TARGET}.svgalib "${GAMES_BINDIR}/${TARGET}" #elif use ggi ; then #dosym ${TARGET}.ggi "${GAMES_BINDIR}/${TARGET}" fi prepgamesdirs } pkg_postinst() { games_pkg_postinst einfo "Your available MAME binaries are: ${TARGET}" if useq opengl || useq X || useq dga || useq xv ; then einfo " ${TARGET}.x11" fi useq sdl && einfo " ${TARGET}.SDL" #useq ggi && einfo " ${TARGET}.ggi" useq svga && einfo " ${TARGET}.svgalib" einfo "Helper utilities are located in ${GAMES_LIBDIR}/${PN}." }