# Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/games-emulation/xmess/xmess-0.105.ebuild,v 1.4 2007/03/12 14:07:09 genone 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 ) 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 ) xv? ( x11-libs/libXv ) X? ( x11-libs/libXext )" DEPEND="${RDEPEND} dga? ( x11-proto/xf86dgaproto x11-proto/xf86vidmodeproto ) xinerama? ( x11-proto/xineramaproto ) xv? ( x11-proto/videoproto ) 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 elog "Your available MAME binaries are: ${TARGET}" if useq opengl || useq X || useq dga || useq xv ; then elog " ${TARGET}.x11" fi useq sdl && elog " ${TARGET}.SDL" #useq ggi && elog " ${TARGET}.ggi" useq svga && elog " ${TARGET}.svgalib" elog "Helper utilities are located in ${GAMES_LIBDIR}/${PN}." }