Date:2010-11-15 18:30:36 (13 years 4 months ago)
Author:Xiangfu Liu
Commit:182a82ae54fd9d76fdb3fb0048406c02b5d9801d
Message:[nethack] [new package] single player dungeon exploration game

Files: nethack/Makefile (1 diff)
nethack/patches/001-nethack-3.4.3-nanonote.patch (1 diff)

Change Details

nethack/Makefile
1#
2# Copyright (C) 2009 Qi Hardware Inc.
3# Author: Xiangfu Liu <xiangfu@sharism.cc>
4#
5# This is free software, licensed under the GNU General Public License v2.
6# See /LICENSE for more information.
7#
8
9include $(TOPDIR)/rules.mk
10
11PKG_NAME:=nethack
12PKG_VERSION:=343
13
14PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-src.tgz
15PKG_SOURCE_URL:=http://downloads.sourceforge.net/project/nethack/nethack/3.4.3/
16PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-3.4.3
17
18include $(INCLUDE_DIR)/package.mk
19
20define Package/nethack
21    SECTION:=games
22    CATEGORY:=Games
23    DEPENDS:=nethack
24    TITLE:=single player dungeon exploration game
25    DEPENDS:=+libncurses
26endef
27
28define Package/nethack/description
29    NetHack is a single player dungeon exploration game
30endef
31
32TARGET_CFLAGS+=-I$(STAGING_DIR)/usr/include
33TARGET_LDFLAGS+= -Wl,-rpath-link=$(STAGING_DIR)/usr/lib
34
35define Build/Compile
36    (cd $(PKG_BUILD_DIR)/sys/unix; \
37    sh setup.sh; \
38    cd ../../; \
39    export CFLAGS="${TARGET_CFLAGS}";\
40    export LDFLAGS="${TARGET_LDFLAGS}";\
41    export PREFIX="${PKG_INSTALL_DIR}";\
42    make;\
43    )
44endef
45
46define Package/nethack/install
47    $(INSTALL_DIR) \
48        $(1)/usr/bin \
49
50    $(INSTALL_BIN) \
51        $(PKG_BUILD_DIR)/src/nethack \
52        $(1)/usr/bin/
53endef
54
55$(eval $(call BuildPackage,nethack))
nethack/patches/001-nethack-3.4.3-nanonote.patch
1diff --git a/include/config.h b/include/config.h
2index 3efbfa2..4c69b32 100644
3--- a/include/config.h
4@@ -169,11 +169,11 @@
5
6 #ifdef UNIX
7 /* path and file name extension for compression program */
8-#define COMPRESS "/usr/bin/compress" /* Lempel-Ziv compression */
9-#define COMPRESS_EXTENSION ".Z" /* compress's extension */
10+// #define COMPRESS "/usr/bin/compress" /* Lempel-Ziv compression */
11+// #define COMPRESS_EXTENSION ".Z" /* compress's extension */
12 /* An example of one alternative you might want to use: */
13-/* #define COMPRESS "/usr/local/bin/gzip" */ /* FSF gzip compression */
14-/* #define COMPRESS_EXTENSION ".gz" */ /* normal gzip extension */
15+#define COMPRESS "/bin/gzip"
16+#define COMPRESS_EXTENSION ".gz"
17 #endif
18
19 #ifndef COMPRESS
20diff --git a/include/unixconf.h b/include/unixconf.h
21index fe1b006..6038e6c 100644
22--- a/include/unixconf.h
23@@ -37,7 +37,7 @@
24 #define NETWORK /* if running on a networked system */
25             /* e.g. Suns sharing a playground through NFS */
26 /* #define SUNOS4 */ /* SunOS 4.x */
27-/* #define LINUX */ /* Another Unix clone */
28+#define LINUX /* Another Unix clone */
29 /* #define CYGWIN32 */ /* Unix on Win32 -- use with case sensitive defines */
30 /* #define GENIX */ /* Yet Another Unix Clone */
31 /* #define HISX */ /* Bull Unix for XPS Machines */
32@@ -132,7 +132,7 @@
33  * "extra output" method is used, but not all systems provide access to
34  * a fine-grained timer.
35  */
36-/* #define TIMED_DELAY */ /* usleep() */
37+#define TIMED_DELAY /* usleep() */
38 #endif
39
40 /*
41diff --git a/sys/share/unixtty.c b/sys/share/unixtty.c
42index 05b76b4..37484fa 100644
43--- a/sys/share/unixtty.c
44@@ -38,7 +38,7 @@
45 # ifdef LINUX
46 # include <sys/ioctl.h>
47 # undef delay_output /* curses redefines this */
48-# include <curses.h>
49+# include <ncurses.h>
50 # endif
51 # define kill_sym c_cc[VKILL]
52 # define erase_sym c_cc[VERASE]
53diff --git a/sys/unix/Makefile.src b/sys/unix/Makefile.src
54index 29ad99a..3f640a3 100644
55--- a/sys/unix/Makefile.src
56@@ -76,6 +76,8 @@ SYSOBJ = ioctl.o unixmain.o unixtty.o unixunix.o unixres.o
57 #
58 # For cross-compiling, eg. with gcc on Linux (see also CXX further down):
59 # CC = arm-linux-gcc
60+CC = mipsel-openwrt-linux-uclibc-gcc
61+LD = mipsel-openwrt-linux-uclibc-ld
62 #
63 #
64 # if you're debugging and want gcc to check as much as possible, use:
65@@ -151,18 +153,18 @@ GNOMEINC=-I/usr/lib/glib/include -I/usr/lib/gnome-libs/include -I../win/gnome
66 # flags for debugging:
67 # CFLAGS = -g -I../include
68
69-CFLAGS = -O -I../include
70-LFLAGS =
71+CFLAGS += -O2 -I../include
72+LFLAGS += ${LDFLAGS}
73
74 # The Qt and Be window systems are written in C++, while the rest of
75 # NetHack is standard C. If using Qt, uncomment the LINK line here to get
76 # the C++ libraries linked in.
77 CXXFLAGS = $(CFLAGS) -I. -I$(QTDIR)/include
78-CXX=g++
79+CXX=mipsel-openwrt-linux-uclibc-g++
80 #LINK=g++
81 # For cross-compiling, eg. with gcc on Linux (see also CC further up):
82 #CXX=arm-linux-g++
83-#LINK=arm-linux-gcc
84+LINK=mipsel-openwrt-linux-uclibc-g++
85
86 # Set the WINSRC, WINOBJ, and WINLIB lines to correspond to your desired
87 # combination of windowing systems. Also set windowing systems in config.h.
88@@ -230,8 +232,8 @@ WINOBJ = $(WINTTYOBJ)
89 # WINTTYLIB = -ltermcap
90 # WINTTYLIB = -lcurses
91 # WINTTYLIB = -lcurses16
92-# WINTTYLIB = -lncurses
93-WINTTYLIB = -ltermlib
94+WINTTYLIB = -lncurses
95+# WINTTYLIB = -ltermlib
96 #
97 # libraries for X11
98 # If USE_XPM is defined in config.h, you will also need -lXpm here.
99diff --git a/sys/unix/Makefile.top b/sys/unix/Makefile.top
100index 2f11c35..c6b7af0 100644
101--- a/sys/unix/Makefile.top
102@@ -14,7 +14,6 @@
103 # MAKE = make
104
105 # make NetHack
106-PREFIX = /usr
107 GAME = nethack
108 # GAME = nethack.prg
109 GAMEUID = games
110@@ -35,9 +34,9 @@ DIRPERM = 0755
111 # therefore there should not be anything in GAMEDIR that you want to keep
112 # (if there is, you'll have to do the installation by hand or modify the
113 # instructions)
114-GAMEDIR = $(PREFIX)/games/lib/$(GAME)dir
115+GAMEDIR = $(PREFIX)/lib/$(GAME)dir
116 VARDIR = $(GAMEDIR)
117-SHELLDIR = $(PREFIX)/games
118+SHELLDIR = $(PREFIX)
119
120 # per discussion in Install.X11 and Install.Qt
121 VARDATND =
122@@ -238,7 +237,7 @@ install: $(GAME) recover $(VARDAT) dungeon spec_levs
123     -mkdir -p $(GAMEDIR) $(VARDIR) $(VARDIR)/save
124     -rmdir ./-p
125     -$(CHOWN) $(GAMEUID) $(GAMEDIR) $(VARDIR) $(VARDIR)/save
126- $(CHGRP) $(GAMEGRP) $(GAMEDIR) $(VARDIR) $(VARDIR)/save
127+ -$(CHGRP) $(GAMEGRP) $(GAMEDIR) $(VARDIR) $(VARDIR)/save
128     chmod $(DIRPERM) $(GAMEDIR) $(VARDIR) $(VARDIR)/save
129 # set up the game files
130     ( $(MAKE) dofiles )
131diff --git a/sys/unix/Makefile.utl b/sys/unix/Makefile.utl
132index e2936a8..69369cf 100644
133--- a/sys/unix/Makefile.utl
134@@ -27,6 +27,8 @@
135 #
136 # For HP/UX 10.20 with GCC:
137 # CC = gcc -D_POSIX_SOURCE
138+CC = mipsel-openwrt-linux-uclibc-gcc
139+CXX = mipsel-openwrt-linux-uclibc-g++
140 #
141 # if your make doesn't define a default SHELL properly, you may need
142 # the line below (Atari users will need a bourne work-alike)
143@@ -95,7 +97,7 @@ LFLAGS =
144 LIBS =
145
146 # If you are cross-compiling, you must use this:
147-#OBJDIR = .
148+OBJDIR = .
149 # otherwise, you can save a little bit of disk space with this:
150 OBJDIR = ../src
151
152@@ -175,7 +177,7 @@ YACCDIST =
153 # dependencies for makedefs
154 #
155 makedefs: $(MAKEOBJS)
156- $(CC) $(LFLAGS) -o makedefs $(MAKEOBJS)
157+ gcc $(LFLAGS) -o makedefs -I../include makedefs.c ../src/monst.c ../src/objects.c
158
159 makedefs.o: makedefs.c $(CONFIG_H) ../include/permonst.h \
160         ../include/objclass.h ../include/monsym.h \
161@@ -210,7 +212,7 @@ panic.o: panic.c $(CONFIG_H)
162 # dependencies for lev_comp
163 #
164 lev_comp: $(SPLEVOBJS)
165- $(CC) $(LFLAGS) -o lev_comp $(SPLEVOBJS) $(LIBS)
166+ gcc -o lev_comp lev_yacc.c lev_lex.c lev_main.c $(CALLOC) $(CNAMING) -I../include
167
168 lev_yacc.o: lev_yacc.c $(HACK_H) ../include/sp_lev.h
169 lev_main.o: lev_main.c $(HACK_H) ../include/sp_lev.h ../include/tcap.h \
170@@ -243,7 +245,7 @@ lintlev:
171 # dependencies for dgn_comp
172 #
173 dgn_comp: $(DGNCOMPOBJS)
174- $(CC) $(LFLAGS) -o dgn_comp $(DGNCOMPOBJS) $(LIBS)
175+ gcc $(LFLAGS) -o dgn_comp dgn_yacc.c dgn_lex.c dgn_main.c $(CALLOC) -I../include $(LIBS)
176
177 dgn_yacc.o: dgn_yacc.c $(CONFIG_H) ../include/dgn_file.h ../include/date.h
178 dgn_main.o: dgn_main.c $(CONFIG_H) ../include/dlb.h
179diff --git a/sys/unix/nethack.sh b/sys/unix/nethack.sh
180index 600e1da..ca7e7f4 100644
181--- a/sys/unix/nethack.sh
182@@ -1,7 +1,7 @@
183 #!/bin/sh
184 # SCCS Id: @(#)nethack.sh 3.4 1990/02/26
185
186-HACKDIR=/usr/games/lib/nethackdir
187+HACKDIR=`pwd`/lib/nethackdir
188 export HACKDIR
189 HACK=$HACKDIR/nethack
190 MAXNROFPLAYERS=4

Archive Download the corresponding diff file



interactive