summaryrefslogtreecommitdiff
path: root/games/tt
diff options
context:
space:
mode:
authorKirill Ponomarev <krion@FreeBSD.org>2003-09-24 18:14:21 +0000
committerKirill Ponomarev <krion@FreeBSD.org>2003-09-24 18:14:21 +0000
commit9bab5786850ee98318387d121598f388ea2236d4 (patch)
tree7969b4e5142312e8431437b61625bed167174139 /games/tt
parent- Update to 0.9.12.1 (diff)
This is a new port of tetris game, written almost 15 years ago,
but being very playable, highly portable, well-tested, and still being developed! It is specifically designed to be played over terminal lines. Includes quite a few game-type options, and just overall-neat piece of software. PR: 56743 Submitted by: Alexey Dokuchaev <danfe@regency.nsu.ru>
Notes
Notes: svn path=/head/; revision=89266
Diffstat (limited to 'games/tt')
-rw-r--r--games/tt/Makefile25
-rw-r--r--games/tt/distinfo1
-rw-r--r--games/tt/files/patch-Makefile17
-rw-r--r--games/tt/files/patch-tt.c37
-rw-r--r--games/tt/files/patch-tt.h19
-rw-r--r--games/tt/files/patch-utils.c32
-rw-r--r--games/tt/files/patch-utils.h11
-rw-r--r--games/tt/pkg-descr12
-rw-r--r--games/tt/pkg-plist4
9 files changed, 158 insertions, 0 deletions
diff --git a/games/tt/Makefile b/games/tt/Makefile
new file mode 100644
index 000000000000..65d61142e901
--- /dev/null
+++ b/games/tt/Makefile
@@ -0,0 +1,25 @@
+# New ports collection makefile for: tt
+# Date created: 11 Sent 2003
+# Whom: Alexey Dokuchaev <danfe@regency.nsu.ru>
+#
+# $FreeBSD$
+#
+
+PORTNAME= tt
+PORTVERSION= 14.0
+CATEGORIES= games
+MASTER_SITES= http://www.miketaylor.org.uk/tech/tt/
+
+MAINTAINER= danfe@regency.nsu.ru
+COMMENT= Tetris for Terminals
+
+ALL_TARGET= tt
+
+do-install:
+ ${INSTALL_PROGRAM} ${WRKSRC}/tt ${PREFIX}/bin
+.if !defined(NOPORTDOCS)
+ @${MKDIR} ${DOCSDIR}
+ ${INSTALL_DATA} ${WRKSRC}/README ${DOCSDIR}
+.endif
+
+.include <bsd.port.mk>
diff --git a/games/tt/distinfo b/games/tt/distinfo
new file mode 100644
index 000000000000..32759dd19771
--- /dev/null
+++ b/games/tt/distinfo
@@ -0,0 +1 @@
+MD5 (tt-14.0.tar.gz) = 9d6c558f07ed5b904e4e8ffcfc6b43c4
diff --git a/games/tt/files/patch-Makefile b/games/tt/files/patch-Makefile
new file mode 100644
index 000000000000..59546a2781f3
--- /dev/null
+++ b/games/tt/files/patch-Makefile
@@ -0,0 +1,17 @@
+--- Makefile.orig Thu Sep 11 15:09:08 2003
++++ Makefile Fri Sep 12 22:20:35 2003
+@@ -6,10 +6,10 @@
+ LINTFLAGS = -abh
+
+ # --- Choose one of these CFLAGS ---
+-CFLAGS = $(OPT) # Sun BSD, Red Hat Linux
+-#CFLAGS = $(OPT) -DSYSV # SCO System V
+-#CFLAGS = $(OPT) -DSYSV -DNO_NAP_SYSCALL # Generic System V?
+-#CFLAGS = $(OPT) -DNO_USLEEP_SYSCALL # Generic BSD?
++CFLAGS += $(OPT) # Sun BSD, Red Hat Linux
++#CFLAGS += $(OPT) -DSYSV # SCO System V
++#CFLAGS += $(OPT) -DSYSV -DNO_NAP_SYSCALL # Generic System V?
++#CFLAGS += $(OPT) -DNO_USLEEP_SYSCALL # Generic BSD?
+
+ # --- Choose one of these LDLIBS ---
+ LDLIBS = -lcurses -ltermcap # Sun and Generic BSD
diff --git a/games/tt/files/patch-tt.c b/games/tt/files/patch-tt.c
new file mode 100644
index 000000000000..c87cc23aa8eb
--- /dev/null
+++ b/games/tt/files/patch-tt.c
@@ -0,0 +1,37 @@
+--- tt.c.orig Tue May 27 17:46:22 2003
++++ tt.c Sat Sep 13 09:55:18 2003
+@@ -21,6 +21,7 @@
+ #include <fcntl.h>
+ #include <errno.h>
+ #include <pwd.h>
++#include <unistd.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+
+@@ -32,19 +33,19 @@
+
+ /*-------------------------------------------------------------------------*/
+
+-extern time_t time ();
+-extern char *ctime ();
+-extern char *malloc ();
+-extern char *getenv ();
+-extern char *getlogin ();
+-extern struct passwd *getpwuid ();
++//extern time_t time ();
++//extern char *ctime ();
++//extern char *malloc ();
++//extern char *getenv ();
++//extern char *getlogin ();
++//extern struct passwd *getpwuid ();
+
+ static int get_key ();
+
+ /*-------------------------------------------------------------------------*/
+
+ char *LOCK_FILE = "/home/mike/lib/ttlock/ttlock";
+-char *SCORE_FILE = "/home/mike/lib/ttscores";
++char *SCORE_FILE = "/var/games/ttscores";
+
+ /* These four variables determine which game we're playing */
+ struct piece *pieces = pieces4;
diff --git a/games/tt/files/patch-tt.h b/games/tt/files/patch-tt.h
new file mode 100644
index 000000000000..d30e1715a86e
--- /dev/null
+++ b/games/tt/files/patch-tt.h
@@ -0,0 +1,19 @@
+--- tt.h.orig Sat Sep 13 09:20:29 2003
++++ tt.h Sat Sep 13 09:48:57 2003
+@@ -20,7 +20,7 @@
+ |* *|
+ \***************************************************************************/
+
+-#undef LOCKF /* Use lockf(3) instead of open(O_EXCL) */
++#define LOCKF /* Use lockf(3) instead of open(O_EXCL) */
+
+ /***************************************************************************\
+ |* *|
+@@ -187,5 +187,5 @@
+ /*--------------------------------------------------------------------------*/
+
+ /* This is probably still the most portable way ... */
+-extern int read(), close(), sleep(), unlink(), write(), getuid();
+-extern void usleep();
++//extern int read(), close(), sleep(), unlink(), write(), getuid();
++//extern void usleep();
diff --git a/games/tt/files/patch-utils.c b/games/tt/files/patch-utils.c
new file mode 100644
index 000000000000..a3c1c60cbe1b
--- /dev/null
+++ b/games/tt/files/patch-utils.c
@@ -0,0 +1,32 @@
+--- utils.c.orig Fri Sep 12 18:01:20 2003
++++ utils.c Fri Sep 12 22:21:05 2003
+@@ -30,8 +30,7 @@
+ # include <poll.h>
+ #endif
+ #include <curses.h>
+-#undef va_start /* required with Red Hat's ncurses :-P */
+-#include <varargs.h>
++#include <stdarg.h>
+ #include <sys/types.h>
+ #include <sys/time.h>
+ #include <sys/ioctl.h> /* M001 */
+@@ -75,16 +74,13 @@
+ \***************************************************************************/
+
+ /*VARARGS*/
+-char *form (va_alist)
+- va_dcl
++char *form (const char *fmt_string, ...)
+ {
+ va_list pvar;
+- char *fmt_string;
+ static char result[LINELEN];
+
+- va_start (pvar);
+- fmt_string = va_arg (pvar, char*);
+- (void) vsprintf (result, fmt_string, pvar);
++ va_start (pvar, fmt_string);
++ (void) vsnprintf (result, LINELEN, fmt_string, pvar);
+ va_end (pvar);
+ return (result);
+ }
diff --git a/games/tt/files/patch-utils.h b/games/tt/files/patch-utils.h
new file mode 100644
index 000000000000..1b5921090d35
--- /dev/null
+++ b/games/tt/files/patch-utils.h
@@ -0,0 +1,11 @@
+--- utils.h.orig Fri Sep 12 22:12:44 2003
++++ utils.h Fri Sep 12 22:13:00 2003
+@@ -12,7 +12,7 @@
+ \***************************************************************************/
+
+ extern char *basename ();
+-extern char *form ();
++extern char *form (const char *fmt_string, ...);
+ extern void die ();
+ extern void get_termcap ();
+ extern void flush_keyboard ();
diff --git a/games/tt/pkg-descr b/games/tt/pkg-descr
new file mode 100644
index 000000000000..9fca1a4acc8a
--- /dev/null
+++ b/games/tt/pkg-descr
@@ -0,0 +1,12 @@
+tt is an implementation of the well-known game tetris. Quadominoes
+(groups of four squares joined orthogonally together) fall slowly down
+the screen, accumulating at the bottom, and when the pile reaches the
+top of the screen the game is over. The pieces may be moved to the left
+or right, and rotated as they fall, with the aim of making them
+tessellate with the pieces already at the bottom of the game area. The
+height of the stack of pieces can be reduced by filling a complete row
+of ten squares, at which point that row will disappear, and those above
+will fall down into its place. It is possible (and desirable) to destroy
+multiple rows at once.
+
+WWW: http://www.miketaylor.org.uk/tech/tt/
diff --git a/games/tt/pkg-plist b/games/tt/pkg-plist
new file mode 100644
index 000000000000..40452f3c3a9f
--- /dev/null
+++ b/games/tt/pkg-plist
@@ -0,0 +1,4 @@
+bin/tt
+%%PORTDOCS%%%%DOCSDIR%%/README
+%%PORTDOCS%%@dirrm %%DOCSDIR%%
+@unexec if [ -f /var/games/ttscores ]; then rm /var/games/ttscores; fi