summaryrefslogtreecommitdiff
blob: 514f0d562426cf18d4060c54e87fb2f4d3c4814f (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
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

WANT_AUTOCONF="latest"
WANT_AUTOMAKE="latest"

inherit eutils autotools games toolchain-funcs

DESCRIPTION="SNES (Super Nintendo) emulator that uses x86 assembly"
HOMEPAGE="http://www.zsnes.com/ http://ipherswipsite.com/zsnes/"
SRC_URI="http://files.ipherswipsite.com/zsnes/ZSNESS_${PV:4}.tar.bz2"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="-* ~amd64 ~x86"
IUSE="opengl png mplayer debug debugger"

RDEPEND=">=media-libs/libsdl-1.2.0
	>=sys-libs/zlib-1.2.3-r1
	amd64? ( app-emulation/emul-linux-x86-sdl )
	opengl? ( virtual/opengl )
	png? ( media-libs/libpng )
	mplayer? ( media-video/mplayer )"
DEPEND="${RDEPEND}
	>=dev-lang/nasm-0.98"

S="${WORKDIR}"

src_unpack() {
	unpack ${A}
	cd "${S}"
	cp "icons/48x48x32.png" "${T}/${PN}.png"

	epatch "${FILESDIR}"/${P}-parsegendistcc.patch

	# Remove hardcoded CFLAGS and LDFLAGS
	sed -i \
		-e '/^\s*CFLAGS=.* -fomit-frame-pointer /d'		\
		-e 's:^\s*CFLAGS=.* -I\/usr\/local\/include .*$:CFLAGS="${CFLAGS} -I.":'	\
		-e '/^\s*LDFLAGS=.* -L\/usr\/local\/lib /d'		\
		configure.in || die

	eaclocal
	eautoconf
}

src_compile() {
	use amd64 && multilib_toolchain_setup x86
	egamesconf \
		$(use_enable png libpng) \
		$(use_enable opengl) \
		$(use_enable debugger) \
		$(use_enable debug) \
		|| die
	CC="$(tc-getCC)" emake || die "emake failed"
}

src_install() {
	newgamesbin zsnes ${PN} || die "newgamesbin failed"
	newman linux/zsnes.1 ${PN}.6
	sed -i -e 's/zsnes/zsnes-wip/' -e 's/ZSNES/ZSNES WIP/' linux/zsnes.desktop
	insinto /usr/share/applications
	newins linux/zsnes.desktop zsnes-wip.desktop
	doicon "${T}/${PN}.png"
	prepgamesdirs
}