1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-26 05:02:18 +00:00

. Add a port of NetHack 3.6.0

PR:		205255
Submitted by:	groot@kde.org
This commit is contained in:
Greg Lewis 2016-01-24 04:04:30 +00:00
parent abdcf96db7
commit 0fdded38b5
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=407077
23 changed files with 940 additions and 0 deletions

View File

@ -625,6 +625,8 @@
SUBDIR += nethack33-nox11
SUBDIR += nethack34
SUBDIR += nethack34-nox11
SUBDIR += nethack36
SUBDIR += nethack36-nox11
SUBDIR += netherearth
SUBDIR += netpanzer
SUBDIR += netradiant

View File

@ -0,0 +1,10 @@
# Created by: Jeremy Chadwick <yoshi@parodius.com>
# $FreeBSD$
MASTERDIR= ${.CURDIR}/../nethack36
MAINTAINER= glewis@FreeBSD.org
PKGNAMESUFFIX= -nox11
.include "${MASTERDIR}/Makefile"

114
games/nethack36/Makefile Normal file
View File

@ -0,0 +1,114 @@
# Created by: asami
# $FreeBSD$
PORTNAME= nethack36
PORTVERSION= 3.6.0
PORTREVISION= 0
CATEGORIES= games
MASTER_SITES= SF/${TRUEPORTNAME}/${TRUEPORTNAME}/${PORTVERSION}
DISTNAME= ${TRUEPORTNAME}-${PORTVERSION:S/.//g}-src
MAINTAINER= glewis@FreeBSD.org
COMMENT= Dungeon explorin', slashin', hackin' game
LICENSE= nethack
LICENSE_NAME= NETHACK GENERAL PUBLIC LICENSE
LICENSE_FILE= ${WRKSRC}/dat/license
LICENSE_PERMS= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
WRKSRC= ${WRKDIR}/${TRUEPORTNAME}-${PORTVERSION}
USES= gmake tar:tgz
MAKE_ENV= GRAPHICS="${GRAPHICS}"
PLIST_SUB= HACKNAME="${HACKNAME}" \
HACKEXT="${HACKEXT}"
MAKE_JOBS_UNSAFE= yes
TRUEPORTNAME= nethack
# Configure these variables as you want them to be.
HACKEXT?= 36
HACKNAME?= ${TRUEPORTNAME}${HACKEXT}
HACKDIR?= share/${HACKNAME}
HACKLINK= ${TRUEPORTNAME}
DATADIR= ${PREFIX}/${HACKDIR}
DOCSDIR= ${PREFIX}/share/doc/${HACKNAME}
PKGDEINSTALL= ${WRKDIR}/pkg-deinstall
.if !defined(PKGNAMESUFFIX)
USE_XORG= xaw xpm
CFLAGS+= -DX11_GRAPHICS -DUSE_TILES
GRAPHICS= X11_GRAPHICS
.else
.if ${PKGNAMESUFFIX} == "-nox11"
GRAPHICS= # none
.endif
.endif
CFLAGS+= -DNOMAIL
OPTIONS_DEFINE= DOCS
.include <bsd.port.pre.mk>
.include <bsd.port.options.mk>
.if !exists(${PREFIX}/bin/${HACKLINK}) && ${HACKNAME} != ${HACKLINK}
PLIST_SUB+= HACKLINK=""
.else
PLIST_SUB+= HACKLINK="@comment "
.endif
pre-everything::
@if [ "${PKGBASE}" != "nethack" ]; then \
${ECHO_MSG} "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" ; \
${ECHO_MSG} " You cannot install nethack and ${PKGBASE} in parallel " ; \
${ECHO_MSG} " But ${PKGBASE} reads your prior nethack scores " ; \
${ECHO_MSG} " Don't forget to backup your nethack libdir if it's " ; \
${ECHO_MSG} " important for you " ; \
${ECHO_MSG} "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" ; \
fi
post-patch:
@${REINPLACE_CMD} -e \
's|%%PREFIX%%|${PREFIX}|g' ${WRKSRC}/include/config.h
@${REINPLACE_CMD} -e \
's|<malloc.h>|<stdlib.h>|g' ${WRKSRC}/win/Qt/qt_win.cpp
.for f in include/config.h sys/unix/Makefile.doc sys/unix/Makefile.src sys/unix/Makefile.top
@${REINPLACE_CMD} -e 's|%%HACKNAME%%|${HACKNAME}|g' \
-e 's|%%HACKDIR%%|${PREFIX}/${HACKDIR}|g' \
-e 's|%%HACKEXT%%|${HACKEXT}|g' \
${WRKSRC}/${f}
.endfor
.for f in dgn_comp.6 dlb.6 lev_comp.6 nethack.6 recover.6
@${REINPLACE_CMD} -e 's|%%HACKNAME%%|${HACKNAME}|g' \
-e 's|%%HACKDIR%%|${PREFIX}/${HACKDIR}|g' \
-e 's|%%HACKEXT%%|${HACKEXT}|g' \
${WRKSRC}/doc/${f}
.endfor
.if defined(WITHOUT_SHELL)
@${REINPLACE_CMD} -e 's|#define SHELL|/* #define SHELL|' ${WRKSRC}/include/unixconf.h
.endif
.if defined(WITH_MAIL)
@${REINPLACE_CMD} -e 's|/\* #define MAIL \*/|#define MAIL|' ${WRKSRC}/include/unixconf.h
.endif
do-configure:
@cd ${WRKSRC}/sys/unix; ${SH} setup.sh
pre-install:
@${CAT} ${FILESDIR}/pkg-deinstall.in | ${SED} \
-e 's|%%HACKDIR%%|${HACKDIR}|g' > ${PKGDEINSTALL}
post-install:
.if !exists(${PREFIX}/bin/${HACKLINK}) && ${HACKNAME} != ${HACKLINK}
@${LN} -s -f ${PREFIX}/bin/${HACKNAME} ${STAGEDIR}${PREFIX}/bin/${HACKLINK}
.endif
@cd ${WRKSRC}/doc; ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_ARGS} manpages
@${MKDIR} ${STAGEDIR}${DATADIR}/save
@${CP} ${WRKSRC}/sys/unix/sysconf ${STAGEDIR}${DATADIR}/sysconf
.if ${PORT_OPTIONS:MDOCS}
@${MKDIR} ${STAGEDIR}${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/doc/Guidebook.txt ${STAGEDIR}${DOCSDIR}
.endif
.include <bsd.port.post.mk>

2
games/nethack36/distinfo Normal file
View File

@ -0,0 +1,2 @@
SHA256 (nethack-360-src.tgz) = 1ade698d8458b8d87a4721444cb73f178c74ed1b6fde537c12000f8edf2cb18a
SIZE (nethack-360-src.tgz) = 4261282

View File

@ -0,0 +1,11 @@
--- doc/dgn_comp.6.orig Mon Apr 12 09:28:09 2004
+++ doc/dgn_comp.6 Mon Apr 12 09:28:33 2004
@@ -396,7 +396,7 @@
M. Stephenson (from the level compiler by Jean-Christophe Collet).
.SH "SEE ALSO"
.PP
-lev_comp(6), nethack(6)
+lev_comp%%HACKEXT%%(6), %%HACKNAME%%(6)
.SH BUGS
.PP
Probably infinite.

View File

@ -0,0 +1,11 @@
--- doc/dlb.6.orig Mon Apr 12 09:28:09 2004
+++ doc/dlb.6 Mon Apr 12 09:28:54 2004
@@ -74,7 +74,7 @@
Kenneth Lorber
.SH "SEE ALSO"
.PP
-nethack(6), tar(1)
+%%HACKNAME%%(6), tar(1)
.SH BUGS
.PP
Not a good tar emulation; - does not mean stdin or stdout.

View File

@ -0,0 +1,27 @@
--- include/config.h.orig 2015-11-17 05:58:34 UTC
+++ include/config.h
@@ -250,11 +250,11 @@
#if defined(UNIX) && !defined(ZLIB_COMP) && !defined(COMPRESS)
/* path and file name extension for compression program */
-#define COMPRESS "/usr/bin/compress" /* Lempel-Ziv compression */
-#define COMPRESS_EXTENSION ".Z" /* compress's extension */
+/* #define COMPRESS "/usr/bin/compress" */ /* Lempel-Ziv compression */
+/* #define COMPRESS_EXTENSION ".Z" */ /* compress's extension */
/* An example of one alternative you might want to use: */
-/* #define COMPRESS "/usr/local/bin/gzip" */ /* FSF gzip compression */
-/* #define COMPRESS_EXTENSION ".gz" */ /* normal gzip extension */
+#define COMPRESS "/usr/bin/gzip" /* FSF gzip compression */
+#define COMPRESS_EXTENSION ".gz" /* normal gzip extension */
#endif
#ifndef COMPRESS
@@ -317,7 +317,7 @@
* otherwise it will be the current directory.
*/
#ifndef HACKDIR
-#define HACKDIR "/usr/games/lib/nethackdir"
+#define HACKDIR "/usr/local/share/nethack"
#endif
/*

View File

@ -0,0 +1,13 @@
--- include/system.h.orig 2015-12-07 08:26:01 UTC
+++ include/system.h
@@ -81,7 +81,9 @@ typedef long off_t;
#if !defined(__SC__) && !defined(LINUX)
E long NDECL(random);
#endif
-#if (!defined(SUNOS4) && !defined(bsdi) && !defined(__FreeBSD__)) \
+# if defined(__FreeBSD__)
+E void FDECL(srandom, (unsigned long));
+#elif (!defined(SUNOS4) && !defined(bsdi) && !defined(__FreeBSD__)) \
|| defined(RANDOM)
E void FDECL(srandom, (unsigned int));
#else

View File

@ -0,0 +1,36 @@
--- include/unixconf.h.orig 2015-11-17 10:54:25 UTC
+++ include/unixconf.h
@@ -19,13 +19,13 @@
*/
/* define exactly one of the following four choices */
-/* #define BSD 1 */ /* define for 4.n/Free/Open/Net BSD */
+#define BSD 1 /* define for 4.n/Free/Open/Net BSD */
/* also for relatives like SunOS 4.x, DG/UX, and */
/* older versions of Linux */
/* #define ULTRIX */ /* define for Ultrix v3.0 or higher (but not lower) */
/* Use BSD for < v3.0 */
/* "ULTRIX" not to be confused with "ultrix" */
-#define SYSV /* define for System V, Solaris 2.x, newer versions */
+/* #define SYSV */ /* define for System V, Solaris 2.x, newer versions */
/* of Linux */
/* #define HPUX */ /* Hewlett-Packard's Unix, version 6.5 or higher */
/* use SYSV for < v6.5 */
@@ -46,7 +46,7 @@
* job control (note that AIX is SYSV otherwise)
* Also define this for AIX 3.2 */
-#define TERMINFO /* uses terminfo rather than termcap */
+/* #define TERMINFO */ /* uses terminfo rather than termcap */
/* Should be defined for most SYSV, SVR4 (including
* Solaris 2+), HPUX, and Linux systems. In
* particular, it should NOT be defined for the UNIXPC
@@ -297,7 +297,7 @@
#endif
#if defined(BSD) || defined(ULTRIX)
-#if !defined(DGUX) && !defined(SUNOS4)
+#if !defined(DGUX) && !defined(SUNOS4) && !defined(__FreeBSD__)
#define memcpy(d, s, n) bcopy(s, d, n)
#define memcmp(s1, s2, n) bcmp(s2, s1, n)
#endif

View File

@ -0,0 +1,11 @@
--- doc/lev_comp.6.orig Mon Apr 12 09:28:09 2004
+++ doc/lev_comp.6 Mon Apr 12 09:29:20 2004
@@ -563,7 +563,7 @@
Jean-Christophe Collet, David Cohrs.
.SH "SEE ALSO"
.PP
-dgn_comp(6), nethack(6)
+dgn_comp%%HACKEXT%%(6), %%HACKNAME%%(6)
.SH BUGS
.PP
Probably infinite.

View File

@ -0,0 +1,38 @@
--- doc/nethack.6.orig 2003-12-07 15:39:13.000000000 -0800
+++ doc/nethack.6 2015-12-27 14:12:43.428436000 -0800
@@ -5,7 +5,7 @@
.SH SYNOPSIS
.na
.hy 0
-.B nethack
+.B %%HACKNAME%%
[
.B \-d
.I directory
@@ -197,7 +197,7 @@
supplies a directory which is to serve as the playground.
It overrides the value from NETHACKDIR, HACKDIR,
or the directory specified by the game administrator during compilation
-(usually /usr/games/lib/nethackdir).
+(usually %%HACKDIR%%).
This option is usually only useful to the game administrator.
The playground must contain several auxiliary files such as help files,
the list of top scorers, and a subdirectory
@@ -222,7 +222,7 @@
distinction, as he may eventually release a new version of his own.
.SH FILES
.PP
-All files are in the playground, normally /usr/games/lib/nethackdir.
+All files are in the playground, normally %%HACKDIR%%.
If DLB was defined during the compile, the data files and special levels
will be inside a larger file, normally nhdat, instead of being separate
files.
@@ -295,7 +295,7 @@
In addition, SHOPTYPE is used in debugging (wizard) mode.
.SH "SEE ALSO"
.PP
-dgn_comp(6), lev_comp(6), recover(6)
+dgn_comp%%HACKEXT%%(6), lev_comp%%HACKEXT%%(6), recover%%HACKEXT%%(6)
.SH BUGS
.PP
Probably infinite.

View File

@ -0,0 +1,14 @@
--- win/Qt/qt_win.cpp.orig Tue Oct 14 11:29:05 2003
+++ win/Qt/qt_win.cpp Tue Oct 14 11:29:52 2003
@@ -75,6 +75,11 @@
#undef yn
#endif
+#ifdef Invisible
+/* Invisible was added to an enum in Qt 3.2, #defined in youprop.h */
+#undef Invisible
+#endif
+
#include "qt_win.h"
#include <qregexp.h>
#include <qpainter.h>

View File

@ -0,0 +1,20 @@
--- doc/recover.6.orig Mon Apr 12 09:28:09 2004
+++ doc/recover.6 Mon Apr 12 09:31:27 2004
@@ -31,7 +31,7 @@
supplies a directory which is the NetHack playground.
It overrides the value from NETHACKDIR, HACKDIR, or the directory
specified by the game administrator during compilation
-(usually /usr/games/lib/nethackdir).
+(usually %%HACKDIR%%).
.PP
For recovery to be possible,
.I nethack
@@ -103,7 +103,7 @@
.I nethack
will find them in the uncompressed form.
.SH "SEE ALSO"
-nethack(6)
+%%HACKNAME%%(6)
.SH BUGS
.PP
.I recover

View File

@ -0,0 +1,10 @@
--- src/files.c.orig 2015-12-07 08:26:01 UTC
+++ src/files.c
@@ -40,6 +40,7 @@ const
#if defined(UNIX) && defined(QT_GRAPHICS)
#include <sys/types.h>
+#include <limits.h>
#include <dirent.h>
#include <stdlib.h>
#endif

View File

@ -0,0 +1,47 @@
--- ./sys/unix/Makefile.doc.orig 2015-06-12 08:32:45.000000000 +0200
+++ ./sys/unix/Makefile.doc 2016-01-20 14:52:36.968982348 +0100
@@ -57,17 +57,17 @@
latex Guidebook.tex
-GAME = nethack
-MANDIR = /usr/man/man6
+GAME = nethack%%HACKEXT%%
+MANDIR = ${PREFIX}/man/man
MANEXT = 6
# manual installation for most BSD-style systems
-GAMEMANCREATE = cat nethack.6 | $(NHGREP) >
-LEVMANCREATE = cat lev_comp.6 | $(NHGREP) >
-DGNMANCREATE = cat dgn_comp.6 | $(NHGREP) >
-RCVRMANCREATE = cat recover.6 | $(NHGREP) >
-DLBMANCREATE = cat dlb.6 | $(NHGREP) >
-MDMANCREATE = cat makedefs.6 | $(NHGREP) >
+GAMEMANCREATE = cat nethack.6 | $(NHGREP) > nethack.6.out ; ${BSD_INSTALL_MAN} nethack.6.out
+LEVMANCREATE = cat lev_comp.6 | $(NHGREP) > lev_comp.6.out ; ${BSD_INSTALL_MAN} lev_comp.6.out
+DGNMANCREATE = cat dgn_comp.6 | $(NHGREP) > dgn_comp.6.out ; ${BSD_INSTALL_MAN} dgn_comp.6.out
+RCVRMANCREATE = cat recover.6 | $(NHGREP) > recover.6.out ; ${BSD_INSTALL_MAN} recover.6.out
+DLBMANCREATE = cat dlb.6 | $(NHGREP) > dlb.6.out ; ${BSD_INSTALL_MAN} dlb.6.out
+MDMANCREATE = cat makedefs.6 | $(NHGREP) > makedefs.6.out ; ${BSD_INSTALL_MAN} makedefs.6.out
# manual installation for most SYSV-style systems
# GAMEMANCREATE = cat nethack.6 | $(NHGREP) | nroff -man - >
# LEVMANCREATE = cat lev_comp.6 | $(NHGREP) | nroff -man - >
@@ -77,12 +77,12 @@
# MDMANCREATE = cat makedefs.6 | $(NHGREP) | nroff -man - >
manpages:
- -$(GAMEMANCREATE) $(MANDIR)/$(GAME).$(MANEXT)
- -$(LEVMANCREATE) $(MANDIR)/lev_comp.$(MANEXT)
- -$(DGNMANCREATE) $(MANDIR)/dgn_comp.$(MANEXT)
- -$(RCVRMANCREATE) $(MANDIR)/recover.$(MANEXT)
- -$(DLBMANCREATE) $(MANDIR)/dlb.$(MANEXT)
- -$(MDMANCREATE) $(MANDIR)/makedefs.$(MANEXT)
+ -$(GAMEMANCREATE) ${DESTDIR}$(MANDIR)$(MANEXT)/nethack%%HACKEXT%%.$(MANEXT)
+ -$(LEVMANCREATE) ${DESTDIR}$(MANDIR)$(MANEXT)/lev_comp%%HACKEXT%%.$(MANEXT)
+ -$(DGNMANCREATE) ${DESTDIR}$(MANDIR)$(MANEXT)/dgn_comp%%HACKEXT%%.$(MANEXT)
+ -$(RCVRMANCREATE) ${DESTDIR}$(MANDIR)$(MANEXT)/recover%%HACKEXT%%.$(MANEXT)
+ -$(DLBMANCREATE) ${DESTDIR}$(MANDIR)$(MANEXT)/dlb%%HACKEXT%%.$(MANEXT)
+ -$(MDMANCREATE) ${DESTDIR}$(MANDIR)$(MANEXT)/makedefs%%HACKEXT%%.$(MANEXT)
# manual creation for distribution
DISTRIB = Guidebook.txt nethack.txt lev_comp.txt dgn_comp.txt recover.txt \

View File

@ -0,0 +1,130 @@
--- ./sys/unix/Makefile.src.orig 2015-11-12 08:51:56.000000000 +0100
+++ ./sys/unix/Makefile.src 2016-01-20 14:51:33.282986884 +0100
@@ -149,13 +149,24 @@
# directories. The ones given below is the usual spot for linux systems.
# The paths are for glibconfig.h and gnomesupport.h respectively.
#
-GNOMEINC=-I/usr/lib/glib/include -I/usr/lib/gnome-libs/include -I../win/gnome
+GNOMEINC= $(shell ${GNOME_CONFIG} --cflags gnomeui)
# flags for debugging:
# CFLAGS = -g -I../include
+CFLAGS += -I../include
+ifeq ("$(GRAPHICS)","X11_GRAPHICS")
+CFLAGS += -DX11_GRAPHICS -I${LOCALBASE}/include
+endif
+ifeq ("$(GRAPHICS)","QT_GRAPHICS")
+CFLAGS += -DQT_GRAPHICS
+endif
+ifeq ("$(GRAPHICS)","GNOME_GRAPHICS")
+CFLAGS += -DGNOME_GRAPHICS ${CPPFLAGS}
+endif
#CFLAGS = -O -I../include
#LFLAGS =
+LINK = $(CC)
# The Qt and Be window systems are written in C++, while the rest of
# NetHack is standard C. If using Qt, uncomment the LINK line here to get
@@ -222,8 +233,27 @@
#
#
-#WINSRC = $(WINTTYSRC)
-#WINOBJ = $(WINTTYOBJ)
+WINSRC = $(WINTTYSRC)
+ifeq ("$(GRAPHICS)","X11_GRAPHICS")
+WINSRC += $(WINX11SRC)
+endif
+ifeq ("$(GRAPHICS)","QT_GRAPHICS")
+WINSRC += $(WINQTSRC)
+endif
+ifeq ("$(GRAPHICS)","GNOME_GRAPHICS")
+WINSRC += $(WINGNOMESRC)
+endif
+
+WINOBJ = $(WINTTYOBJ)
+ifeq ("$(GRAPHICS)","X11_GRAPHICS")
+WINOBJ += $(WINX11OBJ)
+endif
+ifeq ("$(GRAPHICS)","QT_GRAPHICS")
+WINOBJ += $(WINQTOBJ)
+endif
+ifeq ("$(GRAPHICS)","GNOME_GRAPHICS")
+WINOBJ += $(WINGNOMEOBJ)
+endif
# on some systems the termcap library is in -ltermcap or -lcurses
# on 386 Xenix, the -ltermlib tputs() seems not to work; use -lcurses instead
@@ -239,23 +269,23 @@
# WINTTYLIB = -lcurses
# WINTTYLIB = -lcurses16
# WINTTYLIB = -lncurses
-#WINTTYLIB = -ltermlib
+WINTTYLIB = -ltermlib
#
# libraries for X11
# If USE_XPM is defined in config.h, you will also need -lXpm here.
-WINX11LIB = -lXaw -lXmu -lXext -lXt -lX11
+WINX11LIB = -lXaw -lXmu -lXpm -lXext -lXt -lX11 -lSM -lICE -L${LOCALBASE}/lib
# WINX11LIB = -lXaw -lXmu -lXt -lX11
# WINX11LIB = -lXaw -lXmu -lXext -lXt -lXpm -lX11 -lm
# WINX11LIB = -lXaw -lXmu -lXpm -lXext -lXt -lX11 -lSM -lICE -lm # BSD/OS 2.0
#
# libraries for Qt
-WINQTLIB = -L$(QTDIR)/lib -lqt
+WINQTLIB = ${QTCFGLIBS} ${LIBQT}
#
# libraries for KDE (with Qt)
WINKDELIB = -lkdecore -lkdeui -lXext
#
# libraries for Gnome
-WINGNOMELIB = -lgnomeui -lgnome -lart_lgpl -lgtk -lgdk -lpopt
+WINGNOMELIB = $(shell ${GNOME_CONFIG} --libs gnomeui) ${LDFLAGS}
#
# libraries for Gem port
WINGEMLIB = -le_gem -lgem
@@ -263,7 +293,16 @@
# libraries for BeOS
WINBELIB = -lbe
-#WINLIB = $(WINTTYLIB)
+WINLIB = $(WINTTYLIB)
+ifeq ("$(GRAPHICS)","X11_GRAPHICS")
+WINLIB += $(WINX11LIB)
+endif
+ifeq ("$(GRAPHICS)","QT_GRAPHICS")
+WINLIB += $(WINQTLIB)
+endif
+ifeq ("$(GRAPHICS)","GNOME_GRAPHICS")
+WINLIB += $(WINGNOMELIB)
+endif
# any other strange libraries your system needs (for Sysunix only -- the more
# specialized targets should already be right)
@@ -296,7 +335,7 @@
LIBS =
# make NetHack
-GAME = nethack
+GAME = nethack%%HACKEXT%%
# GAME = nethack.prg
# if you defined RANDOM in unixconf.h/tosconf.h since your system did not come
@@ -482,13 +521,13 @@
# Qt windowport meta-object-compiler output
qt_kde0.moc: ../include/qt_kde0.h
- $(QTDIR)/bin/moc -o qt_kde0.moc ../include/qt_kde0.h
+ ${MOC} -o qt_kde0.moc ../include/qt_kde0.h
qt_win.moc: ../include/qt_win.h
- $(QTDIR)/bin/moc -o qt_win.moc ../include/qt_win.h
+ ${MOC} -o qt_win.moc ../include/qt_win.h
qttableview.moc: ../include/qttableview.h
- $(QTDIR)/bin/moc -o qttableview.moc ../include/qttableview.h
+ ${MOC} -o qttableview.moc ../include/qttableview.h
$(MAKEDEFS): ../util/makedefs.c $(CONFIG_H) ../include/permonst.h \
../include/objclass.h ../include/monsym.h \

View File

@ -0,0 +1,146 @@
--- ./sys/unix/Makefile.top.orig 2015-11-18 21:54:59.000000000 +0100
+++ ./sys/unix/Makefile.top 2016-01-20 14:57:30.972963262 +0100
@@ -18,18 +18,18 @@
# make NetHack
#PREFIX = /usr
-GAME = nethack
+GAME = nethack%%HACKEXT%%
# GAME = nethack.prg
#GAMEUID = games
-#GAMEGRP = bin
+GAMEGRP = games
# Permissions - some places use setgid instead of setuid, for instance
# See also the option "SECURE" in include/config.h
-#GAMEPERM = 04755
-FILEPERM = 0644
+GAMEPERM = 02755
+FILEPERM = 0664
# VARFILEPERM = 0644
EXEPERM = 0755
-DIRPERM = 0755
+DIRPERM = 0775
# VARDIRPERM = 0755
# VARDIR may also appear in unixconf.h as "VAR_PLAYGROUND" else HACKDIR
@@ -39,10 +39,11 @@
# therefore there should not be anything in HACKDIR that you want to keep
# (if there is, you'll have to do the installation by hand or modify the
# instructions)
-#HACKDIR = $(PREFIX)/games/lib/$(GAME)dir
-#VARDIR = $(HACKDIR)
+HACKDIR = ${PREFIX}/share/nethack%%HACKEXT%%
+VARDIR = $(HACKDIR)
+INSTDIR = $(HACKDIR)
# Where nethack.sh in installed. If this is not defined, the wrapper is not used.
-#SHELLDIR = $(PREFIX)/games
+SHELLDIR = ${PREFIX}/bin
# per discussion in Install.X11 and Install.Qt
#VARDATND =
@@ -53,7 +54,7 @@
# for BeOS
# VARDATND = beostiles
# for Gnome
-# VARDATND = x11tiles pet_mark.xbm pilemark.xpm rip.xpm mapbg.xpm
+VARDATND = x11tiles pet_mark.xbm pilemark.xbm rip.xpm mapbg.xpm
VARDATD = bogusmon data engrave epitaph oracles options quest.dat rumors
VARDAT = $(VARDATD) $(VARDATND)
@@ -201,56 +202,34 @@
-e '}' \
-e '$$s/.*/nodlb/p' < dat/options` ; \
$(MAKE) dofiles-$${target-nodlb}
- (cd dat ; cp symbols $(INSTDIR) )
- cp src/$(GAME) $(INSTDIR)
- cp util/recover $(INSTDIR)
- -if test -n '$(SHELLDIR)'; then rm -f $(SHELLDIR)/$(GAME); fi
+ (cd dat ; cp symbols ${DESTDIR}$(INSTDIR) )
+ cp src/$(GAME) ${DESTDIR}$(INSTDIR)/$(GAME)
+ cp util/recover ${DESTDIR}$(INSTDIR)
+ -if test -n '${DESTDIR}$(SHELLDIR)'; then rm -f ${DESTDIR}$(SHELLDIR)/$(GAME); fi
if test -n '$(SHELLDIR)'; then \
sed -e 's;/usr/games/lib/nethackdir;$(HACKDIR);' \
-e 's;HACKDIR/nethack;HACKDIR/$(GAME);' \
< sys/unix/nethack.sh \
- > $(SHELLDIR)/$(GAME) ; fi
-# set up their permissions
- -( cd $(INSTDIR) ; $(CHOWN) $(GAMEUID) $(GAME) recover ; \
- $(CHGRP) $(GAMEGRP) $(GAME) recover )
- chmod $(GAMEPERM) $(INSTDIR)/$(GAME)
- chmod $(EXEPERM) $(INSTDIR)/recover
- -if test -n '$(SHELLDIR)'; then \
- $(CHOWN) $(GAMEUID) $(SHELLDIR)/$(GAME); fi
- if test -n '$(SHELLDIR)'; then \
- $(CHGRP) $(GAMEGRP) $(SHELLDIR)/$(GAME); \
- chmod $(EXEPERM) $(SHELLDIR)/$(GAME); fi
- -( cd $(INSTDIR) ; $(CHOWN) $(GAMEUID) symbols ; \
- $(CHGRP) $(GAMEGRP) symbols ; \
- chmod $(FILEPERM) symbols )
+ > ${DESTDIR}$(SHELLDIR)/$(GAME) ; fi
dofiles-dlb: check-dlb
- ( cd dat ; cp nhdat $(DATNODLB) $(INSTDIR) )
-# set up their permissions
- -( cd $(INSTDIR) ; $(CHOWN) $(GAMEUID) nhdat $(DATNODLB) ; \
- $(CHGRP) $(GAMEGRP) nhdat $(DATNODLB) ; \
- chmod $(FILEPERM) nhdat $(DATNODLB) )
+ ( cd dat ; cp nhdat $(DATNODLB) ${DESTDIR}$(INSTDIR) )
dofiles-nodlb:
# copy over the game files
- ( cd dat ; cp $(DAT) $(INSTDIR) )
-# set up their permissions
- -( cd $(INSTDIR) ; $(CHOWN) $(GAMEUID) $(DAT) ; \
- $(CHGRP) $(GAMEGRP) $(DAT) ; \
- chmod $(FILEPERM) $(DAT) )
+ ( cd dat ; cp $(DAT) ${DESTDIR}$(INSTDIR) )
update: $(GAME) recover $(VARDAT) dungeon spec_levs
# (don't yank the old version out from under people who're playing it)
- -mv $(INSTDIR)/$(GAME) $(INSTDIR)/$(GAME).old
+ -mv ${DESTDIR}$(INSTDIR)/$(GAME) ${DESTDIR}$(INSTDIR)/$(GAME).old
# quest.dat is also kept open and has the same problems over NFS
# (quest.dat may be inside nhdat if dlb is in use)
- -mv $(INSTDIR)/quest.dat $(INSTDIR)/quest.dat.old
- -mv $(INSTDIR)/nhdat $(INSTDIR)/nhdat.old
+ -mv ${DESTDIR}$(INSTDIR)/quest.dat ${DESTDIR}$(INSTDIR)/quest.dat.old
+ -mv ${DESTDIR}$(INSTDIR)/nhdat ${DESTDIR}$(INSTDIR)/nhdat.old
# set up new versions of the game files
( $(MAKE) dofiles )
# touch time-sensitive files
-touch -c $(VARDIR)/bones* $(VARDIR)/?lock* $(VARDIR)/wizard*
- -touch -c $(VARDIR)/save/*
touch $(VARDIR)/perm $(VARDIR)/record
# and a reminder
@echo You may also want to install the man pages via the doc Makefile.
@@ -262,23 +241,16 @@
true; $(PREINSTALL)
# set up the directories
# not all mkdirs have -p; those that don't will create a -p directory
- -if test -n '$(SHELLDIR)'; then \
- mkdir -p $(SHELLDIR); fi
- rm -rf $(INSTDIR) $(VARDIR)
- -mkdir -p $(INSTDIR) $(VARDIR) $(VARDIR)/save
+ -if test -n '${DESTDIR}$(SHELLDIR)'; then \
+ mkdir -p ${DESTDIR}$(SHELLDIR); fi
+ rm -rf ${DESTDIR}$(INSTDIR) ${DESTDIR}$(VARDIR)
+ -mkdir -p ${DESTDIR}$(INSTDIR) ${DESTDIR}$(VARDIR) ${DESTDIR}$(VARDIR)/save
if test -d ./-p; then rmdir ./-p; fi
- -$(CHOWN) $(GAMEUID) $(INSTDIR) $(VARDIR) $(VARDIR)/save
- $(CHGRP) $(GAMEGRP) $(INSTDIR) $(VARDIR) $(VARDIR)/save
# order counts here:
- chmod $(DIRPERM) $(INSTDIR)
- chmod $(VARDIRPERM) $(VARDIR) $(VARDIR)/save
# set up the game files
( $(MAKE) dofiles )
# set up some additional files
- touch $(VARDIR)/perm $(VARDIR)/record $(VARDIR)/logfile $(VARDIR)/xlogfile
- -( cd $(VARDIR) ; $(CHOWN) $(GAMEUID) perm record logfile xlogfile ; \
- $(CHGRP) $(GAMEGRP) perm record logfile xlogfile ; \
- chmod $(VARFILEPERM) perm record logfile xlogfile )
+ touch ${DESTDIR}$(VARDIR)/perm ${DESTDIR}$(VARDIR)/record ${DESTDIR}$(VARDIR)/logfile ${DESTDIR}$(VARDIR)/xlogfile
true; $(POSTINSTALL)
# and a reminder
@echo You may also want to reinstall the man pages via the doc Makefile.

View File

@ -0,0 +1,23 @@
--- sys/unix/Makefile.utl.orig 2015-12-07 08:26:01 UTC
+++ sys/unix/Makefile.utl
@@ -92,8 +92,18 @@ NHSROOT=..
# flags for debugging:
# CFLAGS = -g -I../include
-#CFLAGS = -O -I../include
-#LFLAGS =
+CFLAGS += -I../include
+ifeq ("$(GRAPHICS)","X11_GRAPHICS")
+CFLAGS += -DX11_GRAPHICS
+endif
+ifeq ("$(GRAPHICS)","QT_GRAPHICS")
+CFLAGS += -DQT_GRAPHICS
+endif
+ifeq ("$(GRAPHICS)","GNOME_GRAPHICS")
+CFLAGS += -DGNOME_GRAPHICS
+endif
+
+LFLAGS =
LIBS =

View File

@ -0,0 +1,65 @@
--- util/makedefs.c.orig 2015-11-09 11:13:10 UTC
+++ util/makedefs.c
@@ -135,6 +135,7 @@
/*-end of vision defs-*/
static char filename[600];
+static char tempfilename[600]; /* grep.tmp.<pid> */
#ifdef FILE_PREFIX
/* if defined, a first argument not starting with - is
@@ -261,6 +262,12 @@
return 1;
}
+ if (snprintf(tempfilename, sizeof(tempfilename), "%s.%d", "grep.tmp", getpid()) >= sizeof(tempfilename)) {
+ Fprintf(stderr, "Cannot create temporary filename.");
+ (void) fflush(stderr);
+ return 1;
+ }
+
#ifdef FILE_PREFIX
if (argc >= 2 && argv[1][0] != '-') {
file_prefix = argv[1];
@@ -949,9 +956,9 @@
}
Fprintf(ofp, "%s", Dont_Edit_Data);
- tfp = getfp(DATA_TEMPLATE, "grep.tmp", WRTMODE);
+ tfp = getfp(DATA_TEMPLATE, tempfilename, WRTMODE);
grep0(ifp, tfp);
- ifp = getfp(DATA_TEMPLATE, "grep.tmp", RDTMODE);
+ ifp = getfp(DATA_TEMPLATE, tempfilename, RDTMODE);
while ((line = fgetline(ifp)) != 0) {
if (line[0] != '#' && line[0] != '\n')
@@ -961,7 +968,7 @@
Fclose(ifp);
Fclose(ofp);
- delete_file(DATA_TEMPLATE, "grep.tmp");
+ delete_file(DATA_TEMPLATE, tempfilename);
return;
}
@@ -1955,9 +1962,9 @@
}
Fprintf(ofp, "%s", Dont_Edit_Data);
- tfp = getfp(DATA_TEMPLATE, "grep.tmp", WRTMODE);
+ tfp = getfp(DATA_TEMPLATE, tempfilename, WRTMODE);
grep0(ifp, tfp);
- ifp = getfp(DATA_TEMPLATE, "grep.tmp", RDTMODE);
+ ifp = getfp(DATA_TEMPLATE, tempfilename, RDTMODE);
while ((line = fgetline(ifp)) != 0) {
SpinCursor(3);
@@ -1973,7 +1980,7 @@
Fclose(ifp);
Fclose(ofp);
- delete_file(DATA_TEMPLATE, "grep.tmp");
+ delete_file(DATA_TEMPLATE, tempfilename);
return;
}

View File

@ -0,0 +1,13 @@
--- win/tty/termcap.c.orig 2015-11-11 10:05:22 UTC
+++ win/tty/termcap.c
@@ -206,10 +206,6 @@ int *wid, *hgt;
error("Terminal must backspace.");
#else
if (!(BC = Tgetstr("bc"))) { /* termcap also uses bc/bs */
-#ifndef MINIMAL_TERM
- if (!tgetflag("bs"))
- error("Terminal must backspace.");
-#endif
BC = tbufptr;
tbufptr += 2;
*BC = '\b';

View File

@ -0,0 +1,14 @@
#!/bin/sh
if [ "${2}" = "POST-DEINSTALL" ]; then
if [ -d "${PKG_PREFIX}/%%HACKDIR%%" ]; then
echo
echo "The ${1} save files have not been removed."
echo
echo "If you are deleting ${1} permanently then you can "
echo "remove the save files with the command:"
echo
echo " rm -rf ${PKG_PREFIX}/%%HACKDIR%%"
echo
fi
fi

View File

@ -0,0 +1,5 @@
This is nethack, a classic hack'n'slash adventure game.
You and your faithful feline (or commited canine) are on a quest
to retrieve the lost Amulet of Yendor. Good luck!
WWW: http://www.nethack.org/

178
games/nethack36/pkg-plist Normal file
View File

@ -0,0 +1,178 @@
%%HACKLINK%%bin/nethack
@mode 555
bin/%%HACKNAME%%
@owner games
@group games
@mode 02755
%%DATADIR%%/%%HACKNAME%%
@mode
%%DATADIR%%/Arc-fila.lev
%%DATADIR%%/Arc-filb.lev
%%DATADIR%%/Arc-goal.lev
%%DATADIR%%/Arc-loca.lev
%%DATADIR%%/Arc-strt.lev
%%DATADIR%%/Bar-fila.lev
%%DATADIR%%/Bar-filb.lev
%%DATADIR%%/Bar-goal.lev
%%DATADIR%%/Bar-loca.lev
%%DATADIR%%/Bar-strt.lev
%%DATADIR%%/Cav-fila.lev
%%DATADIR%%/Cav-filb.lev
%%DATADIR%%/Cav-goal.lev
%%DATADIR%%/Cav-loca.lev
%%DATADIR%%/Cav-strt.lev
%%DATADIR%%/Hea-fila.lev
%%DATADIR%%/Hea-filb.lev
%%DATADIR%%/Hea-goal.lev
%%DATADIR%%/Hea-loca.lev
%%DATADIR%%/Hea-strt.lev
%%DATADIR%%/Kni-fila.lev
%%DATADIR%%/Kni-filb.lev
%%DATADIR%%/Kni-goal.lev
%%DATADIR%%/Kni-loca.lev
%%DATADIR%%/Kni-strt.lev
%%DATADIR%%/Mon-fila.lev
%%DATADIR%%/Mon-filb.lev
%%DATADIR%%/Mon-goal.lev
%%DATADIR%%/Mon-loca.lev
%%DATADIR%%/Mon-strt.lev
%%DATADIR%%/Pri-fila.lev
%%DATADIR%%/Pri-filb.lev
%%DATADIR%%/Pri-goal.lev
%%DATADIR%%/Pri-loca.lev
%%DATADIR%%/Pri-strt.lev
%%DATADIR%%/Ran-fila.lev
%%DATADIR%%/Ran-filb.lev
%%DATADIR%%/Ran-goal.lev
%%DATADIR%%/Ran-loca.lev
%%DATADIR%%/Ran-strt.lev
%%DATADIR%%/Rog-fila.lev
%%DATADIR%%/Rog-filb.lev
%%DATADIR%%/Rog-goal.lev
%%DATADIR%%/Rog-loca.lev
%%DATADIR%%/Rog-strt.lev
%%DATADIR%%/Sam-fila.lev
%%DATADIR%%/Sam-filb.lev
%%DATADIR%%/Sam-goal.lev
%%DATADIR%%/Sam-loca.lev
%%DATADIR%%/Sam-strt.lev
%%DATADIR%%/Tou-fila.lev
%%DATADIR%%/Tou-filb.lev
%%DATADIR%%/Tou-goal.lev
%%DATADIR%%/Tou-loca.lev
%%DATADIR%%/Tou-strt.lev
%%DATADIR%%/Val-fila.lev
%%DATADIR%%/Val-filb.lev
%%DATADIR%%/Val-goal.lev
%%DATADIR%%/Val-loca.lev
%%DATADIR%%/Val-strt.lev
%%DATADIR%%/Wiz-fila.lev
%%DATADIR%%/Wiz-filb.lev
%%DATADIR%%/Wiz-goal.lev
%%DATADIR%%/Wiz-loca.lev
%%DATADIR%%/Wiz-strt.lev
%%DATADIR%%/air.lev
%%DATADIR%%/asmodeus.lev
%%DATADIR%%/astral.lev
%%DATADIR%%/baalz.lev
%%DATADIR%%/bigrm-1.lev
%%DATADIR%%/bigrm-2.lev
%%DATADIR%%/bigrm-3.lev
%%DATADIR%%/bigrm-4.lev
%%DATADIR%%/bigrm-5.lev
%%DATADIR%%/bigrm-10.lev
%%DATADIR%%/bigrm-6.lev
%%DATADIR%%/bigrm-7.lev
%%DATADIR%%/bigrm-8.lev
%%DATADIR%%/bigrm-9.lev
%%DATADIR%%/bogusmon
%%DATADIR%%/castle.lev
%%DATADIR%%/cmdhelp
%%DATADIR%%/data
%%DATADIR%%/dungeon
%%DATADIR%%/earth.lev
%%DATADIR%%/engrave
%%DATADIR%%/epitaph
%%DATADIR%%/fakewiz1.lev
%%DATADIR%%/fakewiz2.lev
%%DATADIR%%/fire.lev
%%DATADIR%%/help
%%DATADIR%%/hh
%%DATADIR%%/history
%%DATADIR%%/juiblex.lev
%%DATADIR%%/knox.lev
%%DATADIR%%/license
@mode 664
%%DATADIR%%/logfile
@mode
%%DATADIR%%/mapbg.xpm
%%DATADIR%%/medusa-1.lev
%%DATADIR%%/medusa-2.lev
%%DATADIR%%/medusa-3.lev
%%DATADIR%%/medusa-4.lev
%%DATADIR%%/minefill.lev
%%DATADIR%%/minend-1.lev
%%DATADIR%%/minend-2.lev
%%DATADIR%%/minend-3.lev
%%DATADIR%%/minetn-1.lev
%%DATADIR%%/minetn-2.lev
%%DATADIR%%/minetn-3.lev
%%DATADIR%%/minetn-4.lev
%%DATADIR%%/minetn-5.lev
%%DATADIR%%/minetn-6.lev
%%DATADIR%%/minetn-7.lev
%%DATADIR%%/opthelp
%%DATADIR%%/options
%%DATADIR%%/oracle.lev
%%DATADIR%%/oracles
%%DATADIR%%/orcus.lev
@mode 664
%%DATADIR%%/perm
@mode
%%DATADIR%%/pet_mark.xbm
%%DATADIR%%/pilemark.xbm
%%DATADIR%%/quest.dat
@mode 664
%%DATADIR%%/record
@mode
@mode 02755
%%DATADIR%%/recover
@mode
%%DATADIR%%/rip.xpm
%%DATADIR%%/rumors
%%DATADIR%%/sanctum.lev
%%DATADIR%%/soko1-1.lev
%%DATADIR%%/soko1-2.lev
%%DATADIR%%/soko2-1.lev
%%DATADIR%%/soko2-2.lev
%%DATADIR%%/soko3-1.lev
%%DATADIR%%/soko3-2.lev
%%DATADIR%%/soko4-1.lev
%%DATADIR%%/soko4-2.lev
%%DATADIR%%/symbols
%%DATADIR%%/sysconf
%%DATADIR%%/tower1.lev
%%DATADIR%%/tower2.lev
%%DATADIR%%/tower3.lev
%%DATADIR%%/tribute
%%DATADIR%%/valley.lev
%%DATADIR%%/water.lev
%%DATADIR%%/wizard1.lev
%%DATADIR%%/wizard2.lev
%%DATADIR%%/wizard3.lev
%%DATADIR%%/wizhelp
%%DATADIR%%/x11tiles
@mode 664
%%DATADIR%%/xlogfile
@mode
@owner
@group
man/man6/dgn_comp%%HACKEXT%%.6.gz
man/man6/dlb%%HACKEXT%%.6.gz
man/man6/lev_comp%%HACKEXT%%.6.gz
man/man6/makedefs%%HACKEXT%%.6.gz
man/man6/%%HACKNAME%%.6.gz
man/man6/recover%%HACKEXT%%.6.gz
%%PORTDOCS%%%%DOCSDIR%%/Guidebook.txt
@dir(games,games,0775) %%DATADIR%%/save
@dir(games,games,0775) %%DATADIR%%