summaryrefslogtreecommitdiff
path: root/games-action/teeworlds
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
committerV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
commit8376ef56580626e9c0f796d5b85b53a0a1c7d5f5 (patch)
tree7681bbd4e8b05407772df40a4bf04cbbc8afc3fa /games-action/teeworlds
parent30a9caf154332f12ca60756e1b75d2f0e3e1822d (diff)
gentoo resync : 14.07.2018
Diffstat (limited to 'games-action/teeworlds')
-rw-r--r--games-action/teeworlds/Manifest11
-rw-r--r--games-action/teeworlds/files/0.6/01-use-system-wavpack.patch101
-rw-r--r--games-action/teeworlds/files/0.6/02-fixed-wavpack-sound-loading.patch109
-rw-r--r--games-action/teeworlds/files/0.6/03-use-system-pnglite.patch160
-rw-r--r--games-action/teeworlds/files/0.6/04-dedicated.patch15
-rw-r--r--games-action/teeworlds/files/0.6/05-cc-cflags.patch18
-rw-r--r--games-action/teeworlds/files/teeworlds-init.d40
-rw-r--r--games-action/teeworlds/files/teeworlds.xpm66
-rw-r--r--games-action/teeworlds/files/teeworlds_srv.cfg7
-rw-r--r--games-action/teeworlds/metadata.xml8
-rw-r--r--games-action/teeworlds/teeworlds-0.6.4.ebuild118
11 files changed, 653 insertions, 0 deletions
diff --git a/games-action/teeworlds/Manifest b/games-action/teeworlds/Manifest
new file mode 100644
index 000000000000..60fff8a5150f
--- /dev/null
+++ b/games-action/teeworlds/Manifest
@@ -0,0 +1,11 @@
+AUX 0.6/01-use-system-wavpack.patch 3182 BLAKE2B 814d3876e2657d636b2c9ae59fccfaab45e05918becde06aeba7154bb9a124d51cd6be20381355e73662d227e1d0985d35360ccf6308d1776ebcf3aca35025c0 SHA512 2210a018c3917b78109e31b3fa51a292c5c3714371880d2b9ce10de4cde999f014ff44555fa657fed78d961dbada2511601b3aa8e9356eb34de187f24b16dbad
+AUX 0.6/02-fixed-wavpack-sound-loading.patch 2916 BLAKE2B a2990c8feb143391c317d7b8ba3ef972bcbd8275f5ddec05a150fcefcdd4afd3fb0c3621bfac900b024fbbf85108f9ed7ee0b42ed38044b3e8f6b2142a3963f5 SHA512 9cada7356b588a220dba4a0c104a28738969c7755c80f9e9f10c4bf1f57ae1b6ea64c084aa012410de135fed0267e0e7ab8375137f2f16aba2d81c0441de2e8a
+AUX 0.6/03-use-system-pnglite.patch 5703 BLAKE2B 298668b9f592fbd9c5a6fbb0b1d12f5c13d3433dbb44018c987b1eb4f52b0bf2b4ad5cb0495f28870bf101ca9c5fc0464f85d53d62c2e80c03463ba8071173c2 SHA512 c069fc15de002b9e3f01bf9a36e40396aa62158bec1bb70a2dae6fbbace07299c298854319f80141d26e34b49dd270b9478383c55eb4b7e8873aedd323eb412b
+AUX 0.6/04-dedicated.patch 491 BLAKE2B 26504d5668b94b0e2010b02805f51f608414087e5df8a67d56ad5a5e41d47848fd1e6916137a2a6c12b328020c7592faa404d4c40f933622aef1dc0189faafae SHA512 c292b638e58e69fcf6b273617fc43cc4c8d96ffe4c75ad7911c1b319a129de6c01255f988569a0532b8e6c29f775ececc679274f7f85c6a9933bf713620ab8fb
+AUX 0.6/05-cc-cflags.patch 482 BLAKE2B 03059f30af2e1bc74c141ea0b8a1d0f53d324e29a3e0b1f89c96302abc63710ae35740c430ab234b6a8119d76ef71c753a703c9ee350fe788333294117472fd1 SHA512 92b74845413c20cf4626cb89b8b825bc5cb2f25e9af1d61d2ecabbda3acf024ee0c5e03abf8de2b57d6a8c739a8cf343fcb109a3a72d4baa016711e53368d0f8
+AUX teeworlds-init.d 1000 BLAKE2B 7681574d8e35583ea029b604925fa0ed3af50dafb17993e7315b2c9ff6bb83ecbe788e9745851d7763fd74018ef5ec222ba5b4a65c3b57ed0be2c7ae5b3e8b5a SHA512 01d39e8a0b5991000d336a4d51f8b61e296c0c9fce7b4247d24007b119c9c7a863e284e670b6286923a1e22fd25c4a171d20846feacea34bcc0c4d33120e98bd
+AUX teeworlds.xpm 2785 BLAKE2B 288e6fe273e38d802c102403f5e70d0a2c004bba28c3c1744f0a5f3d77168cc76dccf8039b9eca761d159cf7c1d127755171cc313ef3d614a195d9858426700a SHA512 f8a8a1c3a5675f12b13ddaf9b68bc2757698725d406356c871d58e62f735413b5f4f0bcb3dbf783e0aa6b3ecb0ec7f9eddbcef044506a6a07a374fe46d2616c0
+AUX teeworlds_srv.cfg 193 BLAKE2B dbbad582189f5b098e9f199dc59227ef90485e7a1bc406372d69f9985ee5a7fe39db68c52d8eb394a1c6e1320496925fa8c5474dd91204bf6e93787c2c0ba838 SHA512 d9a55f749f6974caddf96438eb38e490e0e507fbe07ebdac070fe91ab46eed93afb5dd6300a5b7a86b6282c6b97fdd178a00720483c3e71490be816b8c6a73b5
+DIST teeworlds-0.6.4-src.tar.gz 8771622 BLAKE2B 14493fcad458b0e1c749e40bdd6a5a858704bf971d53d11782d52fbe9b5fe2a09235dcac25340e51a3330001d46ee512f2971e8db06eb9f51eec5e6b3cd2a328 SHA512 7546ee358a2126339f6c727bb7b5f49009a8fad0b5e77a796202cba4d8fc5dfcaf79b7e65151d85fead2a70ad61ef3e1888b8c07fe0206f87575d5dd8c9f91ce
+EBUILD teeworlds-0.6.4.ebuild 2391 BLAKE2B 83f8fe3b44e3bc40d93dadbe98aa38fb36e38963dd20394673d197f194ed23a8e6f7c7edc914c1f37ee48d339f7195530e608335aef639d850c64d61261c718a SHA512 214e0c0a4210ab302d48db14424d24c6444d3df6a1dda576ab084d8017a3898fcb6558da320717ca0a679e4e586638f83dfb3710da24dc30d5cfbe69b83cdbb3
+MISC metadata.xml 253 BLAKE2B 443ca9c8d4f6801169382e87a0ecd1385c56e65229209e7200f9d313ef380e92ae8d7dc3c38e5989a4166289f22607a20b1e13bb960fff6b3d9f78629d8ab020 SHA512 61c4689cbc649d84a00be211b7b5b98dd03e1d3f813eff370df549f2998cd4343f391c18b57cf20e4a8f4dd2311e3bfa04eb60f356f2bbac78f0b68f5091f254
diff --git a/games-action/teeworlds/files/0.6/01-use-system-wavpack.patch b/games-action/teeworlds/files/0.6/01-use-system-wavpack.patch
new file mode 100644
index 000000000000..4a11a866511d
--- /dev/null
+++ b/games-action/teeworlds/files/0.6/01-use-system-wavpack.patch
@@ -0,0 +1,101 @@
+commit 7202b142891ee10771af9f1f3063664d75a38bbc
+Author: hasufell <hasufell@gentoo.org>
+Date: Thu Sep 5 12:28:30 2013 +0200
+
+ Use system wavpack. Based on patch from Gentoo Bugzilla
+
+ From: Azamat H. Hackimov <azamat.hackimov@gmail.com>
+
+ https://bugs.gentoo.org/show_bug.cgi?id=363395
+
+diff --git a/bam.lua b/bam.lua
+index 11ac7b9..35c1d8d 100644
+--- a/bam.lua
++++ b/bam.lua
+@@ -11,6 +11,7 @@ config:Add(OptTestCompileC("stackprotector", "int main(){return 0;}", "-fstack-p
+ config:Add(OptTestCompileC("minmacosxsdk", "int main(){return 0;}", "-mmacosx-version-min=10.5 -isysroot /Developer/SDKs/MacOSX10.5.sdk"))
+ config:Add(OptTestCompileC("macosxppc", "int main(){return 0;}", "-arch ppc"))
+ 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")
+@@ -187,7 +188,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)
+@@ -198,8 +199,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 343fa2e..e32cac9 100644
+--- a/src/engine/client/sound.cpp
++++ b/src/engine/client/sound.cpp
+@@ -13,7 +13,7 @@
+ #include "sound.h"
+
+ extern "C" { // wavpack
+- #include <engine/external/wavpack/wavpack.h>
++ #include <wavpack/wavpack.h>
+ }
+ #include <math.h>
+
+@@ -351,19 +351,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);
+@@ -419,8 +425,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/02-fixed-wavpack-sound-loading.patch b/games-action/teeworlds/files/0.6/02-fixed-wavpack-sound-loading.patch
new file mode 100644
index 000000000000..e207a4a354bf
--- /dev/null
+++ b/games-action/teeworlds/files/0.6/02-fixed-wavpack-sound-loading.patch
@@ -0,0 +1,109 @@
+commit b96981f5f23b4269108afb465f29a23abbd32ae2
+Author: hasufell <hasufell@gentoo.org>
+Date: Thu Sep 5 12:31:19 2013 +0200
+
+ Fixing wavpack sound loading. Based on Gentoo Bugzilla
+
+ From: Azamat H. Hackimov <azamat.hackimov@gmail.com>
+
+ https://bugs.gentoo.org/show_bug.cgi?id=363395
+
+diff --git a/src/engine/client/sound.cpp b/src/engine/client/sound.cpp
+index e32cac9..2a4c653 100644
+--- a/src/engine/client/sound.cpp
++++ b/src/engine/client/sound.cpp
+@@ -51,6 +51,55 @@ 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} };
+@@ -351,14 +400,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)
+@@ -368,7 +415,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)
+ {
+@@ -422,13 +469,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/03-use-system-pnglite.patch b/games-action/teeworlds/files/0.6/03-use-system-pnglite.patch
new file mode 100644
index 000000000000..81c3d915316b
--- /dev/null
+++ b/games-action/teeworlds/files/0.6/03-use-system-pnglite.patch
@@ -0,0 +1,160 @@
+commit 291a375000ac8d9cd5548a863ea6b49c46cfb1bb
+Author: hasufell <hasufell@gentoo.org>
+Date: Thu Sep 5 12:36:53 2013 +0200
+
+ Use system pnglite. Based on Gentoo Bugzilla
+
+ From: Azamat H. Hackimov <azamat.hackimov@gmail.com>
+
+ https://bugs.gentoo.org/show_bug.cgi?id=363395
+
+diff --git a/bam.lua b/bam.lua
+index 35c1d8d..7902a2c 100644
+--- a/bam.lua
++++ b/bam.lua
+@@ -11,6 +11,7 @@ config:Add(OptTestCompileC("stackprotector", "int main(){return 0;}", "-fstack-p
+ config:Add(OptTestCompileC("minmacosxsdk", "int main(){return 0;}", "-mmacosx-version-min=10.5 -isysroot /Developer/SDKs/MacOSX10.5.sdk"))
+ config:Add(OptTestCompileC("macosxppc", "int main(){return 0;}", "-arch ppc"))
+ 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))
+@@ -199,26 +200,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 2e8a855..97e4fd7 100644
+--- a/src/engine/client/graphics.cpp
++++ b/src/engine/client/graphics.cpp
+@@ -9,7 +9,7 @@
+ #include "SDL_opengl.h"
+
+ #include <base/system.h>
+-#include <engine/external/pnglite/pnglite.h>
++#include <pnglite.h>
+
+ #include <engine/shared/config.h>
+ #include <engine/graphics.h>
+diff --git a/src/engine/client/graphics_threaded.cpp b/src/engine/client/graphics_threaded.cpp
+index e34b725..60246d1 100644
+--- a/src/engine/client/graphics_threaded.cpp
++++ b/src/engine/client/graphics_threaded.cpp
+@@ -6,7 +6,7 @@
+ #include <base/tl/threading.h>
+
+ #include <base/system.h>
+-#include <engine/external/pnglite/pnglite.h>
++#include <pnglite.h>
+
+ #include <engine/shared/config.h>
+ #include <engine/graphics.h>
+diff --git a/src/tools/dilate.cpp b/src/tools/dilate.cpp
+index 55094a5..42a5b83 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 <base/system.h>
+ #include <base/math.h>
+-#include <engine/external/pnglite/pnglite.h>
++#include <pnglite.h>
+
+ typedef struct
+ {
+diff --git a/src/tools/tileset_borderadd.cpp b/src/tools/tileset_borderadd.cpp
+index 25e2fa5..88f760a 100644
+--- a/src/tools/tileset_borderadd.cpp
++++ b/src/tools/tileset_borderadd.cpp
+@@ -2,7 +2,7 @@
+ /* If you are missing that file, acquire a complete release at teeworlds.com. */
+ #include <base/math.h>
+ #include <base/system.h>
+-#include <engine/external/pnglite/pnglite.h>
++#include <pnglite.h>
+
+ 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 <base/system.h>
+-#include <engine/external/pnglite/pnglite.h>
++#include <pnglite.h>
+
+ typedef struct
+ {
+diff --git a/src/tools/tileset_borderrem.cpp b/src/tools/tileset_borderrem.cpp
+index d604ecb..8673e41 100644
+--- a/src/tools/tileset_borderrem.cpp
++++ b/src/tools/tileset_borderrem.cpp
+@@ -2,7 +2,7 @@
+ /* If you are missing that file, acquire a complete release at teeworlds.com. */
+ #include <base/math.h>
+ #include <base/system.h>
+-#include <engine/external/pnglite/pnglite.h>
++#include <pnglite.h>
+
+ typedef struct
+ {
+diff --git a/src/tools/tileset_borderset.cpp b/src/tools/tileset_borderset.cpp
+index 8b3e299..c762ee2 100644
+--- a/src/tools/tileset_borderset.cpp
++++ b/src/tools/tileset_borderset.cpp
+@@ -2,7 +2,7 @@
+ /* If you are missing that file, acquire a complete release at teeworlds.com. */
+ #include <base/math.h>
+ #include <base/system.h>
+-#include <engine/external/pnglite/pnglite.h>
++#include <pnglite.h>
+
+ typedef struct
+ {
diff --git a/games-action/teeworlds/files/0.6/04-dedicated.patch b/games-action/teeworlds/files/0.6/04-dedicated.patch
new file mode 100644
index 000000000000..fc61b71283b6
--- /dev/null
+++ b/games-action/teeworlds/files/0.6/04-dedicated.patch
@@ -0,0 +1,15 @@
+From: Julian Ospald <hasufell@gentoo.org>
+Date: Sun Sep 8 11:05:26 UTC 2013
+Subject: fix DATADIR detection for minimal setups
+
+--- a/src/engine/shared/storage.cpp
++++ b/src/engine/shared/storage.cpp
+@@ -208,7 +208,7 @@
+ for (i = 0; i < DirsCount; i++)
+ {
+ char aBuf[128];
+- str_format(aBuf, sizeof(aBuf), "%s/mapres", aDirs[i]);
++ str_format(aBuf, sizeof(aBuf), "%s/maps", aDirs[i]);
+ if(fs_is_dir(aBuf))
+ {
+ str_copy(m_aDatadir, aDirs[i], sizeof(m_aDatadir));
diff --git a/games-action/teeworlds/files/0.6/05-cc-cflags.patch b/games-action/teeworlds/files/0.6/05-cc-cflags.patch
new file mode 100644
index 000000000000..dec6b8d306fc
--- /dev/null
+++ b/games-action/teeworlds/files/0.6/05-cc-cflags.patch
@@ -0,0 +1,18 @@
+From: Julian Ospald <hasufell@gentoo.org>
+Date: Sun Sep 8 12:25:19 UTC 2013
+Subject: respect our gentoo settings
+
+ this has to be at this place or later
+ otherwise some of our settings would be overwritten
+
+--- a/bam.lua
++++ b/bam.lua
+@@ -168,6 +168,8 @@
+ -- set some platform specific settings
+ settings.cc.includes:Add("src")
+
++ dofile("gentoo.lua") addSettings(settings)
++
+ if family == "unix" then
+ if platform == "macosx" then
+ settings.link.frameworks:Add("Carbon")
diff --git a/games-action/teeworlds/files/teeworlds-init.d b/games-action/teeworlds/files/teeworlds-init.d
new file mode 100644
index 000000000000..fa1a95831ff5
--- /dev/null
+++ b/games-action/teeworlds/files/teeworlds-init.d
@@ -0,0 +1,40 @@
+#!/sbin/openrc-run
+# 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.xpm b/games-action/teeworlds/files/teeworlds.xpm
new file mode 100644
index 000000000000..76e30166dd35
--- /dev/null
+++ b/games-action/teeworlds/files/teeworlds.xpm
@@ -0,0 +1,66 @@
+/* XPM */
+static char *teeworlds__[] = {
+/* columns rows colors chars-per-pixel */
+"48 48 12 1",
+" c #000000",
+". c #800000",
+"X c #FF0000",
+"o c #008000",
+"O c #808000",
+"+ c #FFFF00",
+"@ c #000080",
+"# c #800080",
+"$ c #008080",
+"% c #808080",
+"& c #C0C0C0",
+"* c None",
+/* pixels */
+"*********************%%.%%%*********************",
+"*****************% %*****************",
+"*************** .%O%OOO. ***************",
+"************* ..%+&++++++++&O @*************",
+"***********% O&&++++++++++++++% ************",
+"**********O .+&&+++++++++++++++++O %**********",
+"*********@ O&&&+++++++++++++++++++% %*********",
+"******** .O&+++++++++++++++++++++++% %********",
+"*******% O+&++++++++++++++++++++++++% ********",
+"******* O+&&+++++++++++++++++++++++++% *******",
+"****** O+X&+++++++++++++++++++++++++++O .******",
+"*****% .OX++++++++++++++++++++++++++++++ ******",
+"***** .++++++++++++ +++++O@ ++++++++++ *****",
+"****% ++X+++++++++ +++O . +++++++++ *****",
+"**** O+X++++++++++ +++ +++++++++O %****",
+"**** X++X+++++++++ +++ ++++++++++ ****",
+"**** ++X+&++++++++ +++ ++++++++++ ****",
+"***% .+X+O+++++++++ +++ ++++++++++O ****",
+"***% O++X+&++++++++ +++ ++++++++++% %***",
+"*** O+X+++++++++++ +++O ++++++++++O %***",
+"*** OX+X+X+++++++++ +++++ +++++++++++& .***",
+"*** ++++X+&++++++++++++++++++++++++++++++O $***",
+"*** OX+X++%++++++++++++++++++++++++++++++% .***",
+"*** O+O++X+++++++++++++++++++++++++++++++% %***",
+"*** O+X+X+++++++++++++++++++++++++++++++&O %***",
+"***% .+O++X+X+++++++++++++++++++++++++++++ ****",
+"**** +X+X+++%+++++++++++++++++++++++++++& ****",
+"**** O++O+OX+&++++++++++++++++++++++++++% ****",
+"****% .+X+X++++&+++++++++++++++++++++++++. %****",
+"***** O+O+X+OX+&+++++++++++++++++++++++% *****",
+"***** O+X++X+++++++++++++++++++++++++++@ %*****",
+"****** OO+X++X+X++++++++++++++++++++++% ******",
+"******% ++O+X++O+++++++++++++++++++++& %******",
+"******* .O o .O.O+&+++++++++++++++&. %*******",
+"******% O.OOO#o. OO+&+++++++++++&. ********",
+"*****% .O+X&X+X+X%+. OX++&+&+&X+X+ *******",
+"***** .%OX+O+%O+&+X&+O oO+X+X++++O .OO ******",
+"****% .OO+%+&X+&+X+%+X&X .+O++X+O. #%+X+. *****",
+"**** O+X+X+X+%+X&++%+O+% O+X+OO .O+X+&OO. *****",
+"**** OX+%+O%+%+%+&X+&X+XO OO .O%+%+%X+%O $****",
+"**** +OOX+X+X+X+X+%+X+%+. ..O%X+X+X+%+X% .****",
+"**** OX+%+%+%+%+%+%+%+X+. O+%+O+%+%+%+X+O ****",
+"**** OOX+X+X+X+OX+X+X+OO.OX+X+XOX+X+X+OO %****",
+"****% OOOOOOO+XO+OOOOO. OOOOOO+OOOOOO. %****",
+"***** %*****",
+"******* .%*******",
+"***********%%%%%%%%%%%**%%%%%%%%%%%%************",
+"************************************************"
+};
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/metadata.xml b/games-action/teeworlds/metadata.xml
new file mode 100644
index 000000000000..26079e608bed
--- /dev/null
+++ b/games-action/teeworlds/metadata.xml
@@ -0,0 +1,8 @@
+<?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>
+</pkgmetadata>
diff --git a/games-action/teeworlds/teeworlds-0.6.4.ebuild b/games-action/teeworlds/teeworlds-0.6.4.ebuild
new file mode 100644
index 000000000000..e0a278459205
--- /dev/null
+++ b/games-action/teeworlds/teeworlds-0.6.4.ebuild
@@ -0,0 +1,118 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+PYTHON_COMPAT=( python2_7 )
+inherit eutils multiprocessing python-any-r1 toolchain-funcs versionator
+
+REVISION="b177-rff25472"
+
+DESCRIPTION="Online multi-player platform 2D shooter"
+HOMEPAGE="https://www.teeworlds.com/"
+SRC_URI="https://downloads.teeworlds.com/${P}-src.tar.gz"
+
+LICENSE="ZLIB"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug dedicated"
+
+RDEPEND="
+ !dedicated? (
+ app-arch/bzip2
+ media-libs/freetype
+ media-libs/libsdl[X,sound,opengl,video]
+ media-libs/pnglite
+ media-sound/wavpack
+ virtual/glu
+ virtual/opengl
+ x11-libs/libX11 )
+ sys-libs/zlib"
+DEPEND="${RDEPEND}
+ ${PYTHON_DEPS}
+ ~dev-util/bam-0.4.0"
+
+S=${WORKDIR}/${P}-src
+MY_PV=$(get_version_component_range 1-2)
+
+PATCHES=(
+ "${FILESDIR}/${MY_PV}/01-use-system-wavpack.patch"
+ "${FILESDIR}/${MY_PV}/02-fixed-wavpack-sound-loading.patch"
+ "${FILESDIR}/${MY_PV}/03-use-system-pnglite.patch"
+ "${FILESDIR}/${MY_PV}/04-dedicated.patch"
+ "${FILESDIR}/${MY_PV}/05-cc-cflags.patch"
+)
+
+pkg_setup() {
+ python-any-r1_pkg_setup
+}
+
+src_prepare() {
+ default
+
+ rm -r src/engine/external/* || die
+
+ cat <<- __EOF__ > "${S}/gentoo.lua"
+ function addSettings(settings)
+ print("Adding Gentoo settings")
+ settings.optimize = 0
+ settings.cc.exe_c = "$(tc-getCC)"
+ settings.cc.exe_cxx = "$(tc-getCXX)"
+ settings.cc.flags_c:Add("${CFLAGS}")
+ settings.cc.flags_cxx:Add("${CXXFLAGS}")
+ settings.link.exe = "$(tc-getCXX)"
+ settings.link.flags:Add("${LDFLAGS}")
+ end
+ __EOF__
+}
+
+src_configure() {
+ bam -v config || die
+}
+
+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 -v -a -j $(makeopts_jobs) ${myopt} || die
+}
+
+src_install() {
+ if use debug; then
+ newbin ${PN}_srv_d ${PN}_srv
+ else
+ dobin ${PN}_srv
+ fi
+ if ! use dedicated; then
+ if use debug; then
+ newbin ${PN}_d ${PN}
+ else
+ dobin ${PN}
+ fi
+
+ doicon "${FILESDIR}"/${PN}.xpm
+ make_desktop_entry ${PN} Teeworlds
+
+ insinto /usr/share/${PN}/data
+ doins -r data/*
+ else
+ insinto /usr/share/${PN}/data/maps
+ doins -r data/maps/*
+ fi
+ newinitd "${FILESDIR}"/${PN}-init.d ${PN}
+ insinto "/etc/${PN}"
+ doins "${FILESDIR}"/teeworlds_srv.cfg
+
+ dodoc readme.txt
+}