Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 5 Apr 2017 17:58:37 +0000 (UTC)
From:      Alexey Dokuchaev <danfe@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r437802 - in head/games/quake2lnx: . files
Message-ID:  <201704051758.v35Hwbh0089669@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: danfe
Date: Wed Apr  5 17:58:37 2017
New Revision: 437802
URL: https://svnweb.freebsd.org/changeset/ports/437802

Log:
  Fix a couple of bugs that prevented `games/quake2lnx' from fully working
  on amd64 (and likely other 64-bit architectures):
  
  - Prototype for `void *qwglGetProcAddress(char *symbol)' was guarded by
    #ifdef __linux__; this was not a problem on i386, where sizeof(void *)
    /actual return type/ == sizeof(int) /assumed return type of undeclared
    function/.  On amd64, returned pointer would sometimes get truncated,
    leading to a program's crash.  Mend this by turning `#ifdef __linux__'
    condition essentially into `#ifndef _WIN32'
  - Software renderer was typedef'ing PIXEL24 as `unsigned long'; fix it
    by using `unsigned int' type instead
  - Remove `-s' from OPTIMIZED_CFLAGS: stripping is taken care of during
    installation (subject to WITH_DEBUG); also remove optimization flag
    `-fexpensive-optimizations' as it is not being supported by Clang
  - While here, fix `version' console command to report correct operating
    system and architecture names
  - Employ options helper target to install documentation; add more useful
    changelogs and drop `quake2.3dfxgl' file (meaningless these days)

Added:
  head/games/quake2lnx/files/patch-src_ref__candygl_qgl.h   (contents, props changed)
  head/games/quake2lnx/files/patch-src_ref__gl_qgl.h   (contents, props changed)
Modified:
  head/games/quake2lnx/Makefile
  head/games/quake2lnx/files/patch-src_linux_rw__x11.c
  head/games/quake2lnx/pkg-plist

Modified: head/games/quake2lnx/Makefile
==============================================================================
--- head/games/quake2lnx/Makefile	Wed Apr  5 17:55:23 2017	(r437801)
+++ head/games/quake2lnx/Makefile	Wed Apr  5 17:58:37 2017	(r437802)
@@ -3,7 +3,7 @@
 
 PORTNAME=	quake2lnx
 PORTVERSION=	0.16.2
-PORTREVISION=	13
+PORTREVISION=	14
 CATEGORIES=	games
 MASTER_SITES=	http://offload1.icculus.org/quake2/files/
 DISTNAME=	quake2-r${PORTVERSION}
@@ -181,7 +181,7 @@ MAKE_ARGS+=	HAVE_IPV6=YES
 .endif
 
 .if ${PORT_OPTIONS:MOPTIMIZED_CFLAGS}
-MAKE_ARGS+=	OPTIMIZED_CFLAGS="-O3 -s -ffast-math -funroll-loops -fomit-frame-pointer -fexpensive-optimizations"
+MAKE_ARGS+=	OPTIMIZED_CFLAGS="-O3 -ffast-math -funroll-loops -fomit-frame-pointer"
 .endif
 
 .if ! ${PORT_OPTIONS:MASM}
@@ -201,6 +201,9 @@ post-patch: .SILENT
 	${REINPLACE_CMD} -e 's|/js|/joy|' ${WRKSRC}/src/linux/joystick.c
 	${REINPLACE_CMD} -e 's|jpeg_mem_src|local_&|' \
 		${WRKSRC}/src/ref_candygl/gl_image.c
+	${REINPLACE_CMD} -e '/BUILDSTRING/s|Linux|${OPSYS}|' \
+		-e '/CPUSTRING/s|Unknown|${ARCH}|' \
+		${WRKSRC}/src/qcommon/qcommon.h
 
 do-install:
 .for tgt in ${EXE_TARGETS}
@@ -224,12 +227,17 @@ do-install:
 	${INSTALL_PROGRAM} ${WRKSRC}/release/game.so \
 		${STAGEDIR}${LIBDIR}/baseq2
 .endif
+
+post-install-DOCS-on:
 	@${MKDIR} ${STAGEDIR}${DOCSDIR}
+	${INSTALL_DATA} ${WRKSRC}/src/docs/3.*_Changes.txt \
+		${STAGEDIR}${DOCSDIR}
 	${INSTALL_DATA} ${WRKSRC}/README ${STAGEDIR}${DOCSDIR}
 	${INSTALL_DATA} ${WRKSRC}/src/docs/README \
 		${STAGEDIR}${DOCSDIR}/README.320
-	${INSTALL_DATA} ${WRKSRC}/src/docs/joystick.txt ${STAGEDIR}${DOCSDIR}
-	${INSTALL_DATA} ${WRKSRC}/src/docs/quake2.3dfxgl ${STAGEDIR}${DOCSDIR}
+	${INSTALL_DATA} ${WRKSRC}/src/docs/changes.txt \
+		${WRKSRC}/src/docs/joystick.txt \
+		${WRKSRC}/src/docs/readme.txt ${STAGEDIR}${DOCSDIR}
 
 .include "${.CURDIR}/../quake2-data/Makefile.include"
 .include <bsd.port.mk>

Modified: head/games/quake2lnx/files/patch-src_linux_rw__x11.c
==============================================================================
--- head/games/quake2lnx/files/patch-src_linux_rw__x11.c	Wed Apr  5 17:55:23 2017	(r437801)
+++ head/games/quake2lnx/files/patch-src_linux_rw__x11.c	Wed Apr  5 17:58:37 2017	(r437802)
@@ -1,5 +1,14 @@
 --- src/linux/rw_x11.c.orig	Wed Oct  9 03:54:25 2002
 +++ src/linux/rw_x11.c	Mon Jun 16 23:19:40 2003
+@@ -151,7 +151,7 @@
+ int config_notify_height;
+ 						      
+ typedef unsigned short PIXEL16;
+-typedef unsigned long PIXEL24;
++typedef unsigned int PIXEL24;
+ #ifdef REDBLUE
+ static PIXEL16 st2d_8to16table_s[2][256];
+ static PIXEL24 st2d_8to24table_s[2][256];
 @@ -446,7 +446,7 @@
  qboolean OpenJoystick(cvar_t *joy_dev) {
    int i, err;

Added: head/games/quake2lnx/files/patch-src_ref__candygl_qgl.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/games/quake2lnx/files/patch-src_ref__candygl_qgl.h	Wed Apr  5 17:58:37 2017	(r437802)
@@ -0,0 +1,22 @@
+--- src/ref_candygl/qgl.h.orig	2002-06-17 20:03:07 UTC
++++ src/ref_candygl/qgl.h
+@@ -30,7 +30,7 @@ Foundation, Inc., 59 Temple Place - Suit
+ 
+ #include <GL/gl.h>
+ 
+-#ifdef __linux__
++#ifndef _WIN32
+ //#include <GL/fxmesa.h>
+ #include <GL/glx.h>
+ #endif
+@@ -428,9 +428,7 @@ extern BOOL ( WINAPI * qwglSwapIntervalE
+ extern BOOL ( WINAPI * qwglGetDeviceGammaRampEXT ) ( unsigned char *pRed, unsigned char *pGreen, unsigned char *pBlue );
+ extern BOOL ( WINAPI * qwglSetDeviceGammaRampEXT ) ( const unsigned char *pRed, const unsigned char *pGreen, const unsigned char *pBlue );
+ 
+-#endif
+-
+-#ifdef __linux__
++#else
+ 
+ // local function in dll
+ extern void *qwglGetProcAddress(char *symbol);

Added: head/games/quake2lnx/files/patch-src_ref__gl_qgl.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/games/quake2lnx/files/patch-src_ref__gl_qgl.h	Wed Apr  5 17:58:37 2017	(r437802)
@@ -0,0 +1,13 @@
+--- src/ref_gl/qgl.h.orig	2004-05-02 19:36:53 UTC
++++ src/ref_gl/qgl.h
+@@ -426,9 +426,7 @@ extern BOOL ( WINAPI * qwglSwapIntervalE
+ extern BOOL ( WINAPI * qwglGetDeviceGammaRampEXT ) ( unsigned char *pRed, unsigned char *pGreen, unsigned char *pBlue );
+ extern BOOL ( WINAPI * qwglSetDeviceGammaRampEXT ) ( const unsigned char *pRed, const unsigned char *pGreen, const unsigned char *pBlue );
+ 
+-#endif
+-
+-#ifdef __linux__
++#else
+ 
+ // local function in dll
+ extern void *qwglGetProcAddress(char *symbol);

Modified: head/games/quake2lnx/pkg-plist
==============================================================================
--- head/games/quake2lnx/pkg-plist	Wed Apr  5 17:55:23 2017	(r437801)
+++ head/games/quake2lnx/pkg-plist	Wed Apr  5 17:58:37 2017	(r437802)
@@ -12,10 +12,17 @@
 %%SOFTSDL%%%%LIBDIR%%/ref_softsdl.so
 %%X11%%%%LIBDIR%%/ref_softx.so
 @comment === DOCS ===
+%%PORTDOCS%%%%DOCSDIR%%/3.15_Changes.txt
+%%PORTDOCS%%%%DOCSDIR%%/3.16_Changes.txt
+%%PORTDOCS%%%%DOCSDIR%%/3.17_Changes.txt
+%%PORTDOCS%%%%DOCSDIR%%/3.19_Changes.txt
+%%PORTDOCS%%%%DOCSDIR%%/3.20_Changes.txt
+%%PORTDOCS%%%%DOCSDIR%%/3.21_Changes.txt
 %%PORTDOCS%%%%DOCSDIR%%/README
 %%PORTDOCS%%%%DOCSDIR%%/README.320
+%%PORTDOCS%%%%DOCSDIR%%/changes.txt
 %%PORTDOCS%%%%DOCSDIR%%/joystick.txt
-%%PORTDOCS%%%%DOCSDIR%%/quake2.3dfxgl
+%%PORTDOCS%%%%DOCSDIR%%/readme.txt
 @comment === DATA ===
 %%QMAX%%%%LIBDIR%%/baseq2/maxpak.pak
 @comment === CLEANUP ===



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201704051758.v35Hwbh0089669>