# Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit games 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="~x86 ~amd64" IUSE="sdl dedicated" RDEPEND="sdl? ( media-libs/libsdl )" DEPEND="virtual/opengl app-arch/unzip media-libs/jpeg media-libs/libogg media-libs/libsdl media-libs/libvorbis sys-libs/zlib ${RDEPEND}" S="${WORKDIR}/${PN/n/N}" src_unpack() { unpack "${A}" cd "${S}" unzip $(ls nexuizenginesource* | head -n 1) } src_compile() { cd "${S}/darkplaces" # can't use dosed, because it only works for things in ${D}, not ${S} sed "s:GAMES_DATADIR:${GAMES_DATADIR}/${PN}:" "${FILESDIR}/${P}-fs.patch" > \ ${T}/${P}-fs.patch || die "sed failed" epatch ${T}/${P}-fs.patch || die "patch failed" make cl-release \ CFLAGS_RELEASE="" OPTIM_RELEASE="" \ CFLAGS_COMMON="${CFLAGS} -fno-strict-aliasing -MD -ffast-math -funroll-loops" \ || die "failed building cl-release" if use sdl; then make sdl-release \ CFLAGS_RELEASE="" OPTIM_RELEASE="" \ CFLAGS_COMMON="${CFLAGS} -fno-strict-aliasing -MD -ffast-math -funroll-loops" \ || die "failed building sdl-release" fi if use dedicated; then make sv-release \ CFLAGS_RELEASE="" OPTIM_RELEASE="" \ CFLAGS_COMMON="${CFLAGS} -fno-strict-aliasing -MD -ffast-math -funroll-loops" \ || die "failed building sv-release" fi } src_install() { dogamesbin darkplaces/nexuiz-glx || die "failed installing binary" use sdl && ( dogamesbin darkplaces/nexuiz-sdl || die "failed installing sdl binary" ) use dedicated && ( dogamesbin darkplaces/nexuiz-dedicated || die "failed installing dedicated server" ) insinto ${GAMES_DATADIR}/${PN}/data doins data/* || die "failed installing data" doins darkplaces/nexuiz.ico || die "failed installing icon" if use sdl; then make_desktop_entry nexuiz-sdl "Nexuiz" \ ${GAMES_DATADIR}/${PN}/data/nexuiz.ico Game \ || die "failed creating desktop entry" else make_desktop_entry nexuiz-glx "Nexuiz" \ ${GAMES_DATADIR}/${PN}/data/nexuiz.ico Game \ || die "failed creating desktop entry" fi prepgamesdirs }