diff options
author | Julian Ospald <hasufell@gentoo.org> | 2013-09-05 18:37:31 +0000 |
---|---|---|
committer | Julian Ospald <hasufell@gentoo.org> | 2013-09-05 18:37:31 +0000 |
commit | bc66692cf8f6bbef16ddc21fe6decab28a9f014e (patch) | |
tree | 49ae45c5856dc32cfd6789bdd00dfe7f9251ca4d /games-action/teeworlds | |
parent | Clean up PYTHON_COMPAT from old implementations. (diff) | |
download | gentoo-2-bc66692cf8f6bbef16ddc21fe6decab28a9f014e.tar.gz gentoo-2-bc66692cf8f6bbef16ddc21fe6decab28a9f014e.tar.bz2 gentoo-2-bc66692cf8f6bbef16ddc21fe6decab28a9f014e.zip |
version bump wrt #477670
(Portage version: 2.2.1/cvs/Linux x86_64, signed Manifest commit with key E73C35B3)
Diffstat (limited to 'games-action/teeworlds')
-rw-r--r-- | games-action/teeworlds/ChangeLog | 12 | ||||
-rw-r--r-- | games-action/teeworlds/files/0.6.2/01-use-system-wavpack.patch | 101 | ||||
-rw-r--r-- | games-action/teeworlds/files/0.6.2/02-fixed-wavpack-sound-loading.patch | 109 | ||||
-rw-r--r-- | games-action/teeworlds/files/0.6.2/03-use-system-pnglite.patch | 160 | ||||
-rw-r--r-- | games-action/teeworlds/teeworlds-0.6.2.ebuild | 118 |
5 files changed, 498 insertions, 2 deletions
diff --git a/games-action/teeworlds/ChangeLog b/games-action/teeworlds/ChangeLog index bd7b7ded0eb6..fd5acf371eb5 100644 --- a/games-action/teeworlds/ChangeLog +++ b/games-action/teeworlds/ChangeLog @@ -1,6 +1,14 @@ # 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.10 2012/12/16 14:56:14 pacho Exp $ +# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/games-action/teeworlds/ChangeLog,v 1.11 2013/09/05 18:37:31 hasufell Exp $ + +*teeworlds-0.6.2 (05 Sep 2013) + + 05 Sep 2013; Julian Ospald <hasufell@gentoo.org> + +files/0.6.2/01-use-system-wavpack.patch, + +files/0.6.2/02-fixed-wavpack-sound-loading.patch, + +files/0.6.2/03-use-system-pnglite.patch, +teeworlds-0.6.2.ebuild: + version bump wrt #477670 16 Dec 2012; Pacho Ramos <pacho@gentoo.org> metadata.xml: Cleanup due retirement, #260683 diff --git a/games-action/teeworlds/files/0.6.2/01-use-system-wavpack.patch b/games-action/teeworlds/files/0.6.2/01-use-system-wavpack.patch new file mode 100644 index 000000000000..4a11a866511d --- /dev/null +++ b/games-action/teeworlds/files/0.6.2/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.2/02-fixed-wavpack-sound-loading.patch b/games-action/teeworlds/files/0.6.2/02-fixed-wavpack-sound-loading.patch new file mode 100644 index 000000000000..e207a4a354bf --- /dev/null +++ b/games-action/teeworlds/files/0.6.2/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.2/03-use-system-pnglite.patch b/games-action/teeworlds/files/0.6.2/03-use-system-pnglite.patch new file mode 100644 index 000000000000..81c3d915316b --- /dev/null +++ b/games-action/teeworlds/files/0.6.2/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/teeworlds-0.6.2.ebuild b/games-action/teeworlds/teeworlds-0.6.2.ebuild new file mode 100644 index 000000000000..cf415f1b7768 --- /dev/null +++ b/games-action/teeworlds/teeworlds-0.6.2.ebuild @@ -0,0 +1,118 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/games-action/teeworlds/teeworlds-0.6.2.ebuild,v 1.1 2013/09/05 18:37:31 hasufell Exp $ + +EAPI=5 +PYTHON_COMPAT=( python2_7 ) +inherit eutils multiprocessing python-any-r1 toolchain-funcs 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} + ${PYTHON_DEPS} + ~dev-util/bam-0.4.0" + +S=${WORKDIR}/${P}-source + +pkg_setup() { + python-any-r1_pkg_setup + games_pkg_setup +} + +src_prepare() { + rm -r src/engine/external/* || die + + # 01 & 02 from pull request: https://github.com/oy/teeworlds/pull/493 + EPATCH_SOURCE="${FILESDIR}/${PV}" EPATCH_SUFFIX="patch" EPATCH_FORCE="yes" \ + epatch + + 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__ + + sed -i \ + -e '/^function build(settings)/a dofile("gentoo.lua") addSettings(settings)' \ + bam.lua || die +} + +src_configure() { + bam 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 -a -j $(makeopts_jobs) ${myopt} || die +} + +src_install() { + if use debug; then + newgamesbin ${PN}_srv_d ${PN}_srv + else + dogamesbin ${PN}_srv + fi + if ! use dedicated; then + if use debug; then + newgamesbin ${PN}_d ${PN} + else + dogamesbin ${PN} + fi + + doicon "${FILESDIR}"/${PN}.xpm + make_desktop_entry ${PN} Teeworlds + + insinto "${GAMES_DATADIR}"/${PN}/data + doins -r data/* + else + insinto "${GAMES_DATADIR}"/${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 + + prepgamesdirs +} |