diff options
author | 2009-08-14 20:45:27 +0200 | |
---|---|---|
committer | 2009-08-14 20:45:27 +0200 | |
commit | 91f83a5be63a5b38c7cedb87fbc73bb6b999bb34 (patch) | |
tree | fa0da559d82f9deca12391f11f45598f832b701d /devel | |
parent | [eclass/d-games.eclass] Initial construct of d-games eclass ebuild. (diff) | |
download | gamerlay-91f83a5be63a5b38c7cedb87fbc73bb6b999bb34.tar.gz gamerlay-91f83a5be63a5b38c7cedb87fbc73bb6b999bb34.tar.bz2 gamerlay-91f83a5be63a5b38c7cedb87fbc73bb6b999bb34.zip |
[games-action/teeworlds] Initial import (bug #206287).
Diffstat (limited to 'devel')
-rw-r--r-- | devel/games-action/teeworlds/Manifest | 6 | ||||
-rw-r--r-- | devel/games-action/teeworlds/files/fix_datadir_search.patch | 36 | ||||
-rw-r--r-- | devel/games-action/teeworlds/files/teeworlds_init | 37 | ||||
-rw-r--r-- | devel/games-action/teeworlds/metadata.xml | 9 | ||||
-rw-r--r-- | devel/games-action/teeworlds/teeworlds-0.5.1-r5.ebuild | 100 | ||||
-rw-r--r-- | devel/games-action/teeworlds/teeworlds-0.5.1.ebuild | 100 |
6 files changed, 288 insertions, 0 deletions
diff --git a/devel/games-action/teeworlds/Manifest b/devel/games-action/teeworlds/Manifest new file mode 100644 index 0000000..0227c4c --- /dev/null +++ b/devel/games-action/teeworlds/Manifest @@ -0,0 +1,6 @@ +AUX fix_datadir_search.patch 1011 RMD160 7da0eb9d174b676a69f7ff1a0de660d5c5a2fa94 SHA1 4fb2a4301c8c745e7f73d9b9f976685c3e5914e1 SHA256 f4357c03f4622c56fa5b2a55b9ac790a9cd00a2697cf4de54f1843d96540c381 +AUX teeworlds_init 1001 RMD160 353aa1fa4128cb42fe53d1917c63be715b0f03c8 SHA1 ba5cf8bae903e65bda9cd9629b2d7d478563bf0b SHA256 9a9bbf40766f2a0fd663a6b306dda8c66b9a9b6adc50753dcb6d0c3970298264 +DIST bam-0.2.0.tar.gz 162342 RMD160 00af151d532bb0452d802e782f1f799abf12c4c5 SHA1 99d86db750fe18ea5b25493850122929bd2c674b SHA256 ef6cddc1df47b0d8106265033ef4e55e61decabf2279a2acd7fdf016633c0758 +DIST teeworlds-0.5.1-src.tar.gz 6392475 RMD160 42b01b67b47f010d9bfb33023ec1bf1bf8600a0f SHA1 4266c43c6e6d61fa718addd5a71db4a9810fc8d2 SHA256 ec72e3439ce4d459410f6dcb6d4fa1bb305d0064323dcb36fa2c6764c372fe78 +EBUILD teeworlds-0.5.1.ebuild 2515 RMD160 f9da789415dd7f2db98767687261997894d6c6a3 SHA1 8ff0a5baed69666c86f0cd3f71e1fafde66e2b6f SHA256 61cb8176ed20ecdf168c1e85125f711aa533014168020a08bf745d73623b95c1 +MISC metadata.xml 251 RMD160 6e07b72709726ffabd3a7a57e4865637e1a3155f SHA1 45fcbcf17fe2d53e04e6eb6081baff42550f0565 SHA256 a0e6b73b2f5486e8f8950750609613eaabc6d4847a8274bd27064ccdb93730f3 diff --git a/devel/games-action/teeworlds/files/fix_datadir_search.patch b/devel/games-action/teeworlds/files/fix_datadir_search.patch new file mode 100644 index 0000000..19a4ae1 --- /dev/null +++ b/devel/games-action/teeworlds/files/fix_datadir_search.patch @@ -0,0 +1,36 @@ +diff -r 9582fcee983b -r c1502459a920 src/engine/e_engine.c +--- a/src/engine/e_engine.c Sun Feb 01 20:50:22 2009 +0100 ++++ b/src/engine/e_engine.c Sun Feb 01 21:37:17 2009 +0100 +@@ -539,14 +539,15 @@ + } + + /* 2) use data-dir in PWD if present */ +- if(fs_is_dir("data")) ++ /* test subdir "/mapres" to reject unrelated "data" dir in PWD */ ++ if(fs_is_dir("data/mapres")) + { + strcpy(datadir, "data"); + return 0; + } + + /* 3) use compiled-in data-dir if present */ +- if (fs_is_dir(DATA_DIR)) ++ if (fs_is_dir(DATA_DIR "/mapres")) + { + strcpy(datadir, DATA_DIR); + return 0; +@@ -572,9 +573,11 @@ + /* 5) check for all default locations */ + { + const char *sdirs[] = { +- "/usr/share/teeworlds", +- "/usr/local/share/teeworlds" +- "/opt/teeworlds" ++ "/usr/share/teeworlds/data", ++ "/usr/share/games/teeworlds/data", ++ "/usr/local/share/teeworlds/data", ++ "/usr/local/share/games/teeworlds/data", ++ "/opt/teeworlds/data" + }; + const int sdirs_count = sizeof(sdirs) / sizeof(sdirs[0]); + diff --git a/devel/games-action/teeworlds/files/teeworlds_init b/devel/games-action/teeworlds/files/teeworlds_init new file mode 100644 index 0000000..a796cf8 --- /dev/null +++ b/devel/games-action/teeworlds/files/teeworlds_init @@ -0,0 +1,37 @@ +#!/sbin/runscript +# Copyright 1999-2006 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} --chuid teeworlds --exec ${GAME_DIRECTORY}/teeworlds_srv \ + -- -f ${CONFIG} + eend $? +} + +reload() { + ebegin "Reloading TeeWorlds configs and restarting processes" + start-stop-daemon --stop --oknodo --chuid teeworlds --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/devel/games-action/teeworlds/metadata.xml b/devel/games-action/teeworlds/metadata.xml new file mode 100644 index 0000000..608d11c --- /dev/null +++ b/devel/games-action/teeworlds/metadata.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> +<maintainer> + <email>lazy_bum@openbsd.pl</email> + <name>Piotr Szymaniak</name> +</maintainer> +<herd>games</herd> +</pkgmetadata> diff --git a/devel/games-action/teeworlds/teeworlds-0.5.1-r5.ebuild b/devel/games-action/teeworlds/teeworlds-0.5.1-r5.ebuild new file mode 100644 index 0000000..a452dcf --- /dev/null +++ b/devel/games-action/teeworlds/teeworlds-0.5.1-r5.ebuild @@ -0,0 +1,100 @@ +# Copyright 1999-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI="2" + +inherit toolchain-funcs eutils games + +BAM_P="bam-0.2.0" +DESCRIPTION="Online 2D platform shooter." +HOMEPAGE="http://www.teeworlds.com" +SRC_URI="http://www.teeworlds.com/files/${P}-src.tar.gz -> ${P}-src.tar.gz + http://teeworlds.com/trac/bam/browser/releases/bam-0.2.0.tar.gz?format=raw + -> ${BAM_P}.tar.gz" + +LICENSE="as-is" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="debug dedicated" + +RDEPEND="dev-lang/lua + !dedicated? ( + media-libs/libsdl[X,opengl] + sys-libs/zlib + )" +# has modified wavpack and pnglite in its sources +# not worth of effort patching up to system ones +DEPEND="${RDEPEND} + app-arch/zip" + +S=${WORKDIR}/${P}-src +# that's a temporary fix for datadir location +dir=${GAMES_DATADIR}/${PN} + +src_prepare() { + rm -f license.txt + + epatch "${FILESDIR}"/fix_datadir_search.patch +} + +pkg_setup() { + dodir /etc/${P} + enewgroup games + enewuser teeworlds -1 -1 -1 games +} + +src_compile() { + # compile bam + ebegin "Preparing BAM" + cd "${WORKDIR}/${BAM_P}" + $(tc-getCC) ${CFLAGS} ${LDFLAGS} \ + src/tools/txt2c.c -o src/tools/txt2c || die + src/tools/txt2c src/base.bam src/driver_gcc.bam \ + src/driver_cl.bam > src/internal_base.h || die + # internal lua sources! + $(tc-getCC) ${CFLAGS} ${LDFLAGS} \ + src/lua/*.c src/*.c -o src/bam \ + -I /usr/include/ -lm -lpthread || die + eend $? + # compile game + cd "${S}" + sed -i \ + -e "s|Add(\"-Wall\", \"-fno-exceptions|Add(\"|" \ + -e "s|cc.flags:Add(\"-fstack-protector\", \"-fstack-protector-all\")|cc.flags:Add(\"${CXXFLAGS}\")|" \ + -e "s|link.flags:Add(\"-fstack-protector\", \"-fstack-protector-all\")|link.flags:Add(\"${LDFLAGS}\")|" \ + default.bam || die "sed failed" + + local opts="" + use dedicated && opts="server_" + use debug && opts="${opts}debug" || opts="${opts}release" + + ../${BAM_P}/src/bam -v ${opts} +} + +src_install() { + if use debug ; then + newgamesbin ${PN}_srv_d ${PN}_srv || "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 + newicon other/icons/Teeworlds.ico ${PN}.ico + make_desktop_entry ${PN} "Teeworlds" + insinto "${dir}" + doins -r data || die "doins failed" + else + insinto "${dir}"/data/maps + doins data/maps/* || die "doins failed" + fi + + dodoc *.txt + prepgamesdirs + newinitd "${FILESDIR}"/teeworlds_init teeworlds +} diff --git a/devel/games-action/teeworlds/teeworlds-0.5.1.ebuild b/devel/games-action/teeworlds/teeworlds-0.5.1.ebuild new file mode 100644 index 0000000..a452dcf --- /dev/null +++ b/devel/games-action/teeworlds/teeworlds-0.5.1.ebuild @@ -0,0 +1,100 @@ +# Copyright 1999-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI="2" + +inherit toolchain-funcs eutils games + +BAM_P="bam-0.2.0" +DESCRIPTION="Online 2D platform shooter." +HOMEPAGE="http://www.teeworlds.com" +SRC_URI="http://www.teeworlds.com/files/${P}-src.tar.gz -> ${P}-src.tar.gz + http://teeworlds.com/trac/bam/browser/releases/bam-0.2.0.tar.gz?format=raw + -> ${BAM_P}.tar.gz" + +LICENSE="as-is" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="debug dedicated" + +RDEPEND="dev-lang/lua + !dedicated? ( + media-libs/libsdl[X,opengl] + sys-libs/zlib + )" +# has modified wavpack and pnglite in its sources +# not worth of effort patching up to system ones +DEPEND="${RDEPEND} + app-arch/zip" + +S=${WORKDIR}/${P}-src +# that's a temporary fix for datadir location +dir=${GAMES_DATADIR}/${PN} + +src_prepare() { + rm -f license.txt + + epatch "${FILESDIR}"/fix_datadir_search.patch +} + +pkg_setup() { + dodir /etc/${P} + enewgroup games + enewuser teeworlds -1 -1 -1 games +} + +src_compile() { + # compile bam + ebegin "Preparing BAM" + cd "${WORKDIR}/${BAM_P}" + $(tc-getCC) ${CFLAGS} ${LDFLAGS} \ + src/tools/txt2c.c -o src/tools/txt2c || die + src/tools/txt2c src/base.bam src/driver_gcc.bam \ + src/driver_cl.bam > src/internal_base.h || die + # internal lua sources! + $(tc-getCC) ${CFLAGS} ${LDFLAGS} \ + src/lua/*.c src/*.c -o src/bam \ + -I /usr/include/ -lm -lpthread || die + eend $? + # compile game + cd "${S}" + sed -i \ + -e "s|Add(\"-Wall\", \"-fno-exceptions|Add(\"|" \ + -e "s|cc.flags:Add(\"-fstack-protector\", \"-fstack-protector-all\")|cc.flags:Add(\"${CXXFLAGS}\")|" \ + -e "s|link.flags:Add(\"-fstack-protector\", \"-fstack-protector-all\")|link.flags:Add(\"${LDFLAGS}\")|" \ + default.bam || die "sed failed" + + local opts="" + use dedicated && opts="server_" + use debug && opts="${opts}debug" || opts="${opts}release" + + ../${BAM_P}/src/bam -v ${opts} +} + +src_install() { + if use debug ; then + newgamesbin ${PN}_srv_d ${PN}_srv || "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 + newicon other/icons/Teeworlds.ico ${PN}.ico + make_desktop_entry ${PN} "Teeworlds" + insinto "${dir}" + doins -r data || die "doins failed" + else + insinto "${dir}"/data/maps + doins data/maps/* || die "doins failed" + fi + + dodoc *.txt + prepgamesdirs + newinitd "${FILESDIR}"/teeworlds_init teeworlds +} |