summaryrefslogtreecommitdiff
blob: 91ec682334a92367b7e6d5698e7f2e8fe7db4804 (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
# Copyright 1999-2004 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.4 2004/06/24 22:32:11 agriffis Exp $

inherit games eutils

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

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

DEPEND="sys-libs/zlib
	>=sys-apps/sed-4
	app-arch/unzip
	x11-libs/gtk+
	gnome-base/libglade"
RDEPEND="games-emulation/psemu-cdr
	games-emulation/psemu-cdriso
	games-emulation/psemu-padxwin
	games-emulation/psemu-padjoy
	games-emulation/psemu-peopsspu
	|| (
		opengl? ( x86? games-emulation/psemu-gpupetemesagl )
		games-emulation/psemu-peopssoftgpu
	)"

src_unpack() {
	unpack PcsxSrc-${PV}.tgz
	cd ${S}

	edos2unix `find -regex '.*\.[ch]'`

	epatch ${FILESDIR}/${PV}-gentoo.patch
	sed -i \
		-e "s:Plugin/:${GAMES_LIBDIR}/psemu/plugins/:" \
		-e "s:Bios/:${GAMES_LIBDIR}/psemu/bios/:" \
		-e 's:Pcsx.cfg:~/.pcsx/config:' \
		Linux/LnxMain.c \
		|| die "sed LnxMain.c failed"
	if [ "${ARCH}" = "ppc" ]; then
		sed -i \
			-e "s:^CPU\ =.*:CPU = powerpc:" Linux/Makefile \
			|| die "sed Linux/Makefile failed"
		sed -i \
			-e "s:__LINUX__:__i386__:g" Gte.c \
			|| die "sed Gte.c failed"
	fi
}

src_compile() {
	cd Linux
	econf || die "econf failed"
	emake OPTIMIZE="${CFLAGS}" || die "emake failed"
}

src_install() {
	newgamesbin Linux/pcsx pcsx.bin
	dogamesbin ${FILESDIR}/pcsx
	insinto ${GAMES_DATADIR}/${PN}
	doins Linux/.pixmaps/*
	dodoc Docs/*
	prepgamesdirs
}