summaryrefslogtreecommitdiff
blob: de478e5c9816a9cf308b102d6f738366b6efe69e (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
72
73
74
75
76
77
# Copyright 1999-2004 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/games-emulation/raine/raine-0.36.2.ebuild,v 1.2 2004/02/20 06:26:48 mr_bones_ Exp $

inherit flag-o-matic

DESCRIPTION="R A I N E  M680x0 Arcade Emulation"
HOMEPAGE="http://www.rainemu.com/"
SRC_URI="http://www.rainemu.com/html/archive/raines-${PV}.tar.bz2
	http://www.rainemu.com/html/archive/rainedocs.zip
	http://www.rainemu.com/html/archive/icons.zip"
#	http://www.rainemu.com/html/archive/big-snapshot.zip"

LICENSE="Artistic"
SLOT="0"
KEYWORDS="x86"
IUSE="static nls"

DEPEND="virtual/glibc
	sys-libs/zlib
	<media-libs/allegro-4.1.0
	media-libs/svgalib"

S=${WORKDIR}/${PN}
RESTRICT=nostrip

src_unpack() {
	unpack ${A}
	cd ${S}

	MARCH_FLAG="`get-flag march`"
	MCPU_FLAG="`get-flag mcpu`"
	[ -z "${MARCH_FLAG}" ] && MARCH_FLAG="${MCPU_FLAG}"
	[ -z "${MCPU_FLAG}" ] && MCPU_FLAG="${MARCH_FLAG}"

	# Force our custom processor instead of pentium
	cp makefile makefile.orig
	sed -e "s:mcpu=pentium:mcpu=${MCPU_FLAG}:" \
		-e "s:march=pentium:march=${MARCH_FLAG}:" \
		-e 's:(prefix)/usr/games:(prefix)/usr/bin:' \
		-e 's:(sharedir)/games/raine:(sharedir)/raine:' \
		makefile.orig > makefile

	# Fix function-name collision with 4.1.x version of allegro
#	patch -p1 < ${FILESDIR}/raine-allegro_4.1.5_fix.patch || die
	cp source/gui/gui.c source/gui/gui.c.orig
	sed -e 's:update_menu(:upd_menu(:' \
		source/gui/gui.c.orig > source/gui/gui.c
}

src_compile() {
	local myopts="OSTYPE=linux RAINE_LINUX=1 VERBOSE=1"

	use static \
		&& myopts="${myopts} STATIC=1" \
		|| myopts="${myopts} STATIC="

	emake ${myopts} || die
}

src_install() {
	make prefix=${D} install || die

	exedat ${D}/usr/bin/raine ${D}/usr/share/raine/raine.dat
	rm -f ${D}/usr/share/raine/raine.dat

	use nls || rm -rf ${D}/usr/share/raine/languages

	dodoc ${WORKDIR}/raine.txt

	insinto /usr/share/icons
	doins ${WORKDIR}/*.png
	if [ `use kde` ] ; then
		insinto /usr/share/applnk/Games
		doins ${FILESDIR}/Raine.desktop
	fi
}