# Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header:$ inherit eutils toolchain-funcs games DESCRIPTION="Playstation2 emulator" HOMEPAGE="http://www.pcsx2.net/" SRC_URI="file://${DISTDIR}/pcsx${PV}_and_plugins_src.7z" LICENSE="GPL-2" SLOT="0" KEYWORDS="~amd64 ~x86" IUSE="debug alsa oss vmbuild sse2 devbuild" DEPEND="sys-libs/zlib media-gfx/nvidia-cg-toolkit x11-libs/cairo x11-libs/pango media-libs/glitz media-libs/libpng dev-libs/atk x11-proto/xf86vidmodeproto >=media-libs/freetype-2 x11-libs/libXxf86vm >=x11-libs/gtk+-2" RDEPEND="debug? ( sys-devel/gdb ) ${DEPEND}" RESTRICT="fetch" S=${WORKDIR} pkg_nofetch() { einfo "At the moment, there is no clean way to" einfo "automatically download the ${P} sources." einfo "You can download them manually at http://www.pcsx2.net/files/8022 or" einfo "http://www.pcsx2.net/thel33tback3nd/attachment.php?aid=8022" einfo "and place them in ${DISTDIR}" } src_compile() { cd "${S}" find . -name .svn | xargs -r rm -rf sed -i \ -e 's/make install/make/' \ pcsx2/build.sh \ || die "sed failed" if use vmbuild; then sed -i \ -e 's/export PCSX2OPTIONS="/export PCSX2OPTIONS="--enable-vmbuild /' \ build.sh \ || die "sed failed" elog "Warning! Emerge is known to fail with vmbuild use flag enabled!" fi if ! use sse2; then sed -i \ -e 's/--enable-sse2 //' \ build.sh \ || die "sed failed" sed -i \ -e 's/--enable-sse2 //' \ plugins/gs/zerogs/build.sh \ || die "sed failed" fi if use devbuild; then sed -i \ -e 's/configure /configure --enable-devbuild /' \ plugins/gs/zerogs/build.sh \ || die "sed failed" else sed -i \ -e 's/--enable-devbuild //' \ build.sh \ || die "sed failed" elog "Warning! Emerge is known to fail with devbuild use flag disabled!" fi if use debug; then sed -i \ -e 's/export PCSX2OPTIONS="/export PCSX2OPTIONS="--enable-debug /' \ build.sh \ || die "sed failed" sed -i \ -e 's/-g "/-ggdb "/' \ pcsx2/configure.ac \ -e 's/-g "/-ggdb "/' \ plugins/gs/zerogs/opengl/configure.ac \ -e 's/-g "/-ggdb "/' \ plugins/pad/zeropad/configure.ac \ || die "sed failed" sed -i \ -e 's/configure /configure --enable-debug /' \ plugins/gs/zerogs/build.sh \ || die "sed failed" sed -i \ -e 's/configure /configure --enable-debug /' \ plugins/pad/zeropad/build.sh \ || die "sed failed" fi if ! use alsa; then if use oss; then sed -i \ -e 's/USEALSA = TRUE/USEALSA = FALSE/' \ plugins/spu2/PeopsSPU2/Makefile \ || die "sed failed" fi fi chmod +x plugins/gs/zerogs/opengl/configure sh build.sh all || die "compile failed" } src_install() { newgamesbin pcsx2/Linux/pcsx2 pcsx2.bin || die "newgamesbin failed" dogamesbin "${FILESDIR}/pcsx2" || die "dogamesbin failed" insinto "${GAMES_DATADIR}/${PN}" doins -r bin/* || die "installing data failed" insinto "${GAMES_DATADIR}/${PN}/.pixmaps" doins -r bin/.pixmaps/* pcsx2/Linux/.pixmaps/* || die "installing pixmap data failed" sed -i \ -e "s:GAMES_BINDIR:${GAMES_BINDIR}:" \ -e "s:GAMES_DATADIR:${GAMES_DATADIR}:" \ "${D}/${GAMES_BINDIR}/pcsx2" \ || die "sed failed" dodoc pcsx2/Docs/*.txt prepgamesdirs }