summaryrefslogtreecommitdiff
blob: cfd4fe2339412c33698b415bc65862bcf3c09c2c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# Copyright 1999-2004 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/games-emulation/snes9x/snes9x-1.41.1.ebuild,v 1.4 2004/02/03 21:47:15 mr_bones_ Exp $

inherit eutils games

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

LICENSE="as-is"
SLOT="0"
KEYWORDS="x86 ~ppc"
IUSE="3dfx opengl X joystick" # svga ggi

RDEPEND="sys-libs/zlib
	virtual/x11
	opengl? ( virtual/opengl )
	3dfx? ( media-libs/glide-v3 )"
#	X? ( virtual/x11 )
#	svga? ( media-libs/svgalib )
#	ggi? ( media-libs/libggi )
DEPEND="${RDEPEND}
	x86? ( dev-lang/nasm )"

S=${WORKDIR}/${PN}-${MY_PV}-src

src_unpack() {
	unpack ${A}
	cd ${S}/snes9x
	epatch ${FILESDIR}/${PV}-system-zlib.patch
}

src_compile() {
	mkdir mybins
	cd snes9x
	local vidconf=
	local target=
	for vid in 3dfx opengl X ; do
		[ `use ${vid}` ] || continue
		case ${vid} in
			3dfx)
				vidconf="--with-glide --without-opengl --without-x"
				target=gsnes9x;;
			opengl)
				vidconf="--with-opengl --without-glide --without-x"
				target=osnes9x;;
			X)
				vidconf="--with-x --without-glide --without-opengl"
				target=snes9x;;
		esac
		# this stuff is ugly but hey the build process sucks ;)
		egamesconf \
			`use_with joystick` \
			${vidconf} \
			`use_with x86 assembler` \
			|| die
		emake ${target} || die "making ${target}"
		mv ${target} ${S}/mybins/
		cd ${WORKDIR}
		src_unpack
	done
}

src_install() {
	dodoc README.TXT README.UNIX
	dogamesbin mybins/*
	dodoc snes9x/{CHANGES,PROBLEMS,HARDWARE}.TXT
	prepgamesdirs
}