aboutsummaryrefslogtreecommitdiff
path: root/games/cake
diff options
context:
space:
mode:
authorAlexey Dokuchaev <danfe@FreeBSD.org>2017-03-31 09:13:11 +0000
committerAlexey Dokuchaev <danfe@FreeBSD.org>2017-03-31 09:13:11 +0000
commitd76edebd41ae66222ac542bbe5d7fec39a80a2cb (patch)
treee4ada85a15571c3a64db6d1aab21c6b3f5260cfb /games/cake
parentbcecbd8f51538d144eba9a04ddec0ab45f8f5b01 (diff)
downloadports-d76edebd41ae66222ac542bbe5d7fec39a80a2cb.tar.gz
ports-d76edebd41ae66222ac542bbe5d7fec39a80a2cb.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.
Notes
Notes: svn path=/head/; revision=437344
Diffstat (limited to 'games/cake')
-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