# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils games MY_PV=${PV//./} MY_PN=${PN/n/N} DESCRIPTION="Deathmatch FPS based on the Quake 1 engine" HOMEPAGE="http://www.nexuiz.com" SRC_URI="mirror://sourceforge/${PN}/${PN}-${MY_PV}.zip" LICENSE="GPL-2" SLOT="0" KEYWORDS="~amd64 ~ppc ~x86" IUSE="dedicated sdl" RDEPEND="media-libs/alsa-lib media-libs/jpeg media-libs/libogg media-libs/libsdl media-libs/libvorbis sdl? ( media-libs/libsdl ) sys-libs/glibc sys-libs/zlib virtual/opengl || ( ( x11-libs/libX11 x11-libs/libXau x11-libs/libXdmcp x11-libs/libXext ) virtual/x11 )" DEPEND="${RDEPEND} dev-util/pkgconfig app-arch/unzip" S=${WORKDIR}/${MY_PN}/darkplaces dir=${GAMES_DATADIR}/${PN} exe=${PN} src_unpack() { unpack ${A} cd ${MY_PN} unzip $(ls -A ${PN}enginesource*.zip) cd "${S}" sed -i \ -e '/^CC/d' \ -e "s:-lasound:$(pkg-config --libs alsa):" \ makefile.inc \ || die "sed makefile failed" } src_compile() { emake cl-release \ CFLAGS_RELEASE="" OPTIM_RELEASE="" \ CFLAGS_COMMON="${CFLAGS}" \ || die "emake cl-release failed" if use sdl ; then emake sdl-release \ CFLAGS_RELEASE="" OPTIM_RELEASE="" \ CFLAGS_COMMON="${CFLAGS}" \ || die "emake sdl-release failed" fi if use dedicated ; then emake sv-release \ CFLAGS_RELEASE="" OPTIM_RELEASE="" \ CFLAGS_COMMON="${CFLAGS}" \ || die "emake dedicated failed" fi } src_install() { insinto "${dir}" exeinto "${dir}" newexe darkplaces-glx ${exe} || die "doexe failed" newicon darkplaces72x72.png ${PN}.png if use sdl ; then newexe darkplaces-sdl ${PN}-sdl || die "doexe sdl failed" games_make_wrapper ${PN}-sdl ./${PN}-sdl "${dir}" make_desktop_entry ${PN}-sdl "Nexuiz (SDL)" ${PN}.png fi if use dedicated ; then newexe darkplaces-dedicated ${PN}-ded || die "doexe ded failed" games_make_wrapper ${PN}-ded ./${PN}-ded "${dir}" fi cd "${WORKDIR}/${MY_PN}" insinto "${dir}/data" doins -r data/* || die "doins data failed" dodoc Docs/*.txt dohtml Docs/*.{htm,html} games_make_wrapper ${PN} ./${exe} "${dir}" make_desktop_entry ${PN} Nexuiz ${PN}.png prepgamesdirs } pkg_postinst() { einfo "For sound problems, read:" einfo " http://www.alientrap.org/forum/viewtopic.php?t=72" games_pkg_postinst }