summaryrefslogtreecommitdiff
path: root/games/craft
diff options
context:
space:
mode:
authordholland <dholland@pkgsrc.org>2020-11-29 03:11:54 +0000
committerdholland <dholland@pkgsrc.org>2020-11-29 03:11:54 +0000
commit5989edcdd26a1af96841a2d6fa67c36e52b65ee5 (patch)
treee47805c7b8b24cc99274cf6dc7c865d68cdf65b6 /games/craft
parentf3f69679c4b141dd6278a85f0cb351eaa6fd7c69 (diff)
downloadpkgsrc-5989edcdd26a1af96841a2d6fa67c36e52b65ee5.tar.gz
Make games/craft build again.
The custom C++ preprocessor thingy has been choking for a while on clang; recently gcc's jointed the party. Work around this by building it with -g instead of -O2. (For me at least with gcc, while -O2 produces a tool that gives spurious syntax errors, plain -O gives one that loops forever instead, which isn't an improvement.) Maybe someday someone will bother to find out where the undefined behavior is. Also build the actual game with -Wno-return-type to silence complaints about dead functions not declared as dead and similar, and while here adjust things so it still installs correctly regardless of umask.
Diffstat (limited to 'games/craft')
-rw-r--r--games/craft/Makefile10
-rw-r--r--games/craft/distinfo3
-rw-r--r--games/craft/patches/patch-Makefile23
3 files changed, 33 insertions, 3 deletions
diff --git a/games/craft/Makefile b/games/craft/Makefile
index f4d71b27577..9a6fb6baa78 100644
--- a/games/craft/Makefile
+++ b/games/craft/Makefile
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.34 2019/11/03 19:28:47 rillig Exp $
+# $NetBSD: Makefile,v 1.35 2020/11/29 03:11:54 dholland Exp $
DISTNAME= craftcc35
PKGNAME= craft-3.5
-PKGREVISION= 4
+PKGREVISION= 5
CATEGORIES= games x11
MASTER_SITES= http://ibiblio.org/pub/linux/games/strategy/
EXTRACT_SUFX= .tar.Z
@@ -38,6 +38,11 @@ SUBST_SED.buttons= -e 's+buttons+${PREFIX}/share/craft/buttons+'
INSTALLATION_DIRS= bin
+.include "../../mk/compiler.mk"
+.if !empty(PKGSRC_COMPILER:Mclang) || !empty(PKGSRC_COMPILER:Mgcc)
+CFLAGS+=-Wno-return-type
+.endif
+
post-extract:
find ${WRKSRC} -type f -name '*~' -print | xargs rm -f
for f in `find ${WRKSRC} -name "*.hc" -type f -print`; do \
@@ -47,6 +52,7 @@ post-extract:
${CHMOD} a-x ${WRKSRC}/html/pic/craft.gif.old
${CHMOD} a-x ${WRKSRC}/html/craftcc.html
rm -f ${WRKSRC}/hcc/hcc
+ ${CHMOD} -R go+rX ${WRKSRC}/hcraft ${WRKSRC}/buttons ${WRKSRC}/html
.include "../../x11/libX11/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
diff --git a/games/craft/distinfo b/games/craft/distinfo
index 00e3c0f6634..9ecd4c5ba90 100644
--- a/games/craft/distinfo
+++ b/games/craft/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.13 2015/11/03 20:56:46 agc Exp $
+$NetBSD: distinfo,v 1.14 2020/11/29 03:11:54 dholland Exp $
SHA1 (craft-jumbo-patch-20140913.gz) = 8bb0f2e67bda9e8e7cb093db3625958f0fd6ed39
RMD160 (craft-jumbo-patch-20140913.gz) = 95d696f9ccd227f23f28cb898b9af54c7fbc18ad
@@ -8,5 +8,6 @@ SHA1 (craftcc35.tar.Z) = 8862b9001aa7d752a597033ef45d38ebfcee533f
RMD160 (craftcc35.tar.Z) = 402a2c2ca37df4d86381b434437395424199859e
SHA512 (craftcc35.tar.Z) = 8b83e98eb352ed1a7ec391c80906c84f50bd72d57a804f629a160597e31cf8df9cf83ec9dd2a78e4dee0147482a359c3a47844693f9be38abee7dcf730a4c67d
Size (craftcc35.tar.Z) = 3123677 bytes
+SHA1 (patch-Makefile) = 1f6074b445c70fbb5fea5a373dcfa4556310ef60
SHA1 (patch-craft.hc) = 21bfc32566d3f0ccee65fe52871704457ffaa1cc
SHA1 (patch-object__handler.hc) = c5143b605d37aef793ffa07b9191d777a5b9c8f3
diff --git a/games/craft/patches/patch-Makefile b/games/craft/patches/patch-Makefile
new file mode 100644
index 00000000000..dd9c4b8c797
--- /dev/null
+++ b/games/craft/patches/patch-Makefile
@@ -0,0 +1,23 @@
+$NetBSD: patch-Makefile,v 1.1 2020/11/29 03:11:54 dholland Exp $
+
+Build the preprocessor front end thingy with -g instead of with -O2.
+
+With -O2 it crashes with a message about EOF inside a string constant;
+this has been happening with clang for a while and gcc recently joined
+the party. With just -O, it loops forever instead for me, which isn't
+an improvement.
+
+This should serve as a workaround until someone gets around to
+figuring out where the undefined behavior is.
+
+--- Makefile~ 2020-11-29 02:36:49.745300963 +0000
++++ Makefile
+@@ -42,7 +42,7 @@ depend:
+ @false
+
+ ${HCC}: hcc/hcc.cc
+- ${CXX} ${CFLAGS} hcc/hcc.cc -o hcc/hcc
++ ${CXX} ${CFLAGS:S/-O2/-g/} hcc/hcc.cc -o hcc/hcc
+
+ install:
+ [ -d ${DESTDIR} ]