summaryrefslogtreecommitdiff
path: root/games-fps/turtlearena
diff options
context:
space:
mode:
Diffstat (limited to 'games-fps/turtlearena')
-rw-r--r--games-fps/turtlearena/Manifest9
-rw-r--r--games-fps/turtlearena/files/turtlearena-0.6.1-build.patch201
-rw-r--r--games-fps/turtlearena/files/turtlearena-0.6.1-freetype.patch17
-rw-r--r--games-fps/turtlearena/metadata.xml13
-rw-r--r--games-fps/turtlearena/turtlearena-0.6.1-r1.ebuild122
-rw-r--r--games-fps/turtlearena/turtlearena-0.6.1.ebuild125
6 files changed, 487 insertions, 0 deletions
diff --git a/games-fps/turtlearena/Manifest b/games-fps/turtlearena/Manifest
new file mode 100644
index 000000000000..b2002cab2670
--- /dev/null
+++ b/games-fps/turtlearena/Manifest
@@ -0,0 +1,9 @@
+AUX turtlearena-0.6.1-build.patch 6401 SHA256 0fa32fedfd00b667fbd43a4bb8692ba7e51b8244038b899050c3f0b036f2a370 SHA512 c072ef951b86872a45ae6b5a8732921859605a30d00fe1c64e1c275b88d7f146f3f1435c34365907b926048d3391fbea2841228f0001dc4c249202c07aedcd4c WHIRLPOOL 29c336b98a020bf81bb423b6d6d75182b3e1e1dca2db37e8bfb7a39b7f12f513c307d19f33237e97b01b286dd1aeb2561b3b33a50b66ae18a7cf07e8102f8a5c
+AUX turtlearena-0.6.1-freetype.patch 451 SHA256 8377f998dffea20b457f90c1271ad1af15f595deb48aa59f2c6f881a4a608157 SHA512 cc16c0a69b77627956254b000a4b42e77f57f7d073488c0dde3c0b155e01288aaba958fc16d932550200add0b5429afb10f15c3e23a22d874fe31014ebe090a1 WHIRLPOOL deeed035e2cffaeae90bd55bdd49324536abb15029492027ce8fad38227edbcbb2abe0ab8d8ebfc2a5190273ec8f88f3b6d535aaa36808a83e785ea573d60608
+DIST turtlearena-0.6.1-0-src.tar.bz2 33355448 SHA256 82a16aabab30b2f77e7541ec9bf0d946207b82cce49d2ef5c1d4e9b11e287c98 SHA512 aa11f66a9ec584226267d34ecd637245a068c3c13ffc49fe0ff1ca16699b3eebf6435255ad68b953fbf02f25c807833830eb76497d53bcff977814e87b804edf WHIRLPOOL 89505581cb80e744657d83e81009461131c9bb898994c51e66b3ebe442de691d871fcb5aa63042d662a537d43dac920831291861db803d01b19067cfd0aaf595
+DIST turtlearena-0.6.1-0.zip 73713016 SHA256 99dfc41e1f00c860f8f0ceb222128cc9c363f20e7bd9e830e47c4c0aceed2a09 SHA512 83c96e572687bbdc6183393d21435806b1032295156c1905d82b300bcb6e00a34cd247731f6958e65f085c4c022fc52195313bc0f44edc7a726f04367483a378 WHIRLPOOL 666582948843469cb051dcec3e3404707b7ee9a8a047bf73b6f2948a0ca4da2ab6446ea228927f8173d6fda0ca8d051738fe58f45824056dcd0a5a4336682268
+EBUILD turtlearena-0.6.1-r1.ebuild 3148 SHA256 6677131334040d25ef411c055ee1020343b8415044b02a09559ff0d8abced676 SHA512 b535dcd923c9e7dc7f03626157284dec5b636429d460f5d1b9e9da5b04db14424eccb28591400e316f1131886bd7baae1710daa8d74254c28324afe837bff068 WHIRLPOOL e831946afb7f29db87bc95389bd7d6c76c91fe351b44903ef7648b18446b51f1b2f2ce196051505627f03ff987b7fe9425136afc8b64b90a1a6ae06ab99257d8
+EBUILD turtlearena-0.6.1.ebuild 3219 SHA256 4c9a5bb8c1bc868f61e1909b8231fef8118cfecf3f514956763cfca4766f81f7 SHA512 349a0caf99ba99cac955c66dc66282bfd003c47307f63e3a33c364184397307101fb6d2aeb8ef5bf730014f5919d1d49b8dcc9ebd505bf3172cf4189f86ca5f4 WHIRLPOOL 3807dd8dbe7c2adfb226677fdbf70870b5cb61fa73be5fc8bf24366e69a2bf264c257b0de3347b56678227243b38d50e6f0e55ac3bf4563372243452267a3b82
+MISC ChangeLog 2690 SHA256 5fa640334f197fb11b3e8504edf2d19650273a55653f52d747a04d16d865fe6e SHA512 b3b2ff1b3f6191485b9cb4e4ef4f72007676b6a6197bc6b992585a52ae7a3458c3254350e4f4aa1e43f899b2a074d3c185aaef84cb962ebe148671408ee4be00 WHIRLPOOL a70c806cd0887779366d88c55c6708c24724a75e0bfb06e8ac987ad9a7f52c33dfe17778e88e6a6035b83d2fb7f6867290806d4a06efaba6519c0c17138d8fe3
+MISC ChangeLog-2015 1304 SHA256 d8a4349d55050c26a4845f9491d23a711ebe31cd92440f610672525ddd5d11b1 SHA512 ddb972aec4ac8829769f4392b4f72b11addeca2c9f7af764182576dea0fbb41a835bd5221748ca98bb57ee004b4247d3535588e250e1335cab524913cce070c5 WHIRLPOOL 8b13009c4ce955a809db8aa4526d9d3f44b3abc89b0498a2206dd7c15d46bfb62e57739c3130e5cccdafe0cf156b801c9470c75e5a3000fce6cc74dfb40d5ab0
+MISC metadata.xml 460 SHA256 4fac00d01f36f3a1aa13d9a602309b37d8087b1643bbf25b155de40ee6154e75 SHA512 1a1feb77e6c9418a8ad82c3ab7b2c57be704c19d27b2062ddcdc6c4c6ac176466f62d27bfbcb8599ae648715e11d0fd9d54a46ccfad545668e81460db1aedb73 WHIRLPOOL a537821497b0fcd79e59993b995c3f452f672a63b428fd5aef55addc9020c75c47b37f55e38fcff579f35ef48dfcde539f92b9a65c340f229bffe0b173a0acec
diff --git a/games-fps/turtlearena/files/turtlearena-0.6.1-build.patch b/games-fps/turtlearena/files/turtlearena-0.6.1-build.patch
new file mode 100644
index 000000000000..0b6ad877b3f2
--- /dev/null
+++ b/games-fps/turtlearena/files/turtlearena-0.6.1-build.patch
@@ -0,0 +1,201 @@
+From: Julian Ospald <hasufell@gentoo.org>
+Date: Sat Apr 27 20:53:37 UTC 2013
+
+* use PKG_CONFIG var (used in cross compiling scripts, does
+ cross compiling even work?)
+* consistently use pkg-config where possible, define proper fallbacks
+* unbundle the unzip.c properly and fix headers
+* make -m* flags depend on CROSS_COMPILING var
+
+--- a/engine/Makefile
++++ b/engine/Makefile
+@@ -346,27 +346,31 @@
+
+ bin_path=$(shell which $(1) 2> /dev/null)
+
++PKG_CONFIG ?= pkg-config
++SDL_CONFIG ?= sdl-config
++
+ # We won't need this if we only build the server
+ ifneq ($(BUILD_CLIENT),0)
+- # set PKG_CONFIG_PATH to influence this, e.g.
+- # PKG_CONFIG_PATH=/opt/cross/i386-mingw32msvc/lib/pkgconfig
+- ifneq ($(call bin_path, pkg-config),)
+- CURL_CFLAGS=$(shell pkg-config --silence-errors --cflags libcurl)
+- CURL_LIBS=$(shell pkg-config --silence-errors --libs libcurl)
+- OPENAL_CFLAGS=$(shell pkg-config --silence-errors --cflags openal)
+- OPENAL_LIBS=$(shell pkg-config --silence-errors --libs openal)
+- SDL_CFLAGS=$(shell pkg-config --silence-errors --cflags sdl|sed 's/-Dmain=SDL_main//')
+- SDL_LIBS=$(shell pkg-config --silence-errors --libs sdl)
+- FREETYPE_CFLAGS=$(shell pkg-config --silence-errors --cflags freetype2)
+- endif
+- # Use sdl-config if all else fails
+- ifeq ($(SDL_CFLAGS),)
+- ifneq ($(call bin_path, sdl-config),)
+- SDL_CFLAGS=$(shell sdl-config --cflags)
+- SDL_LIBS=$(shell sdl-config --libs)
+- endif
+- endif
+-endif
++ CURL_CFLAGS=$(shell $(PKG_CONFIG) --cflags libcurl 2>/dev/null)
++ CURL_LIBS=$(shell $(PKG_CONFIG) --libs libcurl 2>/dev/null || echo "-lcurl")
++ OPENAL_CFLAGS=$(shell $(PKG_CONFIG) --cflags openal 2>/dev/null || echo "-I/usr/include/AL")
++ OPENAL_LIBS=$(shell $(PKG_CONFIG) --libs openal 2>/dev/null || echo "-lopenal")
++ SDL_CFLAGS=$(shell $(PKG_CONFIG) --cflags sdl 2>/dev/null || $(SDL_CONFIG) --cflags 2>/dev/null || echo "-I/usr/include/SDL")
++ SDL_LIBS=$(shell $(PKG_CONFIG) --libs sdl 2>/dev/null || $(SDL_CONFIG) --libs 2>/dev/null || echo "-lsdl")
++ FREETYPE_CFLAGS=$(shell $(PKG_CONFIG) --cflags freetype2 2>/dev/null || echo "-I/usr/include/freetype2")
++ FREETYPE_LIBS=$(shell $(PKG_CONFIG) --libs freetype2 2>/dev/null || echo "-lfreetype")
++ OPENGL_LIBS=$(shell $(PKG_CONFIG) --libs gl 2>/dev/null || echo "-lGL")
++ VORIBS_CFLAGS=$(shell $(PKG_CONFIG) --cflags vorbis vorbisfile 2>/dev/null)
++ VORBIS_LIBS=$(shell $(PKG_CONFIG) --libs vorbis vorbisfile 2>/dev/null || echo "-lvorbis -lvorbisfile -logg")
++ THEORA_CFLAGS=$(shell $(PKG_CONFIG) --cflags theora 2>/dev/null)
++ THEORA_LIBS=$(shell $(PKG_CONFIG) --libs theora 2>/dev/null || echo "-ltheora")
++ SPEEX_CFLAGS=$(shell $(PKG_CONFIG) --cflags speex speexdsp 2>/dev/null)
++ SPEEX_LIBS=$(shell $(PKG_CONFIG) --libs speex speexdsp 2>/dev/null || echo "-lspeex")
++endif
++
++# common deps
++ZLIB_CFLAGS=$(shell $(PKG_CONFIG) --cflags zlib minizip 2>/dev/null || echo "-I/usr/include/minizip")
++ZLIB_LIBS=$(shell $(PKG_CONFIG) --libs zlib minizip 2>/dev/null || echo "-lz -lminizip")
+
+ ifneq ($(BUILD_FINAL),1)
+ # Add svn version info
+@@ -421,7 +425,7 @@
+ endif
+
+ BASE_CFLAGS = -Wall -fno-strict-aliasing -Wimplicit -Wstrict-prototypes \
+- -pipe -DUSE_ICON
++ -DUSE_ICON
+ CLIENT_CFLAGS += $(SDL_CFLAGS)
+
+ OPTIMIZEVM = -O3 -funroll-loops -fomit-frame-pointer
+@@ -470,25 +474,29 @@
+ LIBS=-ldl -lm
+
+ CLIENT_LIBS=$(SDL_LIBS)
+- RENDERER_LIBS = $(SDL_LIBS) -lGL
++ RENDERER_LIBS = $(SDL_LIBS) $(OPENGL_LIBS)
+
+ ifeq ($(USE_OPENAL),1)
+ ifneq ($(USE_OPENAL_DLOPEN),1)
+- CLIENT_LIBS += -lopenal
+- endif
++ CLIENT_CFLAGS += $(OPENAL_CFLAGS)
++ CLIENT_LIBS += $(OPENAL_LIBS)
++ endif
+ endif
+
+ ifeq ($(USE_CURL),1)
+ ifneq ($(USE_CURL_DLOPEN),1)
+- CLIENT_LIBS += -lcurl
++ CLIENT_CFLAGS += $(CURL_CFLAGS)
++ CLIENT_LIBS += $(CURL_LIBS)
+ endif
+ endif
+
+ ifeq ($(USE_CODEC_VORBIS),1)
+- CLIENT_LIBS += -lvorbisfile -lvorbis -logg
++ CLIENT_CFLAGS += $(VORBIS_CFLAGS)
++ CLIENT_LIBS += $(VORBIS_LIBS)
+ endif
+ ifeq ($(USE_CODEC_THEORA),1)
+- CLIENT_LIBS += -ltheora
++ CLIENT_CFLAGS += $(THEORA_CFLAGS)
++ CLIENT_LIBS += $(THEORA_LIBS)
+ endif
+
+ ifeq ($(USE_MUMBLE),1)
+@@ -503,14 +511,18 @@
+ BASE_CFLAGS += $(FREETYPE_CFLAGS)
+ endif
+
++ # cross-compiling tweaks
+ ifeq ($(ARCH),i386)
+- # linux32 make ...
+- BASE_CFLAGS += -m32
+- else
+- ifeq ($(ARCH),ppc64)
+- BASE_CFLAGS += -m64
++ ifeq ($(CROSS_COMPILING),1)
++ BASE_CFLAGS += -m32
++ endif
+ endif
++ ifeq ($(ARCH),amd64)
++ ifeq ($(CROSS_COMPILING),1)
++ BASE_CFLAGS += -m64
++ endif
+ endif
++
+ else # ifeq Linux
+
+ #############################################################################
+@@ -1155,7 +1167,8 @@
+ ifeq ($(USE_INTERNAL_SPEEX),1)
+ CLIENT_CFLAGS += -DFLOATING_POINT -DUSE_ALLOCA -I$(SPEEXDIR)/include
+ else
+- CLIENT_LIBS += -lspeex -lspeexdsp
++ CLIENT_CFLAGS += $(SPEEX_CFLAGS)
++ CLIENT_LIBS += $(SPEEX_LIBS)
+ endif
+ endif
+
+@@ -1163,7 +1176,8 @@
+ BASE_CFLAGS += -DNO_GZIP
+ BASE_CFLAGS += -I$(ZDIR)
+ else
+- LIBS += -lz
++ BASE_CFLAGS += $(ZLIB_CFLAGS)
++ LIBS += $(ZLIB_LIBS)
+ endif
+
+ ifeq ($(USE_INTERNAL_JPEG),1)
+@@ -1177,7 +1191,8 @@
+ BASE_CFLAGS += -I$(FTDIR)/include \
+ -DFT2_BUILD_LIBRARY
+ else
+- RENDERER_LIBS += -lfreetype
++ BASE_CFLAGS += $(FREETYPE_CFLAGS)
++ RENDERER_LIBS += $(FREETYPE_LIBS)
+ endif
+
+ ifeq ("$(CC)", $(findstring "$(CC)", "clang" "clang++"))
+@@ -1650,8 +1665,6 @@
+ $(B)/client/q_math.o \
+ $(B)/client/q_shared.o \
+ \
+- $(B)/client/unzip.o \
+- $(B)/client/ioapi.o \
+ $(B)/client/puff.o \
+ $(B)/client/vm.o \
+ $(B)/client/vm_interpreted.o \
+@@ -2076,8 +2089,6 @@
+ $(B)/ded/q_math.o \
+ $(B)/ded/q_shared.o \
+ \
+- $(B)/ded/unzip.o \
+- $(B)/ded/ioapi.o \
+ $(B)/ded/vm.o \
+ $(B)/ded/vm_interpreted.o \
+ \
+--- a/engine/code/qcommon/files.c
++++ b/engine/code/qcommon/files.c
+@@ -31,7 +31,7 @@ Foundation, Inc., 51 Franklin St, Fifth
+
+ #include "q_shared.h"
+ #include "qcommon.h"
+-#include "unzip.h"
++#include <minizip/unzip.h>
+
+ /*
+ =============================================================================
+--- a/engine/code/renderer/tr_public.h
++++ b/engine/code/renderer/tr_public.h
+@@ -25,7 +25,7 @@
+ #include "tr_types.h"
+
+ #ifdef IOQ3ZTM // PNG_SCREENSHOTS
+-#include "../zlib/zlib.h"
++#include <zlib.h>
+ #endif
+
+ #define REF_API_VERSION 8
diff --git a/games-fps/turtlearena/files/turtlearena-0.6.1-freetype.patch b/games-fps/turtlearena/files/turtlearena-0.6.1-freetype.patch
new file mode 100644
index 000000000000..9ecd6df2bf57
--- /dev/null
+++ b/games-fps/turtlearena/files/turtlearena-0.6.1-freetype.patch
@@ -0,0 +1,17 @@
+http://bugs.gentoo.org/show_bug.cgi?id=479822#c3
+http://github.com/ioquake/ioq3/commit/ab4c602374caa0f520b3a0801d384a73e29e0bc7
+
+--- a/engine/code/renderer/tr_font.c
++++ b/engine/code/renderer/tr_font.c
+@@ -47,10 +47,10 @@
+ #include "../qcommon/qcommon.h"
+
+ #include <ft2build.h>
++#include FT_FREETYPE_H
+ #include FT_ERRORS_H
+ #include FT_SYSTEM_H
+ #include FT_IMAGE_H
+-#include FT_FREETYPE_H
+ #include FT_OUTLINE_H
+
+ #define _FLOOR(x) ((x) & -64)
diff --git a/games-fps/turtlearena/metadata.xml b/games-fps/turtlearena/metadata.xml
new file mode 100644
index 000000000000..3b18515f6b24
--- /dev/null
+++ b/games-fps/turtlearena/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>games@gentoo.org</email>
+ <name>Gentoo Games Project</name>
+ </maintainer>
+ <use>
+ <flag name="mumble">Adds player-location (positional audio) support to VoIP</flag>
+ <flag name="server">Build server target</flag>
+ <flag name="voice">Adds VoIP support</flag>
+ </use>
+</pkgmetadata>
diff --git a/games-fps/turtlearena/turtlearena-0.6.1-r1.ebuild b/games-fps/turtlearena/turtlearena-0.6.1-r1.ebuild
new file mode 100644
index 000000000000..ee3525548a70
--- /dev/null
+++ b/games-fps/turtlearena/turtlearena-0.6.1-r1.ebuild
@@ -0,0 +1,122 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit eutils gnome2-utils
+
+MY_P=${PN/-/}-${PV}
+
+DESCRIPTION="A turtle featuring free and open source third-person action game (ioq3 engine)"
+HOMEPAGE="http://ztm.x10host.com/ta/index.htm"
+SRC_URI="https://turtlearena.googlecode.com/files/${MY_P}-0-src.tar.bz2
+ https://turtlearena.googlecode.com/files/${MY_P}-0.zip"
+
+LICENSE="GPL-2+ CC-BY-SA-3.0 mplus-fonts lcc"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="+curl debug dedicated mumble openal server theora voice vorbis"
+
+RDEPEND="
+ sys-libs/zlib[minizip]
+ !dedicated? (
+ media-libs/freetype:2
+ media-libs/libsdl[X,sound,joystick,opengl,video]
+ virtual/jpeg:0
+ virtual/opengl
+ curl? ( net-misc/curl )
+ openal? ( media-libs/openal )
+ theora? ( media-libs/libtheora )
+ voice? (
+ media-libs/speex
+ mumble? ( media-sound/mumble )
+ )
+ vorbis? ( media-libs/libvorbis )
+ )"
+DEPEND="${RDEPEND}
+ app-arch/unzip
+ virtual/pkgconfig"
+
+S=${WORKDIR}/${MY_P}-0-src
+
+src_prepare() {
+ default
+
+ eapply "${FILESDIR}"/${P}-build.patch
+ eapply "${FILESDIR}"/${P}-freetype.patch
+
+ sed -i \
+ -e 's:JPEG_LIB_VERSION < 80:JPEG_LIB_VERSION < 62:' \
+ engine/code/renderer/tr_image_jpg.c || die #479822
+
+ rm -r engine/code/{AL,libcurl,libogg,libspeex,libtheora,libvorbis,SDL12,zlib} \
+ engine/code/freetype* engine/code/jpeg-* \
+ engine/code/qcommon/unzip.{c,h} || die
+}
+
+src_compile() {
+ buildit() { use $1 && echo 1 || echo 0 ; }
+ nobuildit() { use $1 && echo 0 || echo 1 ; }
+
+ myarch=$(usex amd64 "x86_64" "x86")
+ emake -C engine \
+ Q="" \
+ ARCH=${myarch} \
+ CROSS_COMPILING=0 \
+ BUILD_GAME_QVM=0 \
+ BUILD_GAME_SO=0 \
+ BUILD_CLIENT=$(nobuildit dedicated) \
+ BUILD_SERVER=$(usex dedicated "1" "$(buildit server)") \
+ DEFAULT_BASEDIR="/usr/share/${PN}" \
+ GENERATE_DEPENDENCIES=0 \
+ OPTIMIZEVM="" \
+ OPTIMIZE="" \
+ DEBUG_CFLAGS="" \
+ USE_MUMBLE=$(buildit mumble) \
+ USE_VOIP=$(buildit voice) \
+ USE_INTERNAL_SPEEX=0 \
+ USE_INTERNAL_OGG=0 \
+ USE_INTERNAL_ZLIB=0 \
+ USE_INTERNAL_JPEG=0 \
+ USE_INTERNAL_FREETYPE=0 \
+ USE_CODEC_VORBIS=$(buildit vorbis) \
+ USE_INTERNAL_VORBIS=0 \
+ USE_CODEC_THEORA=$(buildit theora) \
+ USE_OPENAL=$(buildit openal) \
+ USE_OPENAL_DLOPEN=0 \
+ USE_CURL=$(buildit curl) \
+ USE_CURL_DLOPEN=0 \
+ USE_LOCAL_HEADERS=0 \
+ $(usex debug "debug" "release")
+}
+
+src_install() {
+ dodoc engine/{ChangeLog,BUGS,TODO}
+ use voice && dodoc engine/voip-readme.txt
+
+ if ! use dedicated ; then
+ newbin engine/build/$(usex debug "debug" "release")-linux-${myarch}/turtlearena.${myarch} turtlearena
+ newicon -s scalable engine/misc/quake3-tango.svg ${PN}.svg
+ newicon -s 256 engine/misc/quake3-tango.png ${PN}.png
+ make_desktop_entry ${PN}
+ fi
+
+ if use dedicated || use server ; then
+ newbin engine/build/$(usex debug "debug" "release")-linux-${myarch}/turtlearena-server.${myarch} turtlearena-server
+ fi
+
+ insinto "/usr/share/${PN}"
+ doins -r "${WORKDIR}"/${MY_P}-0/base
+}
+
+pkg_preinst() {
+ use dedicated || gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ use dedicated || gnome2_icon_cache_update
+}
+
+pkg_postrm() {
+ use dedicated || gnome2_icon_cache_update
+}
diff --git a/games-fps/turtlearena/turtlearena-0.6.1.ebuild b/games-fps/turtlearena/turtlearena-0.6.1.ebuild
new file mode 100644
index 000000000000..66eade36d51c
--- /dev/null
+++ b/games-fps/turtlearena/turtlearena-0.6.1.ebuild
@@ -0,0 +1,125 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit eutils gnome2-utils games
+
+MY_P=${PN/-/}-${PV}
+
+DESCRIPTION="A turtle featuring free and open source third-person action game (ioq3 engine)"
+HOMEPAGE="http://ztm.x10host.com/ta/index.htm"
+SRC_URI="https://turtlearena.googlecode.com/files/${MY_P}-0-src.tar.bz2
+ https://turtlearena.googlecode.com/files/${MY_P}-0.zip"
+
+LICENSE="GPL-2+ CC-BY-SA-3.0 mplus-fonts lcc"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="+curl debug dedicated mumble openal server theora voice vorbis"
+
+RDEPEND="
+ sys-libs/zlib[minizip]
+ !dedicated? (
+ media-libs/freetype:2
+ media-libs/libsdl[X,sound,joystick,opengl,video]
+ virtual/jpeg:0
+ virtual/opengl
+ curl? ( net-misc/curl )
+ openal? ( media-libs/openal )
+ theora? ( media-libs/libtheora )
+ voice? (
+ media-libs/speex
+ mumble? ( media-sound/mumble )
+ )
+ vorbis? ( media-libs/libvorbis )
+ )"
+DEPEND="${RDEPEND}
+ app-arch/unzip
+ virtual/pkgconfig"
+
+S=${WORKDIR}/${MY_P}-0-src
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${P}-build.patch \
+ "${FILESDIR}"/${P}-freetype.patch
+
+ sed -i \
+ -e 's:JPEG_LIB_VERSION < 80:JPEG_LIB_VERSION < 62:' \
+ engine/code/renderer/tr_image_jpg.c || die #479822
+
+ rm -r engine/code/{AL,libcurl,libogg,libspeex,libtheora,libvorbis,SDL12,zlib} \
+ engine/code/freetype* engine/code/jpeg-* \
+ engine/code/qcommon/unzip.{c,h} || die
+}
+
+src_compile() {
+ buildit() { use $1 && echo 1 || echo 0 ; }
+ nobuildit() { use $1 && echo 0 || echo 1 ; }
+
+ myarch=$(usex amd64 "x86_64" "x86")
+ emake -C engine \
+ Q="" \
+ ARCH=${myarch} \
+ CROSS_COMPILING=0 \
+ BUILD_GAME_QVM=0 \
+ BUILD_GAME_SO=0 \
+ BUILD_CLIENT=$(nobuildit dedicated) \
+ BUILD_SERVER=$(usex dedicated "1" "$(buildit server)") \
+ DEFAULT_BASEDIR="${GAMES_DATADIR}/${PN}" \
+ GENERATE_DEPENDENCIES=0 \
+ OPTIMIZEVM="" \
+ OPTIMIZE="" \
+ DEBUG_CFLAGS="" \
+ USE_MUMBLE=$(buildit mumble) \
+ USE_VOIP=$(buildit voice) \
+ USE_INTERNAL_SPEEX=0 \
+ USE_INTERNAL_OGG=0 \
+ USE_INTERNAL_ZLIB=0 \
+ USE_INTERNAL_JPEG=0 \
+ USE_INTERNAL_FREETYPE=0 \
+ USE_CODEC_VORBIS=$(buildit vorbis) \
+ USE_INTERNAL_VORBIS=0 \
+ USE_CODEC_THEORA=$(buildit theora) \
+ USE_OPENAL=$(buildit openal) \
+ USE_OPENAL_DLOPEN=0 \
+ USE_CURL=$(buildit curl) \
+ USE_CURL_DLOPEN=0 \
+ USE_LOCAL_HEADERS=0 \
+ $(usex debug "debug" "release")
+}
+
+src_install() {
+ dodoc engine/{ChangeLog,BUGS,TODO}
+ use voice && dodoc engine/voip-readme.txt
+
+ if ! use dedicated ; then
+ newgamesbin engine/build/$(usex debug "debug" "release")-linux-${myarch}/turtlearena.${myarch} turtlearena
+ newicon -s scalable engine/misc/quake3-tango.svg ${PN}.svg
+ newicon -s 256 engine/misc/quake3-tango.png ${PN}.png
+ make_desktop_entry ${PN}
+ fi
+
+ if use dedicated || use server ; then
+ newgamesbin engine/build/$(usex debug "debug" "release")-linux-${myarch}/turtlearena-server.${myarch} turtlearena-server
+ fi
+
+ insinto "${GAMES_DATADIR}/${PN}"
+ doins -r "${WORKDIR}"/${MY_P}-0/base
+
+ prepgamesdirs
+}
+
+pkg_preinst() {
+ games_pkg_preinst
+ use dedicated || gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ games_pkg_postinst
+ use dedicated || gnome2_icon_cache_update
+}
+
+pkg_postrm() {
+ use dedicated || gnome2_icon_cache_update
+}