summaryrefslogtreecommitdiff
path: root/games
diff options
context:
space:
mode:
authorgarbled <garbled>1998-11-04 21:20:50 +0000
committergarbled <garbled>1998-11-04 21:20:50 +0000
commit6af289424ed73d7bcb4c66aebaa280c83dbc1b10 (patch)
tree515ed099bf238e012f6943d550e0639daaadfb06 /games
parentd71d4935a4482e8cd8bb795858675770e31271b0 (diff)
downloadpkgsrc-6af289424ed73d7bcb4c66aebaa280c83dbc1b10.tar.gz
Import of xworm. Heavily hacked from freebsd's version. Now works on
>8bit displays. Classic game with apples and hungry worm.
Diffstat (limited to 'games')
-rw-r--r--games/xworm/Makefile23
-rw-r--r--games/xworm/files/md51
-rw-r--r--games/xworm/patches/patch-aa38
-rw-r--r--games/xworm/patches/patch-ab70
-rw-r--r--games/xworm/pkg/COMMENT1
-rw-r--r--games/xworm/pkg/DESCR5
-rw-r--r--games/xworm/pkg/PLIST5
7 files changed, 143 insertions, 0 deletions
diff --git a/games/xworm/Makefile b/games/xworm/Makefile
new file mode 100644
index 00000000000..5be1dd47643
--- /dev/null
+++ b/games/xworm/Makefile
@@ -0,0 +1,23 @@
+# $NetBSD: Makefile,v 1.1.1.1 1998/11/04 21:20:50 garbled Exp $
+# FreeBSD Id: Makefile,v 1.3 1998/08/05 09:31:04 asami Exp
+#
+
+DISTNAME= xworm102
+PKGNAME= xworm-1.02
+CATEGORIES= games x11
+MASTER_SITES= http://www.ekran.no/archive/x/
+
+MAINTAINER= root@garbled.net
+
+ALL_TARGET= freebsd
+USE_X11= yes
+WRKSRC= ${WRKDIR}/XWorm
+
+do-install:
+ @ ${INSTALL_PROGRAM} ${WRKSRC}/xworm ${PREFIX}/bin
+ @ ${MKDIR} ${PREFIX}/share/xworm
+.for file in font grid raw
+ # ${INSTALL_DATA} ${WRKSRC}/xworm.${file} ${PREFIX}/share/xworm
+.endfor
+
+.include <bsd.port.mk>
diff --git a/games/xworm/files/md5 b/games/xworm/files/md5
new file mode 100644
index 00000000000..dd9679b3764
--- /dev/null
+++ b/games/xworm/files/md5
@@ -0,0 +1 @@
+MD5 (xworm102.tar.gz) = 17c7a53c48d4b7489d507fab020e4134
diff --git a/games/xworm/patches/patch-aa b/games/xworm/patches/patch-aa
new file mode 100644
index 00000000000..1b045f76875
--- /dev/null
+++ b/games/xworm/patches/patch-aa
@@ -0,0 +1,38 @@
+$NetBSD: patch-aa,v 1.1.1.1 1998/11/04 21:20:50 garbled Exp $
+--- Makefile.orig Wed May 7 09:28:12 1997
++++ Makefile Wed Nov 4 13:23:53 1998
+@@ -6,8 +6,9 @@
+ HPFLAGS = -O -D_HPUX_SOURCE
+ SUNFLAGS = -O
+ LINUXFLAGS = -O
++FREEBSDFLAGS= -O -DPREFIX=\"${PREFIX}/share/xworm\"
+
+-INCDIR = -I/usr/include/X11R5 -I/usr/include -I/usr/X11R6/include
++INCDIR = -I/usr/include/X11R5 -I/usr/include -I${PREFIX}/include
+
+ HPLINK = -L/usr/local/lib/X11R5 -lXt -lX11 -lm
+ SUNLINK = -L/usr/local/lib/X11R5 -lXt -lX11 -lm -lsocket -lnsl -lICE -lSM
+@@ -18,9 +19,10 @@
+ @echo " "
+ @echo "type:"
+ @echo " "
+- @echo " make hp [HP/UX and similar systems]"
+- @echo " make sun [Sun-Os/SUN systems]"
+- @echo " make linux [linux systems]"
++ @echo " make hp [HP/UX and similar systems]"
++ @echo " make sun [Sun-Os/SUN systems]"
++ @echo " make linux [linux systems]"
++ @echo " make freebsd [FreeBSD systems]"
+ @echo " "
+ @echo "xworm.font, xworm.grid and xworm.raw has to be in the same directory as xworm"
+ @echo "please check the Makefile if you have problems compiling the program"
+@@ -33,6 +35,9 @@
+
+ linux: xworm.c
+ $(CC) $(LINUXFLAGS) $(INCDIR) xworm.c -o xworm $(LINUXLINK)
++
++freebsd: xworm.c
++ $(CC) $(FREEBSDFLAGS) $(INCDIR) xworm.c -o xworm $(LINUXLINK)
+
+ clean:
+ rm -f core xworm
diff --git a/games/xworm/patches/patch-ab b/games/xworm/patches/patch-ab
new file mode 100644
index 00000000000..639d57222f6
--- /dev/null
+++ b/games/xworm/patches/patch-ab
@@ -0,0 +1,70 @@
+$NetBSD: patch-ab,v 1.1.1.1 1998/11/04 21:20:50 garbled Exp $
+--- xworm.c.orig Wed May 7 09:25:57 1997
++++ xworm.c Wed Nov 4 13:52:07 1998
+@@ -3,13 +3,20 @@
+
+ #include <X11/Xlib.h>
+ #include <X11/Xutil.h>
++#if defined(__FreeBSD__) || defined(__NetBSD__)
++#include <sys/time.h>
++#endif
+ #include <time.h>
+ #include <string.h>
+ #include <stdio.h>
+
+-#define gridfile "xworm.grid"
+-#define fontfile "xworm.font"
+-#define logofile "xworm.raw"
++#ifndef PREFIX
++#define PREFIX "."
++#endif
++
++#define gridfile PREFIX "/xworm.grid"
++#define fontfile PREFIX "/xworm.font"
++#define logofile PREFIX "/xworm.raw"
+
+ #define maxQ 5000 /* max queue */
+ #define NCOLORS 15 /* number of colours */
+@@ -551,16 +558,24 @@
+ colormap = DefaultColormap(display, screen);
+ if (!XAllocColorCells(display, colormap, True, NULL, 0, pixels, npixels)) {
+ fprintf(stderr, "failed to allocate all %d colours\n", NCOLORS);
+- exit(1);
+- }
+- for (i = 0; i < NCOLORS; i++) { /* Initialize RGB values ... */
+- color_tab[i].pixel = pixels[i];
+- color_tab[i].red = rgb_tab[i].r;
+- color_tab[i].green = rgb_tab[i].g;
+- color_tab[i].blue = rgb_tab[i].b;
+- color_tab[i].flags = DoRed | DoGreen | DoBlue;
++ for (i = 0; i < NCOLORS; i++) { /* Initialize RGB values ... */
++ color_tab[i].pixel = pixels[i];
++ color_tab[i].red = rgb_tab[i].r;
++ color_tab[i].green = rgb_tab[i].g;
++ color_tab[i].blue = rgb_tab[i].b;
++ color_tab[i].flags = DoRed | DoGreen | DoBlue;
++ XAllocColor(display, colormap, &color_tab[i]);
++ }
++ } else {
++ for (i = 0; i < NCOLORS; i++) { /* Initialize RGB values ... */
++ color_tab[i].pixel = pixels[i];
++ color_tab[i].red = rgb_tab[i].r;
++ color_tab[i].green = rgb_tab[i].g;
++ color_tab[i].blue = rgb_tab[i].b;
++ color_tab[i].flags = DoRed | DoGreen | DoBlue;
++ }
++ XStoreColors(display, colormap, color_tab, npixels);
+ }
+- XStoreColors(display, colormap, color_tab, npixels);
+ }
+
+ Bool predproc (display,event,arg)
+@@ -773,7 +788,7 @@
+ void rgrid(void){
+ FILE *fpg;
+ if ((fpg=fopen(gridfile,"rb")) == NULL) {
+- printf("Error opening file /users/paalde/bin/xworm.grid. unrecoverable \n");
++ printf("Error opening file %s/xworm.grid. unrecoverable \n", PREFIX);
+ exit (0);
+ }
+ for (i=1;i<maxGrid;i++) {
diff --git a/games/xworm/pkg/COMMENT b/games/xworm/pkg/COMMENT
new file mode 100644
index 00000000000..ecbe8128ba2
--- /dev/null
+++ b/games/xworm/pkg/COMMENT
@@ -0,0 +1 @@
+Classic game with apples and hungry worm.
diff --git a/games/xworm/pkg/DESCR b/games/xworm/pkg/DESCR
new file mode 100644
index 00000000000..93446c0e3cb
--- /dev/null
+++ b/games/xworm/pkg/DESCR
@@ -0,0 +1,5 @@
+ In this game you must help wormie - the hungry maggot, to steal
+apples from bazar the evil. Bazar has put an electric fence around
+the garden, and he has also been spreading poisionous mushrooms
+into it. You must guide wormie around this objects, and you must
+keep him from eating himself.
diff --git a/games/xworm/pkg/PLIST b/games/xworm/pkg/PLIST
new file mode 100644
index 00000000000..f65e0b8107f
--- /dev/null
+++ b/games/xworm/pkg/PLIST
@@ -0,0 +1,5 @@
+bin/xworm
+share/xworm/xworm.font
+share/xworm/xworm.grid
+share/xworm/xworm.raw
+@dirrm share/xworm