summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Heaven <nyhm@gentoo.org>2009-08-24 12:25:53 +0000
committerTristan Heaven <nyhm@gentoo.org>2009-08-24 12:25:53 +0000
commit7fbc219a4df1acfab7dcb5ba543ee3a8ddafb3e4 (patch)
tree025149c60200186e0a9002235e3b5c50b4955775 /games-fps
parentNew version that allows more kernel routing tables in IPv6 and contains a cor... (diff)
downloadgentoo-2-7fbc219a4df1acfab7dcb5ba543ee3a8ddafb3e4.tar.gz
gentoo-2-7fbc219a4df1acfab7dcb5ba543ee3a8ddafb3e4.tar.bz2
gentoo-2-7fbc219a4df1acfab7dcb5ba543ee3a8ddafb3e4.zip
Patch from Gef Lebster to fix incompatibility with jpeg-7, bug #282406
(Portage version: 2.2_rc39/cvs/Linux x86_64)
Diffstat (limited to 'games-fps')
-rw-r--r--games-fps/nexuiz/ChangeLog8
-rw-r--r--games-fps/nexuiz/files/nexuiz-2.5.1-jpeg.patch113
-rw-r--r--games-fps/nexuiz/nexuiz-2.5.1-r1.ebuild137
3 files changed, 257 insertions, 1 deletions
diff --git a/games-fps/nexuiz/ChangeLog b/games-fps/nexuiz/ChangeLog
index 2092bfeefa29..1326ff8f1a4e 100644
--- a/games-fps/nexuiz/ChangeLog
+++ b/games-fps/nexuiz/ChangeLog
@@ -1,6 +1,12 @@
# 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.33 2009/07/10 16:06:46 mr_bones_ Exp $
+# $Header: /var/cvsroot/gentoo-x86/games-fps/nexuiz/ChangeLog,v 1.34 2009/08/24 12:25:52 nyhm Exp $
+
+*nexuiz-2.5.1-r1 (24 Aug 2009)
+
+ 24 Aug 2009; Tristan Heaven <nyhm@gentoo.org> +nexuiz-2.5.1-r1.ebuild,
+ +files/nexuiz-2.5.1-jpeg.patch:
+ Patch from Gef Lebster to fix incompatibility with jpeg-7, bug #282406
10 Jul 2009; Michael Sterrett <mr_bones_@gentoo.org> nexuiz-2.5.1.ebuild:
add use-based deps for libsdl (bug #277275)
diff --git a/games-fps/nexuiz/files/nexuiz-2.5.1-jpeg.patch b/games-fps/nexuiz/files/nexuiz-2.5.1-jpeg.patch
new file mode 100644
index 000000000000..6e34428adbc3
--- /dev/null
+++ b/games-fps/nexuiz/files/nexuiz-2.5.1-jpeg.patch
@@ -0,0 +1,113 @@
+--- darkplaces/makefile 2008/07/19 12:03:15 8416
++++ darkplaces/makefile 2009/07/20 15:30:38 9064
+@@ -251,6 +251,14 @@
+ endif
+ endif
+
++ifdef DP_LINK_TO_LIBJPEG
++ LDFLAGS_LIBJPEG?=-ljpeg
++ LDFLAGS_CL+=$(LDFLAGS_LIBJPEG)
++ LDFLAGS_SV+=$(LDFLAGS_LIBJPEG)
++ LDFLAGS_SDL+=$(LDFLAGS_LIBJPEG)
++ CFLAGS_PRELOAD+=$(CFLAGS_LIBJPEG) -DLINK_TO_LIBJPEG
++endif
++
+ ##### GNU Make specific definitions #####
+
+ DO_LD=$(CC) -o $@ $^ $(LDFLAGS)
+
+--- darkplaces/jpeg.c 2009/04/10 14:37:23 8892
++++ darkplaces/jpeg.c 2009/07/20 15:30:38 9064
+@@ -28,6 +28,32 @@
+
+ cvar_t sv_writepicture_quality = {CVAR_SAVE, "sv_writepicture_quality", "10", "WritePicture quality offset (higher means better quality, but slower)"};
+
++// jboolean is unsigned char instead of int on Win32
++#ifdef WIN32
++typedef unsigned char jboolean;
++#else
++typedef int jboolean;
++#endif
++
++#ifdef LINK_TO_LIBJPEG
++#include <jpeglib.h>
++#define qjpeg_create_compress jpeg_create_compress
++#define qjpeg_create_decompress jpeg_create_decompress
++#define qjpeg_destroy_compress jpeg_destroy_compress
++#define qjpeg_destroy_decompress jpeg_destroy_decompress
++#define qjpeg_finish_compress jpeg_finish_compress
++#define qjpeg_finish_decompress jpeg_finish_decompress
++#define qjpeg_resync_to_restart jpeg_resync_to_restart
++#define qjpeg_read_header jpeg_read_header
++#define qjpeg_read_scanlines jpeg_read_scanlines
++#define qjpeg_set_defaults jpeg_set_defaults
++#define qjpeg_set_quality jpeg_set_quality
++#define qjpeg_start_compress jpeg_start_compress
++#define qjpeg_start_decompress jpeg_start_decompress
++#define qjpeg_std_error jpeg_std_error
++#define qjpeg_write_scanlines jpeg_write_scanlines
++#define jpeg_dll true
++#else
+ /*
+ =================================================================
+
+@@ -39,18 +65,12 @@
+ =================================================================
+ */
+
+-// jboolean is unsigned char instead of int on Win32
+-#ifdef WIN32
+-typedef unsigned char jboolean;
+-#else
+-typedef int jboolean;
+-#endif
+-
+-#define JPEG_LIB_VERSION 62 // Version 6b
+-
+ typedef void *j_common_ptr;
+ typedef struct jpeg_compress_struct *j_compress_ptr;
+ typedef struct jpeg_decompress_struct *j_decompress_ptr;
++
++#define JPEG_LIB_VERSION 62 // Version 6b
++
+ typedef enum
+ {
+ JCS_UNKNOWN,
+@@ -430,6 +450,7 @@
+ // Handle for JPEG DLL
+ dllhandle_t jpeg_dll = NULL;
+ qboolean jpeg_tried_loading = 0;
++#endif
+
+ static unsigned char jpeg_eoi_marker [2] = {0xFF, JPEG_EOI};
+ static jmp_buf error_in_jpeg;
+@@ -464,6 +485,9 @@
+ */
+ qboolean JPEG_OpenLibrary (void)
+ {
++#ifdef LINK_TO_LIBJPEG
++ return true;
++#else
+ const char* dllnames [] =
+ {
+ #if defined(WIN64)
+@@ -490,6 +514,7 @@
+
+ // Load the DLL
+ return Sys_LoadLibrary (dllnames, &jpeg_dll, jpegfuncs);
++#endif
+ }
+
+
+@@ -502,8 +527,10 @@
+ */
+ void JPEG_CloseLibrary (void)
+ {
++#ifndef LINK_TO_LIBJPEG
+ Sys_UnloadLibrary (&jpeg_dll);
+ jpeg_tried_loading = false; // allow retry
++#endif
+ }
+
+
+
diff --git a/games-fps/nexuiz/nexuiz-2.5.1-r1.ebuild b/games-fps/nexuiz/nexuiz-2.5.1-r1.ebuild
new file mode 100644
index 000000000000..e08feacd556f
--- /dev/null
+++ b/games-fps/nexuiz/nexuiz-2.5.1-r1.ebuild
@@ -0,0 +1,137 @@
+# 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.1-r1.ebuild,v 1.1 2009/08/24 12:25:52 nyhm 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
+ media-libs/libtheora
+ media-libs/libpng
+ media-libs/libmodplug
+ 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[joystick,video] )"
+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}-jpeg.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 '1i DP_LINK_TO_LIBJPEG=1' \
+ -e '1i DP_PRELOAD_DEPENDENCIES=1' \
+ -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"
+ doicon ${PN}.xpm
+ 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 -r readme.html Docs
+
+ 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
+}