bsd-games/Makefile |
| 1 | # |
| 2 | # kyak@freenode/#qi-hardware |
| 3 | # |
| 4 | # This is free software, licensed under the GNU General Public License v2. |
| 5 | # |
| 6 | |
| 7 | include $(TOPDIR)/rules.mk |
| 8 | |
| 9 | PKG_NAME:=bsd-games |
| 10 | PKG_VERSION:=2.17 |
| 11 | PKG_RELEASE:=1 |
| 12 | |
| 13 | PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz |
| 14 | PKG_SOURCE_URL:=ftp://metalab.unc.edu/pub/Linux/games/ |
| 15 | PKG_MD5SUM:=238a38a3a017ca9b216fc42bde405639 |
| 16 | |
| 17 | include $(INCLUDE_DIR)/package.mk |
| 18 | |
| 19 | define Package/bsd-games |
| 20 | SUBMENU:=bsd-games |
| 21 | SECTION:=games |
| 22 | CATEGORY:=Games |
| 23 | URL:=ftp://metalab.unc.edu/pub/Linux/games/ |
| 24 | endef |
| 25 | |
| 26 | define Build/Configure |
| 27 | endef |
| 28 | CFLAGS:= |
| 29 | define Build/Compile |
| 30 | #Building tetris |
| 31 | cd $(PKG_BUILD_DIR)/tetris; \ |
| 32 | mv pathnames.h.in pathnames.h; \ |
| 33 | $(TARGET_CC) -c -O2 -Wall -W -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-align -Wcast-qual -Wwrite-strings -I$(STAGING_DIR)/usr/include input.c screen.c shapes.c scores.c tetris.c; \ |
| 34 | $(TARGET_CC) -lncurses -L$(STAGING_DIR)/usr/lib -o tetris input.o screen.o shapes.o scores.o tetris.o |
| 35 | |
| 36 | #Building primes |
| 37 | cd $(PKG_BUILD_DIR)/primes; \ |
| 38 | $(TARGET_CC) -c -O2 -Wall -W -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-align -Wcast-qual -Wwrite-strings pattern.c pr_tbl.c primes.c; \ |
| 39 | $(TARGET_CC) -lm -o primes pattern.o pr_tbl.o primes.o |
| 40 | endef |
| 41 | |
| 42 | define Package/tetris |
| 43 | $(call Package/bsd-games) |
| 44 | TITLE:=the game of tetris |
| 45 | DEPENDS:=+libncurses |
| 46 | endef |
| 47 | |
| 48 | define Package/tetris/install |
| 49 | $(INSTALL_DIR) \ |
| 50 | $(1)/usr/bin \ |
| 51 | $(1)/var/games |
| 52 | |
| 53 | $(INSTALL_BIN) \ |
| 54 | $(PKG_BUILD_DIR)/tetris/tetris \ |
| 55 | $(1)/usr/bin/tetris |
| 56 | endef |
| 57 | |
| 58 | define Package/primes |
| 59 | $(call Package/bsd-games) |
| 60 | TITLE:=generate primes |
| 61 | endef |
| 62 | |
| 63 | define Package/primes/install |
| 64 | $(INSTALL_DIR) \ |
| 65 | $(1)/usr/bin |
| 66 | |
| 67 | $(INSTALL_BIN) \ |
| 68 | $(PKG_BUILD_DIR)/primes/primes \ |
| 69 | $(1)/usr/bin/primes |
| 70 | endef |
| 71 | |
| 72 | $(eval $(call BuildPackage,tetris)) |
| 73 | $(eval $(call BuildPackage,primes)) |
bsd-games/patches/001-tetris.patch |
| 1 | diff -u bsd-games-2.17/tetris/input.c bsd-games-2.17-p/tetris/input.c |
| 2 | --- bsd-games-2.17/tetris/input.c 2003-12-17 05:47:37.000000000 +0300 |
| 3 | @@ -85,7 +85,7 @@ |
| 4 | endtv = *tvp; |
| 5 | timeout = tvp->tv_sec * 1000 + tvp->tv_usec / 1000; |
| 6 | } else |
| 7 | - timeout = INFTIM; |
| 8 | + timeout = -1; |
| 9 | again: |
| 10 | set[0].fd = STDIN_FILENO; |
| 11 | set[0].events = POLLIN; |
| 12 | Файлы bsd-games-2.17/tetris/input.o и bsd-games-2.17-p/tetris/input.o различаются |
| 13 | diff -u bsd-games-2.17/tetris/screen.c bsd-games-2.17-p/tetris/screen.c |
| 14 | --- bsd-games-2.17/tetris/screen.c 2004-01-27 23:52:07.000000000 +0300 |
| 15 | @@ -73,7 +73,7 @@ |
| 16 | extern char PC, *BC, *UP; /* tgoto requires globals: ugh! */ |
| 17 | static char BCdefault[] = "\b"; |
| 18 | #ifndef NCURSES_VERSION |
| 19 | -short ospeed; |
| 20 | +speed_t ospeed; |
| 21 | #endif |
| 22 | |
| 23 | static char |
| 24 | @@ -287,6 +287,7 @@ |
| 25 | stop("tcgetattr() fails"); |
| 26 | newtt = oldtt; |
| 27 | newtt.c_lflag &= ~(ICANON|ECHO); |
| 28 | +#define OXTABS XTABS |
| 29 | newtt.c_oflag &= ~OXTABS; |
| 30 | newtt.c_cc[VMIN] = 1; |
| 31 | newtt.c_cc[VTIME] = 0; |
| 32 | Файлы bsd-games-2.17/tetris/screen.o и bsd-games-2.17-p/tetris/screen.o различаются |
| 33 | diff -u bsd-games-2.17/tetris/shapes.c bsd-games-2.17-p/tetris/shapes.c |
| 34 | --- bsd-games-2.17/tetris/shapes.c 2003-12-17 05:47:37.000000000 +0300 |
| 35 | @@ -83,7 +83,7 @@ |
| 36 | const struct shape *shape; |
| 37 | int pos; |
| 38 | { |
| 39 | - int *o = shape->off; |
| 40 | + const int *o = shape->off; |
| 41 | |
| 42 | if (board[pos] || board[pos + *o++] || board[pos + *o++] || |
| 43 | board[pos + *o]) |
| 44 | @@ -100,7 +100,7 @@ |
| 45 | const struct shape *shape; |
| 46 | int pos, onoff; |
| 47 | { |
| 48 | - int *o = shape->off; |
| 49 | + const int *o = shape->off; |
| 50 | |
| 51 | board[pos] = onoff; |
| 52 | board[pos + *o++] = onoff; |
| 53 | diff -u bsd-games-2.17/tetris/tetris.c bsd-games-2.17-p/tetris/tetris.c |
| 54 | --- bsd-games-2.17/tetris/tetris.c 2004-01-27 23:52:07.000000000 +0300 |
| 55 | @@ -35,10 +35,10 @@ |
| 56 | */ |
| 57 | |
| 58 | #include <sys/cdefs.h> |
| 59 | -#ifndef lint |
| 60 | +/*#ifndef lint |
| 61 | __COPYRIGHT("@(#) Copyright (c) 1992, 1993\n\ |
| 62 | The Regents of the University of California. All rights reserved.\n"); |
| 63 | -#endif /* not lint */ |
| 64 | +#endif*/ /* not lint */ |
| 65 | |
| 66 | /* |
| 67 | * Tetris (or however it is spelled). |
bsd-games/patches/002-primes.patch |
| 1 | diff -u bsd-games-2.17/primes/pattern.c bsd-games-2.17-p/primes/pattern.c |
| 2 | --- bsd-games-2.17/primes/pattern.c 2003-12-17 05:47:37.000000000 +0300 |
| 3 | @@ -33,13 +33,13 @@ |
| 4 | */ |
| 5 | |
| 6 | #include <sys/cdefs.h> |
| 7 | -#ifndef lint |
| 8 | +/*#ifndef lint |
| 9 | #if 0 |
| 10 | static char sccsid[] = "@(#)pattern.c 8.1 (Berkeley) 5/31/93"; |
| 11 | #else |
| 12 | __RCSID("$NetBSD: pattern.c,v 1.6 2003/08/07 09:37:33 agc Exp $"); |
| 13 | #endif |
| 14 | -#endif /* not lint */ |
| 15 | +#endif */ /* not lint */ |
| 16 | |
| 17 | /* |
| 18 | * pattern - the Eratosthenes sieve on odd numbers for 3,5,7,11 and 13 |
| 19 | diff -u bsd-games-2.17/primes/primes.c bsd-games-2.17-p/primes/primes.c |
| 20 | --- bsd-games-2.17/primes/primes.c 2004-01-27 23:52:07.000000000 +0300 |
| 21 | @@ -33,18 +33,18 @@ |
| 22 | */ |
| 23 | |
| 24 | #include <sys/cdefs.h> |
| 25 | -#ifndef lint |
| 26 | +/*#ifndef lint |
| 27 | __COPYRIGHT("@(#) Copyright (c) 1989, 1993\n\ |
| 28 | The Regents of the University of California. All rights reserved.\n"); |
| 29 | -#endif /* not lint */ |
| 30 | +#endif */ /* not lint */ |
| 31 | |
| 32 | -#ifndef lint |
| 33 | +/*#ifndef lint |
| 34 | #if 0 |
| 35 | static char sccsid[] = "@(#)primes.c 8.5 (Berkeley) 5/10/95"; |
| 36 | #else |
| 37 | __RCSID("$NetBSD: primes.c,v 1.12 2004/01/27 20:30:30 jsm Exp $"); |
| 38 | #endif |
| 39 | -#endif /* not lint */ |
| 40 | +#endif */ /* not lint */ |
| 41 | |
| 42 | /* |
| 43 | * primes - generate a table of primes between two values |
| 44 | diff -u bsd-games-2.17/primes/primes.h bsd-games-2.17-p/primes/primes.h |
| 45 | --- bsd-games-2.17/primes/primes.h 2003-12-17 05:47:37.000000000 +0300 |
| 46 | @@ -48,3 +48,5 @@ |
| 47 | |
| 48 | /* bytes in sieve table (must be > 3*5*7*11) */ |
| 49 | #define TABSIZE 256*1024 |
| 50 | + |
| 51 | +int isblank(int c); |
| 52 | diff -u bsd-games-2.17/primes/pr_tbl.c bsd-games-2.17-p/primes/pr_tbl.c |
| 53 | --- bsd-games-2.17/primes/pr_tbl.c 2003-12-17 05:47:37.000000000 +0300 |
| 54 | @@ -33,13 +33,13 @@ |
| 55 | */ |
| 56 | |
| 57 | #include <sys/cdefs.h> |
| 58 | -#ifndef lint |
| 59 | +/* #ifndef lint |
| 60 | #if 0 |
| 61 | static char sccsid[] = "@(#)pr_tbl.c 8.1 (Berkeley) 5/31/93"; |
| 62 | #else |
| 63 | __RCSID("$NetBSD: pr_tbl.c,v 1.7 2003/08/07 09:37:33 agc Exp $"); |
| 64 | #endif |
| 65 | -#endif /* not lint */ |
| 66 | +#endif */ /* not lint */ |
| 67 | |
| 68 | /* |
| 69 | * prime - prime table |