[mythtv-users] Re: X-Box xpad + MythGame-0.18.1 + snes9x + xmame + Gentoo + udev HOWTO

Jesse Guardiani jesse at wingnet.net
Tue Nov 15 13:26:28 EST 2005


byron wrote:
> Thank you very much for the detailed info.  It will surely come in
> handy, especially the xmame patch considering I run Gentoo also and 0.97
> isn't available in Portage.
>   

Care for some ebuilds then? (see attached)
They're identical to the normal builds, but include an epatch line. This 
is the typical install
technique (assuming /usr/local/portage as your overlay dir):

cd /usr/local/portage
mkdir games-emulation
cd games-emulation
cp -Rp /usr/portage/games-emulation/xmame .
# <put the ebuild here>
cd xmame/files
# <put the patch file here>

# rebuild the digest
ebuild /usr/local/portage/games-emulation/xmame/xmame-0.101-r115.ebuild 
digest

emerge xmame

You may need to add xmame to /etc/portage/package.keywords first.
Repeat for other ebuilds, changing paths as necessary.


> I've been successful with the wireless gamepads in both fceu and znes
> outside of MythGame.  However I cannot get MythGame to display any snes
> games using znes in the config.  Maybe I'll give snes9x a shot following
> your instructions.
>
> For those interested I am using this converter:
> http://store.yahoo.com/midwestgames/xboxxboxtopc1.html
>   

Oh, sweet. I was looking at those last night wondering if they were 
compatible. It's just a USB hub on
the inside then?


> I liked this solution since I never really plan to have any more than 2
> controllers in use at a time and both controllers only use 1 USB port.
>
> For controllers I'm using:
> http://www.logitech.com/index.cfm/products/details/US/EN,CRID=2311,CONTENTID=8182
>
> A little pricey but overall a very good controller.
>   

:) I bought this one for my son for Christmas last night:
    
http://www.dealtime.com/xPC-Microsoft_Xbox_Spiderman_Wireless_Controller_Lifetime_Warranty_Xbox

We'll see if it's any good....


-- 
Jesse Guardiani
Programmer/Sys Admin
jesse at wingnet.net

-------------- next part --------------
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/games-emulation/xmame/xmame-0.101.ebuild,v 1.1 2005/10/23 07:45:11 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 xv"

RDEPEND="sys-libs/zlib
	alsa? ( media-libs/alsa-lib )
	arts? ( kde-base/arts )
	dga? ( virtual/x11 )
	esd? ( >=media-sound/esound-0.2.29 )
	expat? ( dev-libs/expat )
	ggi? ( media-libs/libggi )
	lirc? ( app-misc/lirc )
	opengl? (
		virtual/x11
		virtual/opengl
		virtual/glu )
	sdl? ( >=media-libs/libsdl-1.2.0 )
	svga? ( media-libs/svgalib )
	X? ( virtual/x11 )
	xv? ( virtual/x11 )"
DEPEND="${RDEPEND}
	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}
	epatch "${FILESDIR}"/xmame.patch
	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" \
		Makefile \
		|| die "sed Makefile failed"

	if use ppc ; then
		sed -i \
			-e '/LD.*--relax/s:^# ::' Makefile \
			|| die "sed Makefile (ppc/LD) failed"
	fi


	toggle_feature x86 X86_MIPS3_DRC
	toggle_feature2 x86 mmx EFFECT_MMX_ASM
	toggle_feature joystick JOY_STANDARD
	toggle_feature2 joystick X XINPUT_DEVICES
	use net && ewarn "Network support is currently (${PV}) broken :("
	#toggle_feature net XMAME_NET # Broken
	toggle_feature esd SOUND_ESOUND
	toggle_feature alsa SOUND_ALSA
	toggle_feature arts SOUND_ARTS
	toggle_feature dga X11_DGA
	toggle_feature xv X11_XV
	toggle_feature expat BUILD_EXPAT
	toggle_feature opengl X11_OPENGL
	toggle_feature lirc LIRC

	case ${ARCH} in
		x86|ia64|amd64)
			append-flags -Wno-unused -fomit-frame-pointer -fstrict-aliasing -fstrength-reduce
			use amd64 || append-flags -ffast-math #54270
			[[ $(gcc-major-version) -ge 3 ]] \
				&& append-flags -falign-functions=2 -falign-jumps=2 -falign-loops=2 \
				|| append-flags -malign-functions=2 -malign-jumps=2 -malign-loops=2
			;;
		ppc)
			append-flags -Wno-unused -funroll-loops -fstrength-reduce -fomit-frame-pointer -ffast-math -fsigned-char
			;;
		hppa)
			append-flags -ffunction-sections
			;;
	esac

	sed -i \
		-e "s:[Xx]mame:${TARGET}:g" \
		doc/*.6 \
		|| die "sed man pages failed"
	# no, we don't want to install setuid (bug #81693)
	sed -i \
		-e 's/^doinstallsuid/notforus/' \
		-e 's/doinstallsuid/doinstall/' \
		-e '/^QUIET/s:^:#:' src/unix/unix.mak \
		|| die "sed src/unix/unix.mak failed"
}

src_compile() {
	local disp=0
	if use sdl ; then
		emake DISPLAY_METHOD=SDL || die "emake failed (SDL)"
		disp=1
	fi
	if use svga ; then
		emake DISPLAY_METHOD=svgalib || die "emake failed (svgalib)"
		disp=1
	fi
	if use ggi ; then
		#emake DISPLAY_METHOD=ggi || die "emake failed (ggi)"
		#disp=1
		ewarn "GGI support is currently (${PV}) broken :("
	fi
	if  [ ${disp} -eq 0 ] || use opengl || use X || use dga || use xv ; then
		emake DISPLAY_METHOD=x11 || die "emake failed (x11)"
	fi
}

src_install() {
	local disp=0

	sed -i \
		-e "s:^PREFIX.*:PREFIX=${D}/usr:" \
		-e "s:^BINDIR.*:BINDIR=${D}/${GAMES_BINDIR}:" \
		-e "s:^MANDIR.*:MANDIR=${D}/usr/share/man/man6:" \
		-e "s:^XMAMEROOT.*:XMAMEROOT=${D}/${GAMES_DATADIR}/${TARGET}:" \
		Makefile \
		|| die "sed Makefile failed"

	if use sdl ; then
		make DISPLAY_METHOD=SDL install || die "install failed (sdl)"
		disp=1
	fi
	if use svga ; then
		make DISPLAY_METHOD=svgalib install || die "install failed (svga)"
		disp=1
	fi
	if use ggi ; then
		#make DISPLAY_METHOD=ggi install || die "install failed (ggi)"
		#disp=1
		ewarn "GGI support is currently (${PV}) broken :("
	fi
	if [ ${disp} -eq 0 ] || use opengl || use X || use dga || use xv ; then
		make DISPLAY_METHOD=x11 install || die "install failed (x11)"
	fi
	exeinto "${GAMES_LIBDIR}/${PN}"
	doexe chdman || die "doexe failed"
	if [[ ${PN} == "xmame" ]] ; then
		doexe xml2info || die "doexe failed"
	fi

	dodir "${GAMES_DATADIR}/${PN}"
	cp -r ctrlr "${D}/${GAMES_DATADIR}/${PN}/" || die "cp 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"
}
-------------- next part --------------
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/games-emulation/snes9x/snes9x-1.43-r1.ebuild,v 1.2 2005/08/28 21:17:10 vapier Exp $

# 3dfx support (glide) is disabled because it requires
# glide-v2 while we only provide glide-v3 in portage
# http://bugs.gentoo.org/show_bug.cgi?id=93097

inherit eutils games flag-o-matic

DESCRIPTION="Super Nintendo Entertainment System (SNES) emulator"
HOMEPAGE="http://www.snes9x.com/"
SRC_URI="http://www.lysator.liu.se/snes9x/${PV}/snes9x-${PV}-src.tar.gz"

LICENSE="as-is"
SLOT="0"
KEYWORDS="amd64 ppc x86"
IUSE="opengl X joystick zlib dga debug"

RDEPEND="zlib? ( sys-libs/zlib )
	virtual/x11
	media-libs/libpng
	amd64? ( emul-linux-x86-xlibs )
	opengl? ( virtual/opengl virtual/glu )"
DEPEND="${RDEPEND}
	x86? ( dev-lang/nasm )"

S=${WORKDIR}/${P}-src

src_unpack() {
	unpack ${A}
	cd "${S}"/snes9x
	epatch "${FILESDIR}"/nojoy.patch
	epatch "${FILESDIR}"/${P}-porting.patch
	epatch "${FILESDIR}"/${P}-key-bindings-fix.patch #81980
	epatch "${FILESDIR}"/snes9x.patch
	sed -i 's:png_jmpbuf:png_write_info:g' configure

	rm offsets # stupid prebuilt file
	sed -i -e 's:-lXext -lX11::' Makefile.in
	sed -i -e '/X_LDFLAGS=/d' configure
	epatch "${FILESDIR}"/${P}-build.patch

	autoconf || die
}

src_compile() {
	if use amd64 && [[ -z ${NATIVE_AMD64_BUILD_PLZ} ]] ; then
		export ABI=x86
		append-flags -m32
		append-ldflags -m32
	fi

	local vidconf=
	local target=
	local vid=

	mkdir mybins
	for vid in opengl X fallback ; do
		if [[ ${vid} != "fallback" ]] ; then
			use ${vid} || continue
		fi
		cd "${S}"/snes9x
		case ${vid} in
#			3dfx)
#				vidconf="--with-glide --without-opengl --without-x"
#				target=gsnes9x;;
			opengl)
				vidconf="--with-opengl --without-glide --without-x"
				target=osnes9x;;
			fallback|X)
				vidconf="--with-x --without-glide --without-opengl"
				target=snes9x;;
		esac
		# this stuff is ugly but hey the build process sucks ;)
		egamesconf \
			${vidconf} \
			$(use_with x86 assembler) \
			$(use_with joystick) \
			$(use_with debug debugger) \
			$(use_with zlib) \
			--with-screenshot \
			$(use_with dga extensions) \
			|| die
		# Makefile doesnt quite support parallel builds
		emake -j1 offsets || die "making offsets"
		emake ${target} || die "making ${target}"
		mv ${target} "${S}"/mybins/
		cd "${WORKDIR}"
		rm -r "${S}"/snes9x
		src_unpack
	done
}

src_install() {
	dogamesbin mybins/* || die "dogamesbin failed"
	dodoc faqs.txt readme.txt readme.unix snes9x/*.txt
	prepgamesdirs
}
-------------- next part --------------
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/media-plugins/mythgame/mythgame-0.18.1.ebuild,v 1.4 2005/07/27 11:33:13 pvdabeel Exp $

inherit eutils mythtv-plugins

DESCRIPTION="Game emulator module for MythTV."
HOMEPAGE="http://www.mythtv.org/"
SRC_URI="http://www.mythtv.org/mc/mythplugins-${PV}.tar.bz2"
IUSE=""
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ppc ~x86"

DEPEND=" sys-libs/zlib
	~media-tv/mythtv-${PV}"

src_unpack () {
	unpack ${A}
	epatch "${FILESDIR}"/mythplugins.patch
}

src_install () {
	mythtv-plugins_src_install || die "install failed"

	dodoc gamelist.xml
}


More information about the mythtv-users mailing list