summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Sterrett <mr_bones_@gentoo.org>2009-04-09 04:52:54 +0000
committerMichael Sterrett <mr_bones_@gentoo.org>2009-04-09 04:52:54 +0000
commit3bdb00b21773a444fb5299e3f50fe5adb9530e1e (patch)
treea3fce3e7a31938e0e879159ee8da5e224db90f7e /games-fps
parentVersion bump. (diff)
downloadgentoo-2-3bdb00b21773a444fb5299e3f50fe5adb9530e1e.tar.gz
gentoo-2-3bdb00b21773a444fb5299e3f50fe5adb9530e1e.tar.bz2
gentoo-2-3bdb00b21773a444fb5299e3f50fe5adb9530e1e.zip
version bump - ebuild submitted by Merlijn Hofstra and Tomáš Chvátal (bug #264794)
(Portage version: 2.1.6.7/cvs/Linux i686)
Diffstat (limited to 'games-fps')
-rw-r--r--games-fps/nexuiz/ChangeLog9
-rw-r--r--games-fps/nexuiz/files/nexuiz-2.5-memory-leak.patch114
-rw-r--r--games-fps/nexuiz/nexuiz-2.5.ebuild132
3 files changed, 254 insertions, 1 deletions
diff --git a/games-fps/nexuiz/ChangeLog b/games-fps/nexuiz/ChangeLog
index d6e98127d6ae..e328b2adec23 100644
--- a/games-fps/nexuiz/ChangeLog
+++ b/games-fps/nexuiz/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for games-fps/nexuiz
# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/games-fps/nexuiz/ChangeLog,v 1.29 2009/04/03 17:32:59 mr_bones_ Exp $
+# $Header: /var/cvsroot/gentoo-x86/games-fps/nexuiz/ChangeLog,v 1.30 2009/04/09 04:52:54 mr_bones_ Exp $
+
+*nexuiz-2.5 (09 Apr 2009)
+
+ 09 Apr 2009; Michael Sterrett <mr_bones_@gentoo.org>
+ +files/nexuiz-2.5-memory-leak.patch, +nexuiz-2.5.ebuild:
+ version bump - ebuild submitted by Merlijn Hofstra and Tomáš Chvátal (bug
+ #264794)
03 Apr 2009; Michael Sterrett <mr_bones_@gentoo.org> nexuiz-2.4.2.ebuild:
EAPI=2; tidy; handle strip more precisely
diff --git a/games-fps/nexuiz/files/nexuiz-2.5-memory-leak.patch b/games-fps/nexuiz/files/nexuiz-2.5-memory-leak.patch
new file mode 100644
index 000000000000..8f8e2bf4951a
--- /dev/null
+++ b/games-fps/nexuiz/files/nexuiz-2.5-memory-leak.patch
@@ -0,0 +1,114 @@
+Index: sv_main.c
+===================================================================
+--- sv_main.c
++++ sv_main.c
+@@ -800,7 +800,7 @@
+ sb.data = (unsigned char *) buf;
+ sb.maxsize = sizeof(buf);
+ i = 0;
+- while(MakeDownloadPacket(sv.csqc_progname, sv.csqc_progdata, sv.csqc_progsize, sv.csqc_progcrc, i++, &sb, sv.protocol))
++ while(MakeDownloadPacket(sv.csqc_progname, svs.csqc_progdata, sv.csqc_progsize, sv.csqc_progcrc, i++, &sb, sv.protocol))
+ SV_WriteDemoMessage(client, &sb, false);
+ }
+
+@@ -2234,9 +2234,9 @@
+ Con_DPrintf("Downloading %s to %s\n", host_client->download_name, host_client->name);
+
+ if(host_client->download_deflate)
+- host_client->download_file = FS_FileFromData(sv.csqc_progdata_deflated, sv.csqc_progsize_deflated, true);
++ host_client->download_file = FS_FileFromData(svs.csqc_progdata_deflated, svs.csqc_progsize_deflated, true);
+ else
+- host_client->download_file = FS_FileFromData(sv.csqc_progdata, sv.csqc_progsize, true);
++ host_client->download_file = FS_FileFromData(svs.csqc_progdata, sv.csqc_progsize, true);
+
+ // no, no space is needed between %s and %s :P
+ Host_ClientCommands("\ncl_downloadbegin %i %s%s\n", (int)FS_FileSize(host_client->download_file), host_client->download_name, extensions);
+@@ -2638,37 +2638,37 @@
+ {
+ fs_offset_t progsize;
+
+- if(sv.csqc_progdata)
++ if(svs.csqc_progdata)
+ {
+ Con_DPrintf("Unloading old CSQC data.\n");
+- Mem_Free(sv.csqc_progdata);
+- if(sv.csqc_progdata_deflated)
+- Mem_Free(sv.csqc_progdata_deflated);
++ Mem_Free(svs.csqc_progdata);
++ if(svs.csqc_progdata_deflated)
++ Mem_Free(svs.csqc_progdata_deflated);
+ }
+
+- sv.csqc_progdata = NULL;
+- sv.csqc_progdata_deflated = NULL;
++ svs.csqc_progdata = NULL;
++ svs.csqc_progdata_deflated = NULL;
+
+ Con_Print("Loading csprogs.dat\n");
+
+ sv.csqc_progname[0] = 0;
+- sv.csqc_progdata = FS_LoadFile(csqc_progname.string, sv_mempool, false, &progsize);
++ svs.csqc_progdata = FS_LoadFile(csqc_progname.string, sv_mempool, false, &progsize);
+
+ if(progsize > 0)
+ {
+ size_t deflated_size;
+
+ sv.csqc_progsize = (int)progsize;
+- sv.csqc_progcrc = CRC_Block(sv.csqc_progdata, progsize);
++ sv.csqc_progcrc = CRC_Block(svs.csqc_progdata, progsize);
+ strlcpy(sv.csqc_progname, csqc_progname.string, sizeof(sv.csqc_progname));
+ Con_Printf("server detected csqc progs file \"%s\" with size %i and crc %i\n", sv.csqc_progname, sv.csqc_progsize, sv.csqc_progcrc);
+
+ Con_Print("Compressing csprogs.dat\n");
+ //unsigned char *FS_Deflate(const unsigned char *data, size_t size, size_t *deflated_size, int level, mempool_t *mempool);
+- sv.csqc_progdata_deflated = FS_Deflate(sv.csqc_progdata, progsize, &deflated_size, -1, sv_mempool);
+- sv.csqc_progsize_deflated = (int)deflated_size;
++ svs.csqc_progdata_deflated = FS_Deflate(svs.csqc_progdata, progsize, &deflated_size, -1, sv_mempool);
++ svs.csqc_progsize_deflated = (int)deflated_size;
+ Con_Printf("Deflated: %g%%\n", 100.0 - 100.0 * (deflated_size / (float)progsize));
+- Con_DPrintf("Uncompressed: %u\nCompressed: %u\n", (unsigned)sv.csqc_progsize, (unsigned)sv.csqc_progsize_deflated);
++ Con_DPrintf("Uncompressed: %u\nCompressed: %u\n", (unsigned)sv.csqc_progsize, (unsigned)svs.csqc_progsize_deflated);
+ }
+ }
+
+Index: jpeg.c
+===================================================================
+--- jpeg.c (revision 8850)
++++ jpeg.c (revision 8853)
+@@ -1047,6 +1047,8 @@
+ // try to compress it to JPEG
+ *buf = Z_Malloc(maxsize);
+ *size = JPEG_SaveImage_to_Buffer((char *) *buf, maxsize, image_width, image_height, newimagedata);
++ Mem_Free(newimagedata);
++
+ if(!*size)
+ {
+ Z_Free(*buf);
+Index: server.h
+===================================================================
+--- server.h (revision 8850)
++++ server.h (revision 8853)
+@@ -48,6 +48,12 @@
+ float perf_acc_offset_squared;
+ float perf_acc_offset_max;
+ int perf_acc_offset_samples;
++
++ // csqc stuff
++ unsigned char *csqc_progdata;
++ size_t csqc_progsize_deflated;
++ unsigned char *csqc_progdata_deflated;
++
+ } server_static_t;
+
+ //=============================================================================
+@@ -87,9 +93,6 @@
+ int csqc_progcrc; // -1 = no progs
+ int csqc_progsize; // -1 = no progs
+ char csqc_progname[MAX_QPATH]; // copied from csqc_progname at level start
+- unsigned char *csqc_progdata;
+- size_t csqc_progsize_deflated;
+- unsigned char *csqc_progdata_deflated;
+
+ // collision culling data
+ world_t world;
diff --git a/games-fps/nexuiz/nexuiz-2.5.ebuild b/games-fps/nexuiz/nexuiz-2.5.ebuild
new file mode 100644
index 000000000000..16082f9ac6fc
--- /dev/null
+++ b/games-fps/nexuiz/nexuiz-2.5.ebuild
@@ -0,0 +1,132 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/games-fps/nexuiz/nexuiz-2.5.ebuild,v 1.1 2009/04/09 04:52:54 mr_bones_ Exp $
+
+EAPI=2
+inherit eutils games
+
+MY_PN=Nexuiz
+MY_P=${PN}-${PV//./}
+MAPS=nexmappack_r2
+DESCRIPTION="Deathmatch FPS based on DarkPlaces, an advanced Quake 1 engine"
+HOMEPAGE="http://www.nexuiz.com/"
+SRC_URI="mirror://sourceforge/${PN}/${MY_P}.zip
+ maps? ( mirror://sourceforge/${PN}/${MAPS}.zip )"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE="alsa dedicated maps opengl sdl"
+
+UIRDEPEND="media-libs/libogg
+ media-libs/libvorbis
+ x11-libs/libX11
+ x11-libs/libXau
+ x11-libs/libXdmcp
+ x11-libs/libXext
+ x11-libs/libXxf86dga
+ x11-libs/libXxf86vm
+ virtual/opengl
+ alsa? ( media-libs/alsa-lib )
+ sdl? ( media-libs/libsdl )"
+UIDEPEND="x11-proto/xextproto
+ x11-proto/xf86dgaproto
+ x11-proto/xf86vidmodeproto
+ x11-proto/xproto"
+RDEPEND="media-libs/jpeg
+ net-misc/curl
+ opengl? ( ${UIRDEPEND} )
+ !dedicated? ( !opengl? ( ${UIRDEPEND} ) )"
+DEPEND="${RDEPEND}
+ app-arch/unzip
+ opengl? ( ${UIDEPEND} )
+ !dedicated? ( !opengl? ( ${UIDEPEND} ) )"
+
+S=${WORKDIR}/darkplaces
+
+src_unpack() {
+ unpack ${MY_P}.zip
+
+ local f
+ for f in "${MY_PN}"/sources/*.zip ; do
+ unpack ./${f}
+ done
+
+ if use maps ; then
+ cd "${WORKDIR}"/${MY_PN}
+ unpack ${MAPS}.zip
+ fi
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-memory-leak.patch
+
+ # Make the game automatically look in the correct data directory
+ sed -i \
+ -e "/^CC=/d" \
+ -e "s:-O2:${CFLAGS}:" \
+ -e "/-lm/s:$: ${LDFLAGS}:" \
+ -e '/^STRIP/s/strip/true/' \
+ makefile.inc \
+ || die "sed failed"
+
+ sed -i \
+ -e "s:ifdef DP_.*:DP_FS_BASEDIR=${GAMES_DATADIR}/nexuiz\n&:" \
+ makefile \
+ || die "sed failed"
+
+ if ! use alsa ; then
+ sed -i \
+ -e "/DEFAULT_SNDAPI/s:ALSA:OSS:" \
+ makefile \
+ || die "sed failed"
+ fi
+}
+
+src_compile() {
+ if use opengl || ! use dedicated ; then
+ emake cl-${PN} || die "emake cl-${PN} failed"
+ if use sdl ; then
+ emake sdl-${PN} || die "emake sdl-${PN} failed"
+ fi
+ fi
+
+ if use dedicated ; then
+ emake sv-${PN} || die "emake sv-${PN} failed"
+ fi
+}
+
+src_install() {
+ if use opengl || ! use dedicated ; then
+ dogamesbin ${PN}-glx || die "dogamesbin glx failed"
+ newicon darkplaces72x72.png ${PN}.png
+ make_desktop_entry ${PN}-glx "Nexuiz (GLX)"
+ if use sdl ; then
+ dogamesbin ${PN}-sdl || die "dogamesbin sdl failed"
+ make_desktop_entry ${PN}-sdl "Nexuiz (SDL)"
+ dosym ${PN}-sdl "${GAMES_BINDIR}"/${PN}
+ else
+ dosym ${PN}-glx "${GAMES_BINDIR}"/${PN}
+ fi
+ fi
+
+ if use dedicated ; then
+ dogamesbin ${PN}-dedicated || die "dogamesbin dedicated failed"
+ fi
+
+ cd "${WORKDIR}"/${MY_PN}
+
+ dodoc Docs/*.txt
+ dohtml Docs/*.{htm,html}
+
+ insinto "${GAMES_DATADIR}"/${PN}
+
+ if use dedicated ; then
+ doins -r server || die "doins server failed"
+ fi
+
+ doins -r data || die "doins data failed"
+ doins -r havoc || die "doins havoc failed"
+
+ prepgamesdirs
+}