aboutsummaryrefslogtreecommitdiffstats
path: root/games
diff options
context:
space:
mode:
authordanfe <danfe@FreeBSD.org>2017-03-31 17:13:11 +0800
committerdanfe <danfe@FreeBSD.org>2017-03-31 17:13:11 +0800
commitd3a73767dcafc63b064d5d5a4a8cefbe7c9aacb3 (patch)
treee4ada85a15571c3a64db6d1aab21c6b3f5260cfb /games
parentcc907a0624cab4e020777955f744ddceeabcbbd8 (diff)
downloadfreebsd-ports-gnome-d3a73767dcafc63b064d5d5a4a8cefbe7c9aacb3.tar.gz
freebsd-ports-gnome-d3a73767dcafc63b064d5d5a4a8cefbe7c9aacb3.tar.zst
freebsd-ports-gnome-d3a73767dcafc63b064d5d5a4a8cefbe7c9aacb3.zip
Make sure `games/cake' runs OK on amd64 (and possibly other 64-bit
architectures): - Console::SetFontSize() method calls Console::Recalculate_NLines() which might access ConsoleLines[] array before it is constructed, Recalculate_NLines() is explicitly called after ConsoleLines[] is allocated and populated, so just comment out problematic call in SetFontSize(); it is called only once anyway (the problem did not exhibit itself on i386 for some reason); - The code assumes that sizeof(long) == 4 in too many places, e.g. in on-disk file format layouts and such. Fixing all structures would be too much trouble; instead, simply replace those long's with int's, [un]signed as appropriate.
Diffstat (limited to 'games')
-rw-r--r--games/cake/Makefile11
1 files changed, 10 insertions, 1 deletions
diff --git a/games/cake/Makefile b/games/cake/Makefile
index a0cb7749cd5e..428ce52b3dec 100644
--- a/games/cake/Makefile
+++ b/games/cake/Makefile
@@ -3,7 +3,7 @@
PORTNAME= cake
PORTVERSION= 2005.12.26
-PORTREVISION= 10
+PORTREVISION= 11
CATEGORIES= games
MASTER_SITES= http://freebsd.nsu.ru/distfiles/
DISTNAME= ${PORTNAME}_src_${PORTVERSION:S/.//g}
@@ -39,6 +39,15 @@ post-patch: .SILENT
${WRKSRC}/cake/sound.h
# Use traditional mapping for console key (tilde)
${REINPLACE_CMD} -e 's/167/96/' ${WRKSRC}/main.cpp
+# Avoid segmentation fault on amd64 (uninitialized memory access)
+ ${REINPLACE_CMD} -e '1281s:Recalculate_NLines()://&:' \
+ ${WRKSRC}/cake/console.cpp
+# The code assumes that sizeof(long) == 4 in too many places :(
+ ${REINPLACE_CMD} -e '/typedef/s/ long//' ${WRKSRC}/cake/files.h
+ ${REINPLACE_CMD} -e '/typedef/s/long/int/' ${WRKSRC}/cake/types.h
+ ${REINPLACE_CMD} -e 's/unsigned long/DWORD/' ${WRKSRC}/cake/system.h
+ ${REINPLACE_CMD} -e 's/unsigned long/unsigned int/' \
+ ${WRKSRC}/cake/zip/Crc32.h ${WRKSRC}/cake/zip/Unzip.h
# Fixes for GCC 4.x and Clang 4.0
${REINPLACE_CMD} -e 's/Mat3x2:://' ${WRKSRC}/cake/math.h
${REINPLACE_CMD} -e '2852s/numverts/&[0]/' ${WRKSRC}/cake/q3bsp.cpp