summaryrefslogtreecommitdiff
blob: 727cec18cde71339e691dfd5c4f2ee57ad004daa (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
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/games-emulation/pcsx/pcsx-1.5-r1.ebuild,v 1.12 2011/02/22 20:57:27 mr_bones_ Exp $

EAPI=2
inherit eutils games

DESCRIPTION="PlayStation emulator"
HOMEPAGE="http://www.pcsx.net/"
SRC_URI="http://www.pcsx.net/downloads/PcsxSrc-${PV}.tgz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="-ppc x86"
IUSE="opengl"

DEPEND="x11-libs/gtk+:2
	gnome-base/libglade"
RDEPEND="${DEPEND}
	games-emulation/psemu-cdr
	games-emulation/psemu-cdriso
	games-emulation/psemu-padxwin
	games-emulation/psemu-padjoy
	games-emulation/psemu-peopsspu
	opengl? ( games-emulation/psemu-gpupetemesagl )
	!opengl? ( games-emulation/psemu-peopssoftgpu )"

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

src_prepare() {
	edos2unix $(find -regex '.*\.[ch]')

	epatch \
		"${FILESDIR}"/${PV}-gentoo.patch \
		"${FILESDIR}"/${P}-gcc41.patch
	sed -i \
		-e "s:Plugin/:$(games_get_libdir)/psemu/plugins/:" \
		-e "s:Bios/:$(games_get_libdir)/psemu/bios/:" \
		-e 's:Pcsx.cfg:~/.pcsx/config:' \
		Linux/LnxMain.c \
		|| die "sed LnxMain.c failed"
	sed \
		-e "s:GAMES_DATADIR:${GAMES_DATADIR}:" \
		-e "s:GAMES_LIBDIR:$(games_get_libdir):" \
		-e "s:GAMES_BINDIR:${GAMES_BINDIR}:" \
		"${FILESDIR}"/pcsx > "${T}"/pcsx \
		|| die "sed failed"
}

src_configure() {
	cd Linux
	egamesconf
}

src_compile() {
	emake -C Linux OPTIMIZE="${CFLAGS}" STRIP=true || die "emake failed"
}

src_install() {
	newgamesbin Linux/pcsx pcsx.bin || die "newgamesbin failed"
	dogamesbin "${T}"/pcsx || die "dogamesbin failed"
	insinto "${GAMES_DATADIR}"/${PN}
	doins Linux/.pixmaps/* || die "doins failed"
	dodoc Docs/*
	prepgamesdirs
}