# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils flag-o-matic multilib toolchain-funcs games DESCRIPTION="Enhanced Quake 2 engine with Gloom effects" HOMEPAGE="http://egl.quakedev.com/ http://qudos.quakedev.com/linux/quake2/engines/egl/" # Takes the assets tarball from subversion, until version 0.3.2 is released SRC_URI="http://qudos.quakedev.com/linux/quake2/engines/egl/EGL-SDL-source-${PV}.tar.bz2 http://svn.quakedev.com/viewcvs.cgi/egl/trunk/assets.tar.gz" LICENSE="GPL-2" SLOT="0" # Should work on amd64 also KEYWORDS="~x86" # OpenAL sound is broken, so ignore openal IUSE="dedicated demo dga opengl optimize-cflags sdl textures" UIDEPEND="dga? ( x11-libs/libXxf86dga ) opengl? ( virtual/opengl ) !opengl? ( !sdl? ( !dedicated? ( virtual/opengl ) ) ) sdl? ( media-libs/libsdl x11-libs/libXxf86vm )" # EGL works with the demo data. # Chooses either the demo or CD data, because the engine needs data. RDEPEND="${UIDEPEND} demo? ( games-fps/quake2-demodata ) !demo? ( games-fps/quake2-data ) textures? ( games-fps/quake2-textures )" DEPEND="${UIDEPEND}" S=${WORKDIR}/EGL-SDL-source-${PV} dir=${GAMES_DATADIR}/quake2 libdir=${GAMES_LIBDIR}/${PN} src_unpack() { unpack ${A} cd "${S}" local march=$(get-flag -march) sed -i \ -e "s:-march=\$(MACHINE):${march}:" \ makefile || die "sed makefile failed" } src_compile() { yesno() { useq $1 && echo YES || echo NO ; } local target="release" # debug does not work #use debug && target="debug" local build_opengl="NO" # sdl takes priority - produces a different executable to opengl if ! use sdl ; then if use opengl || ! use dedicated ; then build_opengl="YES" fi fi emake -j1 build_${target} \ BUILD_CLIENT=${build_opengl} \ BUILD_SDL_CLIENT=$(yesno sdl) \ BUILD_DEDICATED=$(yesno dedicated) \ WITH_XF86VM_EXT=$(yesno sdl) \ WITH_DGA_MOUSE=$(yesno dga) \ LOCALBASE=/usr \ GAMEBASE=/usr \ DATADIR="${dir}" \ LIBDIR="${libdir}" \ OPTIMIZE=$(yesno optimize-cflags) \ CC=$(tc-getCC) \ WITH_DATADIR=YES \ WITH_LIBDIR=YES \ VERBOSE=YES \ STRIP=NO \ BUILD_DEBUG_DIR=release \ BUILD_RELEASE_DIR=release \ || die "emake failed" } src_install() { # No icon yet #local icon="quake2.xpm" #doicon "${FILESDIR}/${icon}" || die local client [[ -e quake2/egl ]] && client="egl" [[ -e quake2/egl-sdl ]] && client="egl-sdl" if [[ -n "${client}" ]] ; then newgamesbin quake2/"${client}" ${PN} \ || die "newgamesbin ${client} failed" if use demo ; then games_make_wrapper ${PN}-demo "${PN} +set game demo" make_desktop_entry ${PN}-demo "EGL (Demo)" "${icon}" else make_desktop_entry ${PN} "EGL" "${icon}" fi fi if use dedicated ; then newgamesbin quake2/eglded egl-ded || die "newgamesbin eglded failed" fi exeinto "${libdir}"/baseq2 doexe quake2/baseq2/*.so || die "doexe *.so failed" insinto "${libdir}"/baseq2 doins "${WORKDIR}"/assets/* || die # http://egl.quakedev.com/files/addons/ doins -r "${WORKDIR}"/assets/addons/* || die dodoc "${S}"/*.txt prepgamesdirs } pkg_postinst() { games_pkg_postinst if use demo ; then elog "To play EGL with the demo data, type: egl-demo" echo fi }