From 1428bdcfa8087fb355abfcd68d9a7445e613f689 Mon Sep 17 00:00:00 2001 From: Alfredo Tupone Date: Tue, 27 Mar 2012 15:16:11 +0000 Subject: Version bump to 0.6.1 Bug #363395 Package-Manager: portage-2.1.10.51/cvs/Linux i686 --- games-action/teeworlds/ChangeLog | 11 +- games-action/teeworlds/Manifest | 15 ++- .../files/0.6.1/01-use-system-wavpack.patch | 103 +++++++++++++++++++ .../0.6.1/02-fixed-wavpack-sound-loading.patch | 109 ++++++++++++++++++++ .../files/0.6.1/03-use-system-pnglite.patch | 112 +++++++++++++++++++++ games-action/teeworlds/files/teeworlds-init.d | 40 ++++++++ games-action/teeworlds/files/teeworlds_srv.cfg | 7 ++ games-action/teeworlds/teeworlds-0.6.1.ebuild | 100 ++++++++++++++++++ 8 files changed, 492 insertions(+), 5 deletions(-) create mode 100644 games-action/teeworlds/files/0.6.1/01-use-system-wavpack.patch create mode 100644 games-action/teeworlds/files/0.6.1/02-fixed-wavpack-sound-loading.patch create mode 100644 games-action/teeworlds/files/0.6.1/03-use-system-pnglite.patch create mode 100644 games-action/teeworlds/files/teeworlds-init.d create mode 100644 games-action/teeworlds/files/teeworlds_srv.cfg create mode 100644 games-action/teeworlds/teeworlds-0.6.1.ebuild (limited to 'games-action') diff --git a/games-action/teeworlds/ChangeLog b/games-action/teeworlds/ChangeLog index f3c6d8d518a3..380a2d7e0f06 100644 --- a/games-action/teeworlds/ChangeLog +++ b/games-action/teeworlds/ChangeLog @@ -1,6 +1,15 @@ # ChangeLog for games-action/teeworlds # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/games-action/teeworlds/ChangeLog,v 1.5 2012/03/26 08:50:04 tupone Exp $ +# $Header: /var/cvsroot/gentoo-x86/games-action/teeworlds/ChangeLog,v 1.6 2012/03/27 15:16:11 tupone Exp $ + +*teeworlds-0.6.1 (27 Mar 2012) + + 27 Mar 2012; Tupone Alfredo + +files/0.6.1/01-use-system-wavpack.patch, + +files/0.6.1/02-fixed-wavpack-sound-loading.patch, + +files/0.6.1/03-use-system-pnglite.patch, +teeworlds-0.6.1.ebuild, + +files/teeworlds-init.d, +files/teeworlds_srv.cfg: + Version bump to 0.6.1 Bug #363395 by Bruno 'brubru' Tarquini 26 Mar 2012; Tupone Alfredo teeworlds-0.5.2.ebuild, +files/teeworlds-0.5.2-gcc46.patch: diff --git a/games-action/teeworlds/Manifest b/games-action/teeworlds/Manifest index e0f670106e47..dafcc4a5daf3 100644 --- a/games-action/teeworlds/Manifest +++ b/games-action/teeworlds/Manifest @@ -1,18 +1,25 @@ -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 +AUX 0.6.1/01-use-system-wavpack.patch 3063 RMD160 b660e44cc888d606bfbe3e43a5c0e3a5cd7d065a SHA1 13596a8da27de3c1713b9519566b91e3ff9238ae SHA256 2475275f1dd8264cb9e880bfccca13951a9bcdfbee24c4c9953e830cdf6a5180 +AUX 0.6.1/02-fixed-wavpack-sound-loading.patch 2905 RMD160 cd090c942e755a36fc2ce661deb00995fece1f84 SHA1 66c03ce5f9755e0525d5da9c4c8c3b02b6ab0126 SHA256 4da6873dff90d89ea786daa1f9d67e38cd7038860eb45e655401d94c692e25cf +AUX 0.6.1/03-use-system-pnglite.patch 3935 RMD160 a060bb0ecb92727a160fe62bab1880c14ad37666 SHA1 8f3584bd8e462cd13f318d33b50bef9442773b00 SHA256 e035cb3074de6c8bc95c7e8486baa51fd2c85b10f2f8badbeb91253cb6721415 AUX teeworlds-0.5.2-gcc46.patch 263 RMD160 c57014900e7f7933b2516ec4e37bbb1ffd3177c6 SHA1 10d55b860e3c251d69be1c3727c3597a24eadb3f SHA256 04e9c02c36885677845bd83fbdac02a216c5ee32f677d0fe4a510537420b15fe AUX teeworlds-0.5.2-system-libs.patch 1861 RMD160 8d60b4506440fad9907501a340e016e7f68f4385 SHA1 e8113d7f30a7e0866b6e87934f63a2e1bb2dbff7 SHA256 a748535f57b62d056c302c290dd47e29cc7a2e4d5bc345527c5ce70b97ce607b AUX teeworlds-0.5.2-wavpack.patch 1347 RMD160 b1f86935b5781306f7adc8a78736d60de2dce848 SHA1 d8ffad789c27b6627a59201904e980aaa2c8f6d4 SHA256 efa498dafb12fb646fc6678592b47eaab8497ecefb2cdc5a0ace663d49eebb3d +AUX teeworlds-init.d 999 RMD160 4ef756e703a1b1e393c8151545394e14e71bbaee SHA1 510fefc159e1783aaed757043e2b42b887d4e6c4 SHA256 8f60b3b2f68d9cfdb279ffbaefd2a6c611d74ce87fc306faaa438dc61732ca3b AUX teeworlds.xpm 2785 RMD160 f45531cd48dc897b02c73fee5870f703877620da SHA1 1a00d39a748ea006f71f4b7c0ed73015e34a18a0 SHA256 0b31cc3e65ca26676324a7b66de29cb91df90221e28f9e4b5adfec0e37729284 +AUX teeworlds_srv.cfg 193 RMD160 256e8dee12d3f6bf4653bbe52443f9277c39425e SHA1 0552d6fb7551f5e0fb5c4ba047ec2d7d42b44429 SHA256 9c00eca2c72d02893c288282793b81abb472ee0a7302847e472e964179339687 DIST teeworlds-0.5.2-src.tar.gz 6393472 RMD160 12b3384b3059d5ec0ebb437686f613f8d9430e61 SHA1 26d8059b1ad81ca6959b96fd3ff881f9db7550ef SHA256 1811a71bf9a1470c7a69308035744492f3e850aefdd12f1bc223fb85d98cf4c0 +DIST teeworlds-0.6.1-source.tar.gz 8599538 RMD160 38ea0148ce9caf296403774b8b395df462e564ea SHA1 27f74db7c035143c7b539acc7aab7fb825b972ab SHA256 6328d48fb98d451af8e1dba0999190496e851842c84e4594d413b79aca67b908 EBUILD teeworlds-0.5.2.ebuild 2389 RMD160 c11b14424b34682d2a25fa061a08cb321b0a02dd SHA1 b5de3d8ccf765a617dd9c8c158f213c7fa3ed780 SHA256 55a315dcc02532fa9d525ec66497674edb84e901938e1559f11d55483bf7de5e -MISC ChangeLog 1341 RMD160 a4c3a1103c24889ff7c05bbf3e88c5e1c50ce50c SHA1 02accccc4c9a21c6bb683e9719c8502b5481ae4b SHA256 e5b98c27c5ca79e3b3a2dc733789bdb588c418dea5a05e5095ea0bd4c52b12b3 +EBUILD teeworlds-0.6.1.ebuild 2155 RMD160 6de1641a2f15dfae334f0e7e4b4e79778eb885a9 SHA1 9e229c324ff5221f425ea458dd277c4281b3e290 SHA256 95e75f8bc8f0d6511a0da53cb5be30ad38551af412980c937eefa7a4b11af479 +MISC ChangeLog 1706 RMD160 35205cf0ea0a3fd31766d35406ca398c28c9b158 SHA1 23afecfb1f3d98134fa042d1432c59fe5d70dbea SHA256 9eede659780057101ab244f6eee31fda533a6fd9dccdaefd3a540106b0d45d4e MISC metadata.xml 309 RMD160 77d06e39802ded0077343efe4e113a4fc23cbe0d SHA1 479fb96f2b7ad915bee07e5f46e407908bd678d7 SHA256 483d678f443d433b99a05dca001e83ae6f3d9128c2d6236196ec972386ef337a -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (GNU/Linux) -iEYEARECAAYFAk9wLcgACgkQIY77eQFFFC1c7gCfS5rRZPVwrYL/YU91ncUyXmfq -J2gAn18zcwljeA5pDCW1bP28PVEXdmfD -=HSYo +iEYEARECAAYFAk9x2cEACgkQIY77eQFFFC2wswCePbCraIthArW5w/zOwilFeQ8+ +9X8AniNgl5btuZVvSK2yeu7n6adjKDyB +=xUTQ -----END PGP SIGNATURE----- diff --git a/games-action/teeworlds/files/0.6.1/01-use-system-wavpack.patch b/games-action/teeworlds/files/0.6.1/01-use-system-wavpack.patch new file mode 100644 index 000000000000..3a1944dcf739 --- /dev/null +++ b/games-action/teeworlds/files/0.6.1/01-use-system-wavpack.patch @@ -0,0 +1,103 @@ +Use system wavpack. Based on patch from Gentoo Bugzilla + +From: Azamat H. Hackimov + +https://bugs.gentoo.org/show_bug.cgi?id=363395 +--- + + bam.lua | 15 +++++++++++++-- + src/engine/client/sound.cpp | 10 +++++++++- + 2 files changed, 22 insertions(+), 3 deletions(-) + + +diff --git a/bam.lua b/bam.lua +index 5699251..ce24cff 100644 +--- a/bam.lua ++++ b/bam.lua +@@ -9,6 +9,7 @@ config = NewConfig() + config:Add(OptCCompiler("compiler")) + config:Add(OptTestCompileC("stackprotector", "int main(){return 0;}", "-fstack-protector -fstack-protector-all")) + config:Add(OptLibrary("zlib", "zlib.h", false)) ++config:Add(OptLibrary("wavpack", "wavpack/wavpack.h", false)) + config:Add(SDL.OptFind("sdl", true)) + config:Add(FreeType.OptFind("freetype", true)) + config:Finalize("config.lua") +@@ -165,7 +166,7 @@ function build(settings) + end + + -- compile zlib if needed +- if config.zlib.value == 1 then ++ if config.zlib.value == true then + settings.link.libs:Add("z") + if config.zlib.include_path then + settings.cc.includes:Add(config.zlib.include_path) +@@ -176,8 +177,18 @@ function build(settings) + settings.cc.includes:Add("src/engine/external/zlib") + end + ++ if config.wavpack.value == true then ++ settings.link.libs:Add("wavpack") ++ if config.wavpack.include_path then ++ settings.cc.includes:Add(config.wavpack.include_path) ++ end ++ wavpack = {} ++ else ++ wavpack = Compile(settings, Collect("src/engine/external/wavpack/*.c")) ++ settings.cc.includes:Add("src/engine/external/") --The header is wavpack/wavpack.h so include the external folder ++ end ++ + -- build the small libraries +- wavpack = Compile(settings, Collect("src/engine/external/wavpack/*.c")) + pnglite = Compile(settings, Collect("src/engine/external/pnglite/*.c")) + + -- build game components +diff --git a/src/engine/client/sound.cpp b/src/engine/client/sound.cpp +index c2ca91f..f356e34 100644 +--- a/src/engine/client/sound.cpp ++++ b/src/engine/client/sound.cpp +@@ -10,7 +10,7 @@ + #include "sound.h" + + extern "C" { // wavpack +- #include ++ #include + } + #include + +@@ -333,19 +333,25 @@ int CSound::LoadWV(const char *pFilename) + if(!m_pStorage) + return -1; + ++ #ifndef WAVPACK_H + ms_File = m_pStorage->OpenFile(pFilename, IOFLAG_READ, IStorage::TYPE_ALL); + if(!ms_File) + { + dbg_msg("sound/wv", "failed to open file. filename='%s'", pFilename); + return -1; + } ++ #endif + + SampleID = AllocID(); + if(SampleID < 0) + return -1; + pSample = &m_aSamples[SampleID]; + ++ #ifndef WAVPACK_H + pContext = WavpackOpenFileInput(ReadData, aError); ++ #else ++ pContext = WavpackOpenFileInput(pFilename, aError, 0, 0); ++ #endif + if (pContext) + { + int m_aSamples = WavpackGetNumSamples(pContext); +@@ -401,8 +407,10 @@ int CSound::LoadWV(const char *pFilename) + dbg_msg("sound/wv", "failed to open %s: %s", pFilename, aError); + } + ++ #ifndef WAVPACK_H + io_close(ms_File); + ms_File = NULL; ++ #endif + + if(g_Config.m_Debug) + dbg_msg("sound/wv", "loaded %s", pFilename); diff --git a/games-action/teeworlds/files/0.6.1/02-fixed-wavpack-sound-loading.patch b/games-action/teeworlds/files/0.6.1/02-fixed-wavpack-sound-loading.patch new file mode 100644 index 000000000000..b129aaf11ce4 --- /dev/null +++ b/games-action/teeworlds/files/0.6.1/02-fixed-wavpack-sound-loading.patch @@ -0,0 +1,109 @@ +Fixing wavpack sound loading. Based on Gentoo Bugzilla + +From: Azamat H. Hackimov + +https://bugs.gentoo.org/show_bug.cgi?id=363395 +--- + + src/engine/client/sound.cpp | 56 ++++++++++++++++++++++++++++++++++++++----- + 1 files changed, 50 insertions(+), 6 deletions(-) + + +diff --git a/src/engine/client/sound.cpp b/src/engine/client/sound.cpp +index f356e34..b55a798 100644 +--- a/src/engine/client/sound.cpp ++++ b/src/engine/client/sound.cpp +@@ -50,6 +50,54 @@ struct CVoice + int m_X, m_Y; + } ; + ++#ifdef WAVPACK_H ++static int32_t ReadBytes(void *pFile, void *pBuffer, int32_t Size) ++{ ++ return (int32_t)io_read((IOHANDLE)pFile, pBuffer, Size); ++} ++static uint32_t GetPos(void *pFile) ++{ ++ return (uint32_t)io_tell((IOHANDLE)pFile); ++} ++static int SetPosAbs(void *pFile, uint32_t Offset) ++{ ++ return io_seek((IOHANDLE)pFile, Offset, IOSEEK_START); ++} ++static int SetPosRel(void *pFile, int32_t Offset, int Mode) ++{ ++ switch(Mode) ++ { ++ case SEEK_SET: ++ Mode = IOSEEK_START; ++ break; ++ case SEEK_CUR: ++ Mode = IOSEEK_CUR; ++ break; ++ case SEEK_END: ++ Mode = IOSEEK_END; ++ } ++ return io_seek((IOHANDLE)pFile, Offset, Mode); ++} ++ ++//TODO: Fix if 'real' functionality is needed by the wavpack header ++static int PushBackByte(void *pFile, int Char) ++{ ++ return io_seek((IOHANDLE)pFile, -1, IOSEEK_CUR); ++} ++static uint32_t GetLength(void *pFile) ++{ ++ return (uint32_t)io_length((IOHANDLE)pFile); ++} ++// Essentially assuming this to always be true, should fix if this isn't the case ++static int CanSeek(void *pFile) ++{ ++ return pFile != NULL; ++} ++static WavpackStreamReader CWavpackReader = { ++ ReadBytes, GetPos, SetPosAbs, SetPosRel, PushBackByte, GetLength, CanSeek, 0 ++}; ++#endif ++ + static CSample m_aSamples[NUM_SAMPLES] = { {0} }; + static CVoice m_aVoices[NUM_VOICES] = { {0} }; + static CChannel m_aChannels[NUM_CHANNELS] = { {255, 0} }; +@@ -333,14 +381,12 @@ int CSound::LoadWV(const char *pFilename) + if(!m_pStorage) + return -1; + +- #ifndef WAVPACK_H + ms_File = m_pStorage->OpenFile(pFilename, IOFLAG_READ, IStorage::TYPE_ALL); + if(!ms_File) + { + dbg_msg("sound/wv", "failed to open file. filename='%s'", pFilename); + return -1; + } +- #endif + + SampleID = AllocID(); + if(SampleID < 0) +@@ -350,7 +396,7 @@ int CSound::LoadWV(const char *pFilename) + #ifndef WAVPACK_H + pContext = WavpackOpenFileInput(ReadData, aError); + #else +- pContext = WavpackOpenFileInput(pFilename, aError, 0, 0); ++ pContext = WavpackOpenFileInputEx(&CWavpackReader, ms_File, 0, aError, 0, 0); + #endif + if (pContext) + { +@@ -404,13 +450,11 @@ int CSound::LoadWV(const char *pFilename) + } + else + { +- dbg_msg("sound/wv", "failed to open %s: %s", pFilename, aError); ++ dbg_msg("sound/wv", "failed to open '%s': %s", pFilename, aError); + } + +- #ifndef WAVPACK_H + io_close(ms_File); + ms_File = NULL; +- #endif + + if(g_Config.m_Debug) + dbg_msg("sound/wv", "loaded %s", pFilename); diff --git a/games-action/teeworlds/files/0.6.1/03-use-system-pnglite.patch b/games-action/teeworlds/files/0.6.1/03-use-system-pnglite.patch new file mode 100644 index 000000000000..998a08659362 --- /dev/null +++ b/games-action/teeworlds/files/0.6.1/03-use-system-pnglite.patch @@ -0,0 +1,112 @@ +Use system pnglite. Based on Gentoo Bugzilla + +From: Azamat H. Hackimov + +https://bugs.gentoo.org/show_bug.cgi?id=363395 +--- + + bam.lua | 33 +++++++++++++++++++++------------ + src/engine/client/graphics.cpp | 2 +- + src/tools/dilate.cpp | 2 +- + src/tools/tileset_borderfix.cpp | 2 +- + 4 files changed, 24 insertions(+), 15 deletions(-) + + +diff --git a/bam.lua b/bam.lua +index ce24cff..46b8e42 100644 +--- a/bam.lua ++++ b/bam.lua +@@ -9,6 +9,7 @@ config = NewConfig() + config:Add(OptCCompiler("compiler")) + config:Add(OptTestCompileC("stackprotector", "int main(){return 0;}", "-fstack-protector -fstack-protector-all")) + config:Add(OptLibrary("zlib", "zlib.h", false)) ++config:Add(OptLibrary("pnglite", "pnglite.h", false)) + config:Add(OptLibrary("wavpack", "wavpack/wavpack.h", false)) + config:Add(SDL.OptFind("sdl", true)) + config:Add(FreeType.OptFind("freetype", true)) +@@ -177,26 +178,34 @@ function build(settings) + settings.cc.includes:Add("src/engine/external/zlib") + end + ++ -- build game components ++ engine_settings = settings:Copy() ++ server_settings = engine_settings:Copy() ++ client_settings = engine_settings:Copy() ++ launcher_settings = engine_settings:Copy() ++ ++ if config.pnglite.value == true then ++ client_settings.link.libs:Add("pnglite") ++ if config.pnglite.include_path then ++ client_settings.cc.includes:Add(config.pnglite.include_path) ++ end ++ pnglite = {} ++ else ++ pnglite = Compile(settings, Collect("src/engine/external/pnglite/*.c")) ++ client_settings.cc.includes:Add("src/engine/external/pnglite") ++ end ++ + if config.wavpack.value == true then +- settings.link.libs:Add("wavpack") ++ client_settings.link.libs:Add("wavpack") + if config.wavpack.include_path then +- settings.cc.includes:Add(config.wavpack.include_path) ++ client_settings.cc.includes:Add(config.wavpack.include_path) + end + wavpack = {} + else + wavpack = Compile(settings, Collect("src/engine/external/wavpack/*.c")) +- settings.cc.includes:Add("src/engine/external/") --The header is wavpack/wavpack.h so include the external folder ++ client_settings.cc.includes:Add("src/engine/external/") --The header is wavpack/wavpack.h so include the external folder + end + +- -- build the small libraries +- pnglite = Compile(settings, Collect("src/engine/external/pnglite/*.c")) +- +- -- build game components +- engine_settings = settings:Copy() +- server_settings = engine_settings:Copy() +- client_settings = engine_settings:Copy() +- launcher_settings = engine_settings:Copy() +- + if family == "unix" then + if platform == "macosx" then + client_settings.link.frameworks:Add("OpenGL") +diff --git a/src/engine/client/graphics.cpp b/src/engine/client/graphics.cpp +index d1f0b8a..f654e87 100644 +--- a/src/engine/client/graphics.cpp ++++ b/src/engine/client/graphics.cpp +@@ -20,7 +20,7 @@ + #endif + + #include +-#include ++#include + + #include + #include +diff --git a/src/tools/dilate.cpp b/src/tools/dilate.cpp +index eb770a9..cbd7a3e 100644 +--- a/src/tools/dilate.cpp ++++ b/src/tools/dilate.cpp +@@ -2,7 +2,7 @@ + /* If you are missing that file, acquire a complete release at teeworlds.com. */ + #include + #include +-#include ++#include + + typedef struct + { +diff --git a/src/tools/tileset_borderfix.cpp b/src/tools/tileset_borderfix.cpp +index 0facb9a..ab36292 100644 +--- a/src/tools/tileset_borderfix.cpp ++++ b/src/tools/tileset_borderfix.cpp +@@ -1,7 +1,7 @@ + /* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */ + /* If you are missing that file, acquire a complete release at teeworlds.com. */ + #include +-#include ++#include + + typedef struct + { diff --git a/games-action/teeworlds/files/teeworlds-init.d b/games-action/teeworlds/files/teeworlds-init.d new file mode 100644 index 000000000000..7b9fd33bffee --- /dev/null +++ b/games-action/teeworlds/files/teeworlds-init.d @@ -0,0 +1,40 @@ +#!/sbin/runscript +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +PIDFILE=/var/run/teeworlds.pid +GAME_DIRECTORY=/usr/games/bin +CONFIG=/etc/teeworlds/teeworlds_srv.cfg + +depend() { + use dns logger net +} + +checkconfig() { + if [ ! -e ${CONFIG} ] ; then + eerror "You need an ${CONFIG} config file to run TeeWorlds" + return 1 + fi +} + +start() { + ebegin "Starting TeeWorlds" + start-stop-daemon --start --background --pidfile "${PIDFILE}" \ + --make-pidfile -d ${GAME_DIRECTORY} --user games \ + --exec ${GAME_DIRECTORY}/teeworlds_srv -- -f ${CONFIG} + eend $? +} + +reload() { + ebegin "Reloading TeeWorlds configs and restarting processes" + start-stop-daemon --stop --oknodo --user games \ + --pidfile "${PIDFILE}" --signal HUP \ + --exec ${GAME_DIRECTORY}/teeworlds_srv -- -f ${CONFIG} + eend $? +} + +stop() { + ebegin "Stopping TeeWorlds" + start-stop-daemon --stop --quiet --pidfile "${PIDFILE}" + eend $? +} diff --git a/games-action/teeworlds/files/teeworlds_srv.cfg b/games-action/teeworlds/files/teeworlds_srv.cfg new file mode 100644 index 000000000000..dc675622c78b --- /dev/null +++ b/games-action/teeworlds/files/teeworlds_srv.cfg @@ -0,0 +1,7 @@ +# sample Teeworlds server config file +# see http://www.teeworlds.com/?page=docs&wiki=ServerSettings for details +sv_gametype dm +sv_map dm1 +sv_name gentoo-teeworlds +sv_register 1 +sv_scorelimit 20 \ No newline at end of file diff --git a/games-action/teeworlds/teeworlds-0.6.1.ebuild b/games-action/teeworlds/teeworlds-0.6.1.ebuild new file mode 100644 index 000000000000..985a5b92eab0 --- /dev/null +++ b/games-action/teeworlds/teeworlds-0.6.1.ebuild @@ -0,0 +1,100 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/games-action/teeworlds/teeworlds-0.6.1.ebuild,v 1.1 2012/03/27 15:16:11 tupone Exp $ + +EAPI=3 + +PYTHON_DEPEND="2" + +inherit eutils python games + +REVISION="b177-r50edfd37" + +DESCRIPTION="Online multi-player platform 2D shooter" +HOMEPAGE="http://www.teeworlds.com/" +SRC_URI="http://www.teeworlds.com/files/${P}-source.tar.gz" + +LICENSE="ZLIB" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="debug dedicated" + +RDEPEND=" + !dedicated? ( media-libs/pnglite + media-libs/libsdl[X,audio,opengl,video] + media-sound/wavpack + virtual/opengl + app-arch/bzip2 + media-libs/freetype + virtual/glu + x11-libs/libX11 ) + sys-libs/zlib" +DEPEND="${RDEPEND} + ~dev-util/bam-0.4.0" + +S=${WORKDIR}/${PN}-${REVISION}-source + +pkg_setup() { + python_set_active_version 2 + games_pkg_setup +} + +src_prepare() { + # 01 & 02 from pull request: https://github.com/oy/teeworlds/pull/493 + EPATCH_SOURCE="${FILESDIR}/${PV}" EPATCH_SUFFIX="patch" EPATCH_FORCE="yes" \ + epatch +} + +src_configure() { + bam config || die "bam config failed" +} + +src_compile() { + local myopt + + if use debug; then + myopt=" server_debug" + else + myopt=" server_release" + fi + if ! use dedicated; then + if use debug; then + myopt+=" client_debug" + else + myopt+=" client_release" + fi + fi + + bam ${myopt} || die "bam failed" +} + +src_install() { + if use debug; then + newgamesbin ${PN}_srv_d ${PN}_srv || die "newgamesbin failed" + else + dogamesbin ${PN}_srv || die "dogamesbin failed" + fi + if ! use dedicated; then + if use debug; then + newgamesbin ${PN}_d ${PN} || die "newgamesbin failed" + else + dogamesbin ${PN} || die "dogamesbin failed" + fi + + doicon "${FILESDIR}"/${PN}.xpm || die "doicon failed" + make_desktop_entry ${PN} Teeworlds + + insinto "${GAMES_DATADIR}"/${PN}/data + doins -r data/* || die "doins failed" + else + insinto "${GAMES_DATADIR}"/${PN}/data/maps + doins -r data/maps/* || die "doins failed" + fi + newinitd "${FILESDIR}"/${PN}-init.d ${PN} + insinto "/etc/${PN}" + doins "${FILESDIR}"/teeworlds_srv.cfg + + dodoc readme.txt || die "dodoc failed" + + prepgamesdirs +} -- cgit v1.2.3-65-gdbad