diff options
author | Mounir Lamouri <volkmar@gentoo.org> | 2010-03-26 15:56:40 +0000 |
---|---|---|
committer | Mounir Lamouri <volkmar@gentoo.org> | 2010-03-26 15:56:40 +0000 |
commit | 274b5970d3b1ce977d88fdb10445d141f6313900 (patch) | |
tree | fbc91aa94ae356c56371ee57635455d13194e621 /games-action/teeworlds | |
parent | Unbundle zlib. Bug #310849 (diff) | |
download | gentoo-2-274b5970d3b1ce977d88fdb10445d141f6313900.tar.gz gentoo-2-274b5970d3b1ce977d88fdb10445d141f6313900.tar.bz2 gentoo-2-274b5970d3b1ce977d88fdb10445d141f6313900.zip |
Moving from games-arcade to games-action.
(Portage version: 15511-svn/cvs/Linux i686)
Diffstat (limited to 'games-action/teeworlds')
-rw-r--r-- | games-action/teeworlds/ChangeLog | 16 | ||||
-rw-r--r-- | games-action/teeworlds/files/teeworlds-0.5.2-system-libs.patch | 53 | ||||
-rw-r--r-- | games-action/teeworlds/files/teeworlds-0.5.2-wavpack.patch | 49 | ||||
-rw-r--r-- | games-action/teeworlds/files/teeworlds.xpm | 66 | ||||
-rw-r--r-- | games-action/teeworlds/metadata.xml | 13 | ||||
-rw-r--r-- | games-action/teeworlds/teeworlds-0.5.2.ebuild | 108 |
6 files changed, 305 insertions, 0 deletions
diff --git a/games-action/teeworlds/ChangeLog b/games-action/teeworlds/ChangeLog new file mode 100644 index 000000000000..c699f1bb6672 --- /dev/null +++ b/games-action/teeworlds/ChangeLog @@ -0,0 +1,16 @@ +# ChangeLog for games-action/teeworlds +# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/games-action/teeworlds/ChangeLog,v 1.1 2010/03/26 15:56:40 volkmar Exp $ + + 26 Mar 2010; Mounir Lamouri <volkmar@gentoo.org> +teeworlds-0.5.2.ebuild, + +files/teeworlds-0.5.2-system-libs.patch, + +files/teeworlds-0.5.2-wavpack.patch, +files/teeworlds.xpm, +metadata.xml: + Moving teeworlds from games-arcade to games-action. + +*teeworlds-0.5.2 (25 Mar 2010) + + 25 Mar 2010; Mounir Lamouri <volkmar@gentoo.org> +teeworlds-0.5.2.ebuild, + +files/teeworlds-0.5.2-system-libs.patch, + +files/teeworlds-0.5.2-wavpack.patch, +files/teeworlds.xpm, +metadata.xml: + Initial commit. Fix bug 206287 + diff --git a/games-action/teeworlds/files/teeworlds-0.5.2-system-libs.patch b/games-action/teeworlds/files/teeworlds-0.5.2-system-libs.patch new file mode 100644 index 000000000000..2ffb3d566054 --- /dev/null +++ b/games-action/teeworlds/files/teeworlds-0.5.2-system-libs.patch @@ -0,0 +1,53 @@ +--- default.bam.orig 2010-03-24 22:16:59.000000000 +0100 ++++ default.bam 2010-03-24 22:17:32.000000000 +0100 +@@ -7,6 +7,8 @@ + config:Add(OptFindCompiler()) + config:Add(OptTestCompileC("stackprotector", "int main(){return 0;}", "-fstack-protector -fstack-protector-all")) + config:Add(OptFindLibrary("zlib", "zlib.h", false)) ++config:Add(OptFindLibrary("pnglite", "pnglite.h", false)) ++config:Add(OptFindLibrary("wavpack", "wavpack/wavpack.h", false)) + config:Add(SDL.OptFind("sdl", true)) + config:Finalize("config.bam") + +@@ -150,9 +152,6 @@ + settings.cc.includes:Add("src/engine/external/zlib") + 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 + engine_settings = settings:Copy() +@@ -160,6 +159,31 @@ + client_settings = engine_settings:Copy() + launcher_settings = engine_settings:Copy() + ++ -- compile pnglite if needed ++ if config.pnglite.value == 1 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 ++ ++ -- compile wavpack if needed ++ if config.wavpack.value == 1 then ++ client_settings.link.libs:Add("wavpack") ++ if config.wavpack.include_path then ++ client_settings.cc.includes:Add(config.wavpack.include_path) ++ end ++ wavpack = {} ++ else ++ wavpack = Compile(settings, Collect("src/engine/external/wavpack/*.c")) ++ client_settings.cc.includes:Add("src/engine/external") ++ end ++ ++ + if family == "unix" then + if platform == "macosx" then + client_settings.link.frameworks:Add("OpenGL") diff --git a/games-action/teeworlds/files/teeworlds-0.5.2-wavpack.patch b/games-action/teeworlds/files/teeworlds-0.5.2-wavpack.patch new file mode 100644 index 000000000000..4cb1e5b7174f --- /dev/null +++ b/games-action/teeworlds/files/teeworlds-0.5.2-wavpack.patch @@ -0,0 +1,49 @@ +diff --git a/src/engine/client/ec_snd.c b/src/engine/client/ec_snd.c +index 034dfb2..67e819c 100644 +--- a/src/engine/client/ec_snd.c ++++ b/src/engine/client/ec_snd.c +@@ -359,13 +359,6 @@ static void rate_convert(int sid) + } + + +-static IOHANDLE file = NULL; +- +-static int read_data(void *buffer, int size) +-{ +- return io_read(file, buffer, size); +-} +- + int snd_load_wv(const char *filename) + { + SAMPLE *snd; +@@ -381,19 +374,12 @@ int snd_load_wv(const char *filename) + if(!sound_enabled) + return 1; + +- file = engine_openfile(filename, IOFLAG_READ); /* TODO: use system.h stuff for this */ +- if(!file) +- { +- dbg_msg("sound/wv", "failed to open %s", filename); +- return -1; +- } +- + sid = snd_alloc_id(); + if(sid < 0) + return -1; + snd = &samples[sid]; + +- context = WavpackOpenFileInput(read_data, error); ++ context = WavpackOpenFileInput(filename, error, OPEN_2CH_MAX, 0); + if (context) + { + int samples = WavpackGetNumSamples(context); +@@ -448,9 +434,6 @@ int snd_load_wv(const char *filename) + dbg_msg("sound/wv", "failed to open %s: %s", filename, error); + } + +- io_close(file); +- file = NULL; +- + if(config.debug) + dbg_msg("sound/wv", "loaded %s", filename); + 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/metadata.xml b/games-action/teeworlds/metadata.xml new file mode 100644 index 000000000000..52f6d5ef544d --- /dev/null +++ b/games-action/teeworlds/metadata.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <herd>games</herd> + <maintainer> + <email>volkmar@gentoo.org</email> + <name>Mounir Lamouri</name> + </maintainer> + <use> + <flag name="server">Enable compilation of server</flag> + </use> +</pkgmetadata> + diff --git a/games-action/teeworlds/teeworlds-0.5.2.ebuild b/games-action/teeworlds/teeworlds-0.5.2.ebuild new file mode 100644 index 000000000000..ce4849eb4619 --- /dev/null +++ b/games-action/teeworlds/teeworlds-0.5.2.ebuild @@ -0,0 +1,108 @@ +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/games-action/teeworlds/teeworlds-0.5.2.ebuild,v 1.1 2010/03/26 15:56:40 volkmar Exp $ + +EAPI=2 + +inherit eutils python games + +DESCRIPTION="Online multi-player platform 2D shooter" +HOMEPAGE="http://www.teeworlds.com/" +SRC_URI="http://www.teeworlds.com/files/${P}-src.tar.gz" + +LICENSE="ZLIB" +SLOT="0" +KEYWORDS="~x86" +IUSE="debug dedicated server" + +RDEPEND=" + !dedicated? ( media-libs/pnglite + media-libs/libsdl[X,audio,opengl,video] + media-sound/wavpack + virtual/opengl + x11-libs/libX11 ) + sys-libs/zlib" +DEPEND="${RDEPEND} + =dev-lang/python-2* + <=dev-util/bam-0.2.0" + +S=${WORKDIR}/${P}-src + +pkg_setup() { + python_set_active_version 2 + games_pkg_setup +} + +src_prepare() { + epatch \ + "${FILESDIR}"/${P}-system-libs.patch \ + "${FILESDIR}"/${P}-wavpack.patch + + # fix includes + sed -i -e "s:.engine/external/pnglite/pnglite.h.:<pnglite.h>:" \ + src/engine/client/ec_gfx.c src/tools/dilate.c \ + src/tools/tileset_borderfix.c \ + || die "sed failed" + sed -i -e "s:.engine/external/wavpack/wavpack.h.:<wavpack/wavpack.h>:" \ + src/engine/client/ec_snd.c || die "sed failed" + + # use ${GAMES_DATADIR} instead of ./data + sed -i -e \ + "s:^\(#define DATA_DIR\) \"data\":\1 \"${GAMES_DATADIR}/${PN}\":" \ + src/engine/e_engine.c || die "sed failed" +} + +src_configure() { + bam config || die "bam config failed" +} + +src_compile() { + local myopt + + if use dedicated || use server; then + if use debug; then + myopt=" server_debug" + else + myopt=" server_release" + fi + 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 dedicated || use server; then + if use debug; then + newgamesbin ${PN}_srv_d ${PN}_srv || die "newgamesbin failed" + else + dogamesbin ${PN}_srv || die "dogamesbin failed" + fi + 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} + doins -r data/* || die "doins failed" + else + insinto "${GAMES_DATADIR}"/${PN}/maps + doins -r data/maps/* || die "doins failed" + fi + + dodoc readme.txt || die "dodoc failed" + + prepgamesdirs +} |