summaryrefslogtreecommitdiff
path: root/games
diff options
context:
space:
mode:
authorkamil <kamil@pkgsrc.org>2016-06-11 18:41:56 +0000
committerkamil <kamil@pkgsrc.org>2016-06-11 18:41:56 +0000
commit4f381f2bd2b9f7175f8aed2a7f5d84adc538e363 (patch)
tree54ebaaa488338d49eead7aac6391744c6f122914 /games
parentdeae5ac657f41073ffde8cd03ec3edab7d391419 (diff)
downloadpkgsrc-4f381f2bd2b9f7175f8aed2a7f5d84adc538e363.tar.gz
Import pmars-0.9.2 as games/pmars
Core War is a game in which two or more virus-like programs fight against each other in a simulated memory space or core. Core War programs are written in an assembly language called Redcode which is interpreted by a Core War simulator or MARS (Memory Array Redcode Simulator). The object of the game is to prevent the other program(s) from executing.
Diffstat (limited to 'games')
-rw-r--r--games/pmars/DESCR7
-rw-r--r--games/pmars/Makefile28
-rw-r--r--games/pmars/PLIST15
-rw-r--r--games/pmars/distinfo11
-rw-r--r--games/pmars/patches/patch-src_Makefile27
-rw-r--r--games/pmars/patches/patch-src_cdb.c24
-rw-r--r--games/pmars/patches/patch-src_sim.c41
-rw-r--r--games/pmars/patches/patch-src_sim.h15
-rw-r--r--games/pmars/patches/patch-src_xwindisp.c17
9 files changed, 185 insertions, 0 deletions
diff --git a/games/pmars/DESCR b/games/pmars/DESCR
new file mode 100644
index 00000000000..61f1a2087e5
--- /dev/null
+++ b/games/pmars/DESCR
@@ -0,0 +1,7 @@
+Core War is a game in which two or more virus-like programs fight against
+each other in a simulated memory space or core.
+
+Core War programs are written in an assembly language called Redcode which is
+interpreted by a Core War simulator or MARS (Memory Array Redcode Simulator).
+
+The object of the game is to prevent the other program(s) from executing.
diff --git a/games/pmars/Makefile b/games/pmars/Makefile
new file mode 100644
index 00000000000..37ffbcdf908
--- /dev/null
+++ b/games/pmars/Makefile
@@ -0,0 +1,28 @@
+# $NetBSD: Makefile,v 1.1 2016/06/11 18:43:24 kamil Exp $
+#
+
+DISTNAME= pmars-0.9.2
+CATEGORIES= games
+MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=corewar/}
+
+MAINTAINER= pkgsrc-users@NetBSD.org
+HOMEPAGE= http://www.koth.org/pmars/
+COMMENT= The official Core Wars simulator
+LICENSE= gnu-gpl-v2
+
+BUILD_MAKE_FLAGS+= -C src
+BUILD_MAKE_FLAGS+= CC=${CC:Q}
+BUILD_MAKE_FLAGS+= LIB="-Wl,-rpath,${BUILDLINK_PREFIX.libX11}/lib -lX11"
+
+INSTALLATION_DIRS+= bin share/pmars share/pmars/config share/pmars/warriors ${PKGMANDIR}/man6
+
+do-install:
+ ${INSTALL_PROGRAM} ${WRKSRC}/src/pmars ${DESTDIR}${PREFIX}/bin
+ ${INSTALL_DATA} ${WRKSRC}/README ${DESTDIR}${PREFIX}/share/pmars
+ ${INSTALL_DATA} ${WRKSRC}/CONTRIB ${DESTDIR}${PREFIX}/share/pmars
+ ${INSTALL_DATA} ${WRKSRC}/config/* ${DESTDIR}${PREFIX}/share/pmars/config
+ ${INSTALL_DATA} ${WRKSRC}/warriors/* ${DESTDIR}${PREFIX}/share/pmars/warriors
+ ${INSTALL_MAN} ${WRKSRC}/doc/pmars.6 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man6
+
+.include "../../x11/libX11/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/games/pmars/PLIST b/games/pmars/PLIST
new file mode 100644
index 00000000000..5caf9c74a54
--- /dev/null
+++ b/games/pmars/PLIST
@@ -0,0 +1,15 @@
+@comment $NetBSD: PLIST,v 1.1 2016/06/11 18:43:24 kamil Exp $
+bin/pmars
+man/man6/pmars.6
+share/pmars/CONTRIB
+share/pmars/README
+share/pmars/config/94x.opt
+share/pmars/config/icws.opt
+share/pmars/config/mw.mac
+share/pmars/config/pmars.mac
+share/pmars/config/x.opt
+share/pmars/warriors/aeka.red
+share/pmars/warriors/flashpaper.red
+share/pmars/warriors/pspace.red
+share/pmars/warriors/rave.red
+share/pmars/warriors/validate.red
diff --git a/games/pmars/distinfo b/games/pmars/distinfo
new file mode 100644
index 00000000000..fbb57161378
--- /dev/null
+++ b/games/pmars/distinfo
@@ -0,0 +1,11 @@
+$NetBSD: distinfo,v 1.1 2016/06/11 18:43:24 kamil Exp $
+
+SHA1 (pmars-0.9.2.tar.gz) = b49162a4f63ed6c4e94e28b762c41ff73057b99f
+RMD160 (pmars-0.9.2.tar.gz) = d0f6ca86633424b10d54b418ee371fd6bf987e35
+SHA512 (pmars-0.9.2.tar.gz) = 901adb3e1620a3ff23810514001926e233c7654b623d3d7c2541598141e539647d5a9a04b8da166f2f01c24afca95351affd51c10267ccaffd6d1bd0788545af
+Size (pmars-0.9.2.tar.gz) = 158415 bytes
+SHA1 (patch-src_Makefile) = 33b7617dc7d67bbd82258c02ce16a20746a0aad0
+SHA1 (patch-src_cdb.c) = 77e8fe6280cf844a80aeaf8477affe92d4b6cb66
+SHA1 (patch-src_sim.c) = a3a9480f930de346b13653d970c0fc10c67d6ce4
+SHA1 (patch-src_sim.h) = d68c1b49bbf863527268d1a5796e81481e9022b8
+SHA1 (patch-src_xwindisp.c) = 226a7a79db69c97667059f6113ac5a6599da8c5c
diff --git a/games/pmars/patches/patch-src_Makefile b/games/pmars/patches/patch-src_Makefile
new file mode 100644
index 00000000000..f64fda7c4e0
--- /dev/null
+++ b/games/pmars/patches/patch-src_Makefile
@@ -0,0 +1,27 @@
+$NetBSD: patch-src_Makefile,v 1.1 2016/06/11 18:41:56 kamil Exp $
+
+Improve readability of $(CC)
+
+--- src/Makefile.orig 2000-12-24 12:53:39.000000000 +0000
++++ src/Makefile
+@@ -37,8 +37,7 @@ flags:
+
+ $(MAINFILE): $(OBJ1) $(OBJ2) $(OBJ3)
+ @echo Linking $(MAINFILE)
+- @$(CC) -o $(MAINFILE) $(OBJ1) $(OBJ2) $(OBJ3) $(LIB)
+- @strip $(MAINFILE)
++ $(CC) -o $(MAINFILE) $(OBJ1) $(OBJ2) $(OBJ3) $(LIB)
+ @echo done
+
+ token.o asm.o disasm.o: asm.h
+@@ -55,9 +54,8 @@ $(OBJ1) $(OBJ2) $(OBJ3): Makefile config
+
+ .c.o:
+ @echo Compiling $*.o
+- @$(CC) $(CFLAGS) -c $*.c
++ $(CC) $(CFLAGS) -c $*.c
+
+
+ clean:
+ rm -f $(OBJ1) $(OBJ2) $(OBJ3) core
+-
diff --git a/games/pmars/patches/patch-src_cdb.c b/games/pmars/patches/patch-src_cdb.c
new file mode 100644
index 00000000000..7a6dc6f6939
--- /dev/null
+++ b/games/pmars/patches/patch-src_cdb.c
@@ -0,0 +1,24 @@
+$NetBSD: patch-src_cdb.c,v 1.1 2016/06/11 18:41:56 kamil Exp $
+
+Fix name clash with builtin 'round'.
+
+--- src/cdb.c.orig 2000-12-25 00:49:07.000000000 +0000
++++ src/cdb.c
+@@ -1564,7 +1564,7 @@ subst_eval(inpStr, result)
+ (warriorsLeft ? warriorsLeft : 1));
+ substitute(buf[bi1], "CYCLE", outs, buf[bi2]);
+ SWITCHBI;
+- sprintf(outs, "%d", round);
++ sprintf(outs, "%d", sim_round);
+ substitute(buf[bi1], "ROUND", outs, buf[bi2]);
+
+ SWITCHBI;
+@@ -1875,7 +1875,7 @@ print_registers()
+ #endif
+ int nFuture, nPast, count, taskHalf = (coreSize <= 10000 ? 7 : 5);
+
+- sprintf(outs, roundOfCycle, round, rounds,
++ sprintf(outs, roundOfCycle, sim_round, rounds,
+ (cycle + (warriorsLeft ? warriorsLeft : 1) - 1) /
+ (warriorsLeft ? warriorsLeft : 1));
+ cdb_fputs(outs, COND);
diff --git a/games/pmars/patches/patch-src_sim.c b/games/pmars/patches/patch-src_sim.c
new file mode 100644
index 00000000000..728b94c5de2
--- /dev/null
+++ b/games/pmars/patches/patch-src_sim.c
@@ -0,0 +1,41 @@
+$NetBSD: patch-src_sim.c,v 1.1 2016/06/11 18:41:56 kamil Exp $
+
+Fix name clash with builtin 'round'.
+
+--- src/sim.c.orig 2000-12-25 00:49:08.000000000 +0000
++++ src/sim.c
+@@ -177,7 +177,7 @@ ADDR_T AA_Value, AB_Value;
+ mem_struct FAR *memory;
+
+ long cycle;
+-int round;
++int sim_round;
+
+ char alloc_p = 0; /* indicate whether memory has been allocated */
+ int warriorsLeft; /* number of warriors still left in core */
+@@ -311,7 +311,7 @@ register int temp;
+ #endif
+
+ display_init();
+- round = 1;
++ sim_round = 1;
+ do { /* each round */
+ #if defined(DOS16) && !defined(SERVER) && !defined(DOSTXTGRAPHX) && !defined(DOSGRXGRAPHX) && !defined(DJGPP)
+ fputc('\r', stdout); /* enable interruption by Ctrl-C */
+@@ -1325,13 +1325,13 @@ nextround:
+ #ifndef SERVER
+ if (debugState == BREAK) {
+ if (warriorsLeft == 1 && warriors != 1)
+- sprintf(outs, warriorTerminatedEndOfRound, W - warrior, W->name, round);
++ sprintf(outs, warriorTerminatedEndOfRound, W - warrior, W->name, sim_round);
+ else
+- sprintf(outs, endOfRound, round);
++ sprintf(outs, endOfRound, sim_round);
+ debugState = cdb(outs);
+ }
+ #endif
+- } while (++round <= rounds);
++ } while (++sim_round <= rounds);
+
+ display_close();
+ #ifdef PERMUTATE
diff --git a/games/pmars/patches/patch-src_sim.h b/games/pmars/patches/patch-src_sim.h
new file mode 100644
index 00000000000..de3b1dce28f
--- /dev/null
+++ b/games/pmars/patches/patch-src_sim.h
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_sim.h,v 1.1 2016/06/11 18:41:56 kamil Exp $
+
+Fix name clash with builtin 'round'.
+
+--- src/sim.h.orig 2000-08-20 13:29:44.000000000 +0000
++++ src/sim.h
+@@ -89,7 +89,7 @@ extern int displayMode;
+ #define FAR
+ #endif
+
+-extern int round;
++extern int sim_round;
+ extern long cycle;
+ extern ADDR_T progCnt; /* program counter */
+ extern warrior_struct *W; /* indicate which warrior is running */
diff --git a/games/pmars/patches/patch-src_xwindisp.c b/games/pmars/patches/patch-src_xwindisp.c
new file mode 100644
index 00000000000..c7f2a938bfa
--- /dev/null
+++ b/games/pmars/patches/patch-src_xwindisp.c
@@ -0,0 +1,17 @@
+$NetBSD: patch-src_xwindisp.c,v 1.1 2016/06/11 18:41:56 kamil Exp $
+
+Fix build issue on NetBSD. I don't know what is sighandler(0).
+
+--- src/xwindisp.c.orig 2000-09-28 11:03:56.000000000 +0000
++++ src/xwindisp.c
+@@ -1281,8 +1281,9 @@ xWin_display_cycle()
+ break;
+
+ case 'd':
+- sighandler(0); /* ??? debugState = STEP; *//* stepping =
++ /*sighandler(0);*/ /* ??? debugState = STEP; *//* stepping =
+ * FALSE; */
++ fprintf(stderr, "unsupported");
+ break;
+
+ case '>':