summaryrefslogtreecommitdiff
blob: e9b6c2b328e61f57bcbbbc62bcb62c6ffb9b497c (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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI=5

inherit cmake-utils wxwidgets games

MY_P="${P}-r5350-sources"

DESCRIPTION="A PlayStation 2 emulator"
HOMEPAGE="http://www.pcsx2.net"
SRC_URI="http://dev.gentoo.org/~vincent/${MY_P}.7z"

LICENSE="GPL-3"
SLOT="0"
KEYWORDS="-* ~x86 ~amd64"

S="${WORKDIR}/${MY_P}"

DEPEND="app-arch/p7zip
	dev-cpp/sparsehash
	media-libs/alsa-lib
	media-libs/glew
	media-libs/libsdl
	media-libs/libsoundtouch
	media-libs/portaudio
	sys-libs/zlib
	virtual/jpeg
	virtual/opengl
	x11-libs/gtk+:2
	x11-libs/libICE
	x11-libs/libX11
	x11-libs/libXext
	x11-libs/wxGTK:2.8[X]
	x86? ( media-gfx/nvidia-cg-toolkit )
	amd64? (
		app-emulation/emul-linux-x86-baselibs
		app-emulation/emul-linux-x86-opengl
		app-emulation/emul-linux-x86-xlibs
		app-emulation/emul-linux-x86-gtklibs
		app-emulation/emul-linux-x86-sdl
		app-emulation/emul-linux-x86-soundlibs
		app-emulation/emul-linux-x86-libsoundtouch
		app-emulation/emul-linux-x86-wxGTK:2.8
		>=media-gfx/nvidia-cg-toolkit-3.1[multilib]
	)"
RDEPEND="${DEPEND}"

src_prepare() {
	sed -i -e "s:GSdx TRUE:GSdx FALSE:g" -i cmake/SelectPcsx2Plugins.cmake || die "sed failed"
	sed -e "s:0.9.8:${PV}:g" -i CMakeLists.txt || die "sed failed"
}

src_configure() {
	use amd64 && local ABI="x86"

	local wxgtk_config=""
	local cg_config=""
	local mylibpath=""

	if use amd64 ; then
		mylibpath="/usr/$(get_libdir)"
		wxgtk_config="-DwxWidgets_CONFIG_EXECUTABLE=/usr/bin/wx-config-2.8-32"
		cg_config="-DCG_LIBRARY=/opt/nvidia-cg-toolkit/lib32/libCg.so
			-DCG_GL_LIBRARY=/opt/nvidia-cg-toolkit/lib32/libCgGL.so"
	else
		mylibpath="/usr/$(get_libdir)"
	fi

	mycmakeargs="-DPACKAGE_MODE=1
		-DCMAKE_VERBOSE_MAKEFILE=TRUE
		-DCMAKE_INSTALL_PREFIX=/usr
		-DCMAKE_LIBRARY_PATH=${mylibpath}
		${wxgtk_config}
		${cg_config}"

	cmake-utils_src_configure
}

src_compile() {
	cmake-utils_src_compile
}

src_install() {
	cmake-utils_src_install

	local i
	for i in pcsx2 pcsx2_ZZReplayLoader pcsx2_ZZCGReplayLoader ; do
		dogamesbin "${D}usr/bin/${i}"
		rm "${D}usr/bin/${i}"
	done

	prepgamesdirs
}