1 # Copyright 1999-2008 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
5 inherit games autotools eutils flag-o-matic
7 DESCRIPTION="PlayStation2 emulator"
8 HOMEPAGE="http://www.pcsx2.net/"
9 SRC_URI="mirror://sourceforge/pcsx2/${P}.tar.gz"
13 KEYWORDS="~amd64 ~x86"
14 IUSE="alsa debug devbuild nls oss vmbuild"
16 CDEPEND="sys-libs/zlib
23 games-emulation/ps2emu-zerogs
24 games-emulation/ps2emu-zeropad
25 games-emulation/ps2emu-cdvdnull
26 games-emulation/ps2emu-dev9null
27 games-emulation/ps2emu-spu2null
28 games-emulation/ps2emu-fwnull
29 >=games-emulation/ps2emu-usbnull-0.4-r1
30 alsa? ( games-emulation/ps2emu-peopsspu2 )
31 oss? ( games-emulation/ps2emu-peopsspu2 )"
33 LANGS="ar bg cz de du el es fr hb it ja pe pl po po_BR ro ru sh sw tc tr"
36 IUSE="${IUSE} linguas_${i}"
39 S="${WORKDIR}/${P}/${PN}"
46 if [ -n "$(usev linguas_${x})" ]; then
47 eerror "Any language other than English is not supported with USE=\"-nls\""
48 die "Language ${x} not supported with USE=\"-nls\""
54 ewarn "Warning: Compilation is known to fail with the vmbuild use flag"
55 ewarn "enabled. The recommended use flags are USE=\"sse2 -vmbuild\"."
56 ewarn "Do not file a bug unless you are using the above USE flags."
57 ewarn "If you can get it to compile however, please file a bug or "
58 ewarn "contact me at eatnumber1@gmail.com. (i'll give you a cookie)"
67 # Preserve custom CFLAGS passed to configure.
68 epatch "${FILESDIR}"/${PN}-custom-cflags.patch
70 # Add nls support to the configure script.
71 epatch "${FILESDIR}"/${PN}-add-nls.patch
73 # Allow plugin inis to be stored in ~/.pcsx2/inis.
74 epatch "${FILESDIR}"/${PN}-plugin-inis.patch
76 epatch "${FILESDIR}"/${PN}-gcc43.patch
78 eautoreconf -v --install || die
85 if ! use x86 && ! use amd64; then
86 einfo "Recompiler not supported on this architecture. Disabling."
87 myconf=" --disable-recbuild"
91 $(use_enable devbuild) \
94 $(use_enable vmbuild) \
104 keepdir "`games_get_libdir`/ps2emu/plugins"
105 dodoc Docs/*.txt || die "dodoc failed"
106 newgamesbin Linux/${PN} ${PN}.bin || die
109 -e "s:%GAMES_BINDIR%:${GAMES_BINDIR}:" \
110 -e "s:%GAMES_DATADIR%:${GAMES_DATADIR}:" \
111 -e "s:%GAMES_LIBDIR%:`games_get_libdir`:" \
112 "${FILESDIR}/${PN}" > "${D}${GAMES_BINDIR}/${PN}" || die
115 dohtml -r compat_list/* || die
116 insinto "${GAMES_DATADIR}/${PN}"
117 doins -r *.xml .pixmaps patches || die
118 insinto "${GAMES_DATADIR}/${PN}/Langs"
120 for x in ${LANGS}; do
121 if use linguas_${x}; then
122 [[ "${x/_/}" == "${x}" ]] && x=${x}_`echo ${x} | tr 'a-z' 'A-Z'`
123 doins -r Langs/${x} || die "doins for language ${x} failed"
131 if ! use devbuild; then
132 ewarn "If this package exhibits random crashes, recompile ${PN}"
133 ewarn "with the devbuild use flag enabled. If that fixes it, file a bug."
137 elog "Please note that this ebuild does not install all the available plugins."
138 elog "You will need to install other ps2emu plugins in order for the emulator"