aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordanfe <danfe@FreeBSD.org>2017-04-06 01:58:37 +0800
committerdanfe <danfe@FreeBSD.org>2017-04-06 01:58:37 +0800
commit01339e830fc7f96b1ca0e4b7f55d4c7a115027f5 (patch)
tree6b3cfc91b70249e55cc6b5f96854452fc6e6c0bb
parent11e1fa30d317bdba694d7f6bc87fb747e44fa68a (diff)
downloadfreebsd-ports-gnome-01339e830fc7f96b1ca0e4b7f55d4c7a115027f5.tar.gz
freebsd-ports-gnome-01339e830fc7f96b1ca0e4b7f55d4c7a115027f5.tar.zst
freebsd-ports-gnome-01339e830fc7f96b1ca0e4b7f55d4c7a115027f5.zip
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)
-rw-r--r--games/quake2lnx/Makefile16
-rw-r--r--games/quake2lnx/files/patch-src_linux_rw__x11.c9
-rw-r--r--games/quake2lnx/files/patch-src_ref__candygl_qgl.h22
-rw-r--r--games/quake2lnx/files/patch-src_ref__gl_qgl.h13
-rw-r--r--games/quake2lnx/pkg-plist9
5 files changed, 64 insertions, 5 deletions
diff --git a/games/quake2lnx/Makefile b/games/quake2lnx/Makefile
index 566ed2245573..c37719c6a41f 100644
--- a/games/quake2lnx/Makefile
+++ b/games/quake2lnx/Makefile
@@ -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>
diff --git a/games/quake2lnx/files/patch-src_linux_rw__x11.c b/games/quake2lnx/files/patch-src_linux_rw__x11.c
index 72144026f5a4..52b74502d5c0 100644
--- a/games/quake2lnx/files/patch-src_linux_rw__x11.c
+++ b/games/quake2lnx/files/patch-src_linux_rw__x11.c
@@ -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;
diff --git a/games/quake2lnx/files/patch-src_ref__candygl_qgl.h b/games/quake2lnx/files/patch-src_ref__candygl_qgl.h
new file mode 100644
index 000000000000..01aedbf48603
--- /dev/null
+++ b/games/quake2lnx/files/patch-src_ref__candygl_qgl.h
@@ -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);
diff --git a/games/quake2lnx/files/patch-src_ref__gl_qgl.h b/games/quake2lnx/files/patch-src_ref__gl_qgl.h
new file mode 100644
index 000000000000..e9164445d3b6
--- /dev/null
+++ b/games/quake2lnx/files/patch-src_ref__gl_qgl.h
@@ -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);
diff --git a/games/quake2lnx/pkg-plist b/games/quake2lnx/pkg-plist
index 5729b86bb140..4070d79d20a2 100644
--- a/games/quake2lnx/pkg-plist
+++ b/games/quake2lnx/pkg-plist
@@ -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 ===