# Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit games eutils DESCRIPTION="a free deathmatch FPS based on the Quake I engine" HOMEPAGE="http://www.nexuiz.com" SRC_URI="mirror://sourceforge/${PN}/${PN}${PV//./}.zip" LICENSE="GPL-2" SLOT="0" KEYWORDS="~amd64 ~x86" IUSE="dedicated sdl" RDEPEND="virtual/opengl sdl? ( media-libs/libsdl ) media-libs/libogg media-libs/libvorbis media-libs/jpeg media-libs/alsa-lib sys-libs/zlib" DEPEND="${RDEPEND} app-arch/unzip" S="${WORKDIR}/${PN/n/N}" src_unpack() { unpack ${A} cd ${S} unzip $(ls nexuizenginesource* | head -n 1) sed s:GAMES_DATADIR:"${GAMES_DATADIR}"/${PN}: "${FILESDIR}"/${P}-fs.patch > \ ${T}/${P}-fs.patch \ || die "sed in patch failed" cd darkplaces epatch ${T}/${P}-fs.patch || die "patch failed" sed -i \ -e "s:darkplaces-sdl:nexuiz-sdl:" \ -e "s:darkplaces-glx:nexuiz-glx:" \ -e "s:darkplaces-dedicated:nexuiz-dedicated:" \ makefile.inc \ || die "sed in makefile failed" } src_compile() { cd darkplaces 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() { dogamesbin darkplaces/nexuiz-glx \ || die "failed to install glx binary" if use sdl; then dogamesbin darkplaces/nexuiz-sdl \ || die "failed to install sdl binary" fi if use dedicated; then dogamesbin darkplaces/nexuiz-dedicated \ || die "failed to install dedicated server" fi insinto "${GAMES_DATADIR}"/${PN}/data doins data/* || die "data copy failed" install -o root -g games -m 0640 \ darkplaces/darkplaces.ico \ ${D}/"${GAMES_DATADIR}"/${PN}/nexuiz.ico \ || die "icon copy failed" install -o root -g games -m 0640 \ darkplaces/*.png ${D}/"${GAMES_DATADIR}"/${PN}/ \ || die "pictures copy failes" if use sdl; then make_desktop_entry nexuiz-sdl "Nexuiz" \ || die "failed to create desktop entry" else make_desktop_entry nexuiz-glx "Nexuiz" \ || die "failed to create desktop entry" fi prepgamesdirs }