summaryrefslogtreecommitdiff
blob: d3cb75739809014eed792be26b14481a086f2357 (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
# Copyright 1999-2004 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/games-emulation/visualboyadvance/visualboyadvance-1.7.ebuild,v 1.2 2004/01/03 23:57:55 vapier Exp $

inherit games

DESCRIPTION="gameboy, gameboy color, and gameboy advance emulator"
HOMEPAGE="http://vboy.emuhq.com/"
SRC_URI="mirror://sourceforge/vba/VisualBoyAdvance-src-${PV}.tar.gz
	mirror://gentoo/${P}-zutil.h-1.2.bz2"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="x86"
IUSE="mmx debug"

DEPEND="virtual/x11
	mmx? ( dev-lang/nasm )
	media-libs/libpng
	sys-libs/zlib
	media-libs/libsdl
	>=sys-apps/sed-4"

S=${WORKDIR}/VisualBoyAdvance-${PV}

src_unpack() {
	unpack ${A}
	cd ${S}
	sed -i \
		-e "s:@LIBTOOL@:/usr/bin/libtool:" \
		`find -name Makefile.in` \
		|| die "sed Makefile.in failed"
	cd win32/include/png
	for f in * ; do
		[ -e /usr/include/${f} ] \
			&& rm ${f} && ln -s /usr/include/${f}
	done
	cd ../zlib
	for f in * ; do
		[ -e /usr/include/${f} ] \
			&& rm ${f} && ln -s /usr/include/${f}
	done
	has_version '>=sys-libs/zlib-1.2' \
		&& unpack ${P}-zutil.h-1.2.bz2 \
		&& mv ${P}-zutil.h-1.2 zutil.h
}

src_compile() {
	egamesconf \
		--enable-c-core \
		`use_with debug profiling` \
		`use_with mmx` \
		|| die
	if [ ! `use debug` ] ; then
		sed -i \
			-e 's:prof/libprof.a::' \
			src/Makefile \
			|| die "sed src/Makefile failed"
	fi
	emake || die "emake failed"
}

src_install() {
	make DESTDIR=${D} install || die "make install failed"
	dogamesbin ${FILESDIR}/visualboyadvance
	insinto ${GAMES_DATADIR}/VisualBoyAdvance
	doins src/VisualBoyAdvance.cfg
	dodoc AUTHORS ChangeLog INSTALL NEWS README README-win.txt
	prepgamesdirs
}