diff --git a/games/qudos/Makefile b/games/qudos/Makefile index afb1b53fafb6..7068871234ea 100644 --- a/games/qudos/Makefile +++ b/games/qudos/Makefile @@ -1,212 +1,209 @@ PORTNAME= qudos PORTVERSION= 0.40.1 PORTREVISION= 20 CATEGORIES= games MASTER_SITES= http://freebsd.nsu.ru/distfiles/ LOCAL/danfe DISTNAME= QuDos-${PORTVERSION}-src DISTFILES= ${DISTNAME}${EXTRACT_SUFX} \ QuDos-${PORTVERSION}.pk3 EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX} MAINTAINER= danfe@FreeBSD.org COMMENT= Enhanced OpenGL-only Quake II engine +LICENSE= GPLv2+ + USES= gmake tar:bzip2 MAKE_ENV= WITH_DATADIR=YES WITH_LIBDIR=YES WITH_XMMS=NO \ DATADIR="${Q2DIR}" LIBDIR="${LIBDIR}" BUILD_ARTS_SND=NO PLIST_SUB= LIBDIR="${LIBDIR:S,${PREFIX}/,,}" VER="${PORTVERSION}" LIBDIR= ${PREFIX}/lib/${PORTNAME} MOD_LIST= 3ZB2 CTF JABOT ROGUE XATRIX ZAERO OPTIONS_DEFINE= 3ZB2 BOTS CLIENT CTF DEDICATED GAME GAME_MOD \ GLX IPV6 JABOT JOYSTICK OSS QMAX REDBLUE RETEXTURE \ ROGUE SDL SDLGL XATRIX ZAERO DOCS OPTIONS_DEFINE_i386= ASM OPTIONS_DEFINE_amd64= ASM OPTIONS_DEFAULT_i386= ASM OPTIONS_DEFAULT_amd64= ASM OPTIONS_DEFAULT= 3ZB2 BOTS CLIENT DEDICATED GAME_MOD GLX JOYSTICK OSS \ QMAX SDL SDLGL 3ZB2_DESC= Build 3zb2 mod (bots) BOTS_DESC= Ace Bot support in mods CLIENT_DESC= Build client CTF_DESC= Build CTF (Capture The Flag) mod DEDICATED_DESC= Build dedicated server GAME_DESC= Build main game (default mod) GAME_MOD_DESC= Add custom add-ons to the main game JABOT_DESC= Build JABot mod (bots) JOYSTICK_DESC= Joystick support QMAX_DESC= Enable fancier OpenGL graphics REDBLUE_DESC= Enable red-blue 3D glasses renderer RETEXTURE_DESC= Retextured graphics support ROGUE_DESC= Build Ground Zero (Rogue) mission pack SDLGL_DESC= Build SDL OpenGL renderer XATRIX_DESC= Build The Reckoning (Xatrix) mission pack ZAERO_DESC= Build Zaero mission pack .include .for mod in ${MOD_LIST} . if ${PORT_OPTIONS:M${mod}} MAKE_ENV+= BUILD_${mod}=YES PLIST_SUB+= ${mod}="" . else MAKE_ENV+= BUILD_${mod}=NO PLIST_SUB+= ${mod}="@comment " . endif .endfor .if ${PORT_OPTIONS:MGLX} || ${PORT_OPTIONS:MSDLGL} USES+= gl jpeg xorg USE_GL= glu USE_XORG= xxf86vm LIB_DEPENDS+= libpng.so:graphics/png .endif .if ${PORT_OPTIONS:MSDL} || ${PORT_OPTIONS:MSDLGL} USES+= sdl USE_SDL= sdl .endif .if ${PORT_OPTIONS:MCLIENT} LIB_DEPENDS+= libvorbis.so:audio/libvorbis MAKE_ENV+= BUILD_QUAKE2=YES PLIST_SUB+= CLIENT="" Q2BIN+= ${PORTNAME} .else MAKE_ENV+= BUILD_QUAKE2=NO PLIST_SUB+= CLIENT="@comment " .endif .if ${PORT_OPTIONS:MDEDICATED} MAKE_ENV+= BUILD_DEDICATED=YES PLIST_SUB+= DEDICATED="" Q2BIN+= ${PORTNAME}-ded .else MAKE_ENV+= BUILD_DEDICATED=NO PLIST_SUB+= DEDICATED="@comment " .endif .if ${PORT_OPTIONS:MGAME} MAKE_ENV+= BUILD_GAME=YES PLIST_SUB+= GAME="" .else MAKE_ENV+= BUILD_GAME=NO PLIST_SUB+= GAME="@comment " .endif .if ${PORT_OPTIONS:MGAME_MOD} MAKE_ENV+= WITH_GAME_MOD=YES .else MAKE_ENV+= WITH_GAME_MOD=NO .endif .for opt in GLX SDLGL . if ${PORT_OPTIONS:M${opt}} MAKE_ENV+= BUILD_${opt}=YES PLIST_SUB+= ${opt}="" Q2REF+= ${opt:tl} . else MAKE_ENV+= BUILD_${opt}=NO PLIST_SUB+= ${opt}="@comment " . endif .endfor .if ${PORT_OPTIONS:MIPV6} MAKE_ENV+= WITH_IPV6=YES .else MAKE_ENV+= WITH_IPV6=NO .endif .if ${PORT_OPTIONS:MJOYSTICK} MAKE_ENV+= WITH_JOYSTICK=YES .else MAKE_ENV+= WITH_JOYSTICK=NO .endif .if ${PORT_OPTIONS:MOSS} MAKE_ENV+= BUILD_OSS_SND=YES PLIST_SUB+= OSS="" Q2SND+= oss .else MAKE_ENV+= BUILD_OSS_SND=NO PLIST_SUB+= OSS="@comment " .endif .if ${PORT_OPTIONS:MQMAX} MAKE_ENV+= WITH_QMAX=YES .else MAKE_ENV+= WITH_QMAX=NO .endif .if ${PORT_OPTIONS:MREDBLUE} MAKE_ENV+= WITH_REDBLUE=YES .else MAKE_ENV+= WITH_REDBLUE=NO .endif .if ${PORT_OPTIONS:MRETEXTURE} MAKE_ENV+= WITH_RETEXTURE=YES .else MAKE_ENV+= WITH_RETEXTURE=NO .endif .if ${PORT_OPTIONS:MSDL} MAKE_ENV+= BUILD_SDL_SND=YES PLIST_SUB+= SDL="" Q2SND+= sdl .else MAKE_ENV+= BUILD_SDL_SND=NO PLIST_SUB+= SDL="@comment " .endif .if ${PORT_OPTIONS:MASM} MAKE_ENV+= WITH_X86_ASM=YES .else MAKE_ENV+= WITH_X86_ASM=NO .endif -post-patch: -# Resolve name collision with jpeg-8 - @${REINPLACE_CMD} -e 's|jpeg_mem_src|local_jpeg_mem_src|' \ - ${WRKSRC}/src/ref_gl/gl_image.c - post-build: .for bin in ${Q2BIN} @cd ${WRKSRC}/quake2 && ${MV} ${bin:S/qudos/QuDos/} ${bin} .endfor do-install: .for bin in ${Q2BIN} ${INSTALL_PROGRAM} ${WRKSRC}/quake2/${bin} ${STAGEDIR}${PREFIX}/bin .endfor @${MKDIR} ${STAGEDIR}${LIBDIR}/baseq2 .for ref in ${Q2REF} ${INSTALL_PROGRAM} ${WRKSRC}/quake2/ref_q2${ref}.so \ ${STAGEDIR}${LIBDIR} .endfor .for snd in ${Q2SND} ${INSTALL_PROGRAM} ${WRKSRC}/quake2/snd_${snd}.so ${STAGEDIR}${LIBDIR} .endfor .if ${PORT_OPTIONS:MGAME} ${INSTALL_PROGRAM} ${WRKSRC}/quake2/baseq2/game.so \ ${STAGEDIR}${LIBDIR}/baseq2 .endif .for mod in ${MOD_LIST:tl} .if ${PORT_OPTIONS:M${mod:tu}} @${MKDIR} ${STAGEDIR}${LIBDIR}/${mod} ${INSTALL_PROGRAM} ${WRKSRC}/quake2/${mod}/game.so \ ${STAGEDIR}${LIBDIR}/${mod} .endif .endfor ${INSTALL_DATA} ${_DISTDIR}/QuDos-${PORTVERSION}.pk3 \ ${STAGEDIR}${LIBDIR}/baseq2 @${MKDIR} ${STAGEDIR}${DOCSDIR} ${INSTALL_DATA} ${WRKSRC}/docs/QuDos.txt \ ${WRKSRC}/docs/Ogg_readme.txt ${STAGEDIR}${DOCSDIR} .include "${.CURDIR}/../quake2-data/Makefile.include" .include diff --git a/games/qudos/files/patch-Makefile b/games/qudos/files/patch-Makefile index f6c6589ff280..a0681e694af3 100644 --- a/games/qudos/files/patch-Makefile +++ b/games/qudos/files/patch-Makefile @@ -1,15 +1,15 @@ --- Makefile.orig 2006-06-10 16:31:19 UTC +++ Makefile @@ -109,10 +109,9 @@ else ifeq ($(TYPE),profile) CFLAGS+= -pg else -CFLAGS+= -O3 -ffast-math -funroll-loops -fomit-frame-pointer \ - -fexpensive-optimizations -+CFLAGS+= -fcommon -ffast-math -funroll-loops -fomit-frame-pointer ++CFLAGS+= -fcommon -ffast-math -Wno-incompatible-function-pointer-types ifeq ($(ARCH),i386) -CFLAGS+= -falign-loops=2 -falign-jumps=2 -falign-functions=2 \ +CFLAGS+= -falign-functions=2 \ -fno-strict-aliasing endif endif diff --git a/games/qudos/files/patch-src__ref_gl__gl_local.h b/games/qudos/files/patch-src__ref_gl__gl_local.h index aa9dce66ef0d..4b6e34a4bfda 100644 --- a/games/qudos/files/patch-src__ref_gl__gl_local.h +++ b/games/qudos/files/patch-src__ref_gl__gl_local.h @@ -1,10 +1,23 @@ ---- src/ref_gl/gl_local.h.orig 2006-06-10 12:22:27.000000000 +0200 -+++ src/ref_gl/gl_local.h 2012-04-25 06:13:42.000000000 +0200 +--- src/ref_gl/gl_local.h.orig 2006-06-10 10:22:27 UTC ++++ src/ref_gl/gl_local.h @@ -30,6 +30,7 @@ #include #include +#include #include #include "../client/ref.h" +@@ -480,12 +481,6 @@ int Draw_GetPalette(void); + void GL_ResampleTexture(unsigned *in, int inwidth, int inheight, unsigned *out, int outwidth, int outheight); + + struct image_s *R_RegisterSkin(char *name); +- +-void LoadPCX (char *filename, byte ** pic, byte ** palette, int *width, int *height); +-void LoadTGA (char *filename, byte ** pic, int *width, int *height); +-void LoadJPG (char *filename, byte ** pic, int *width, int *height); +-void LoadPNG (char *filename, byte ** pic, int *width, int *height); +- + + image_t *GL_LoadPic(char *name, byte * pic, int width, int height, imagetype_t type, int bits); + image_t *GL_FindImage(char *name, imagetype_t type); diff --git a/games/qudos/files/patch-src_ref__gl_gl__image.c b/games/qudos/files/patch-src_ref__gl_gl__image.c new file mode 100644 index 000000000000..74a9cf4f8777 --- /dev/null +++ b/games/qudos/files/patch-src_ref__gl_gl__image.c @@ -0,0 +1,90 @@ +--- src/ref_gl/gl_image.c.orig 2006-06-02 18:14:31 UTC ++++ src/ref_gl/gl_image.c +@@ -477,7 +477,7 @@ Scrap_Upload(void) + /* + * ============== LoadPCX ============== + */ +-void ++static void + LoadPCX(char *filename, byte ** pic, byte ** palette, int *width, int *height) + { + byte *raw; +@@ -602,7 +602,7 @@ typedef struct _TargaHeader { + * ============= LoadTGA NiceAss: LoadTGA() from Q2Ice, it supports more + * formats ============= + */ +-void ++static void + LoadTGA(char *filename, byte ** pic, int *width, int *height) + { + int w, h, x, y, i, temp1, temp2; +@@ -888,19 +888,19 @@ LoadTGA(char *filename, byte ** pic, int *width, int * + * ================================================================= + */ + +-void ++static void + jpg_null(j_decompress_ptr cinfo) + { + } + +-boolean ++static boolean + jpg_fill_input_buffer(j_decompress_ptr cinfo) + { + ri.Con_Printf(PRINT_ALL, "Premature end of JPEG data\n"); + return 1; + } + +-void ++static void + jpg_skip_input_data(j_decompress_ptr cinfo, long num_bytes) + { + +@@ -911,8 +911,8 @@ jpg_skip_input_data(j_decompress_ptr cinfo, long num_b + ri.Con_Printf(PRINT_ALL, "Premature end of JPEG data\n"); + } + +-void +-jpeg_mem_src(j_decompress_ptr cinfo, byte * mem, int len) ++static void ++local_jpeg_mem_src(j_decompress_ptr cinfo, byte *mem, int len) + { + cinfo->src = (struct jpeg_source_mgr *)(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, sizeof(struct jpeg_source_mgr)); + cinfo->src->init_source = jpg_null; +@@ -927,7 +927,7 @@ jpeg_mem_src(j_decompress_ptr cinfo, byte * mem, int l + /* + * ============== LoadJPG ============== + */ +-void ++static void + LoadJPG(char *filename, byte ** pic, int *width, int *height) + { + struct jpeg_decompress_struct cinfo; +@@ -956,7 +956,7 @@ LoadJPG(char *filename, byte ** pic, int *width, int * + jpeg_create_decompress(&cinfo); + + /* Feed JPEG memory into the libJpeg Object */ +- jpeg_mem_src(&cinfo, rawdata, rawsize); ++ local_jpeg_mem_src(&cinfo, rawdata, rawsize); + + /* Process JPEG header */ + jpeg_read_header(&cinfo, true); +@@ -1139,7 +1139,7 @@ fReadData(png_structp png, png_bytep data, png_size_t + * ============================================================= + */ + +-void ++static void + LoadPNG(char *filename, byte ** pic, int *width, int *height) + { + png_structp png; +@@ -1186,7 +1186,7 @@ LoadPNG(char *filename, byte ** pic, int *width, int * + if (my_png->ColorType == PNG_COLOR_TYPE_PALETTE) + png_set_palette_to_rgb(png); + if (my_png->ColorType == PNG_COLOR_TYPE_GRAY && my_png->BitDepth < 8) +- png_set_gray_1_2_4_to_8(png); ++ png_set_expand_gray_1_2_4_to_8(png); + + /* Add alpha channel if present */ + if (png_get_valid(png, pnginfo, PNG_INFO_tRNS))