# 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 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) # 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" cd ${S}/darkplaces epatch ${T}/${P}-fs.patch || die "patch failed" } src_compile() { cd ${S}/darkplaces emake cl-release \ CFLAGS_RELEASE="" OPTIM_RELEASE="" \ CFLAGS_COMMON="${CFLAGS}" \ || die "failed building cl-release" if use sdl; then emake sdl-release \ CFLAGS_RELEASE="" OPTIM_RELEASE="" \ CFLAGS_COMMON="${CFLAGS}" \ || die "failed building sdl-release" fi if use dedicated; then emake sv-release \ CFLAGS_RELEASE="" OPTIM_RELEASE="" \ CFLAGS_COMMON="${CFLAGS}" \ || die "failed building sv-release" fi } src_install() { dogamesbin darkplaces/nexuiz-glx \ || die "failed installing binary" if use sdl; then dogamesbin darkplaces/nexuiz-sdl \ || die "failed installing sdl binary" fi if use dedicated; then dogamesbin darkplaces/nexuiz-dedicated \ || die "failed installing dedicated server" fi 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" \ || die "failed creating desktop entry" else make_desktop_entry nexuiz-glx "Nexuiz" \ || die "failed creating desktop entry" fi prepgamesdirs }