Skip to content

Commit

Permalink
games/xnethack: update to 7.0
Browse files Browse the repository at this point in the history
While we are add it, add another flavour for the Qt frontend.

Changelog:	https://github.com/copperwater/xNetHack/blob/master/doc/xnh-changelog-7.0.md

PR:	262483
  • Loading branch information
clausecker authored and neelchauhan committed Mar 11, 2022
1 parent ccefacf commit fa2a8dd
Show file tree
Hide file tree
Showing 16 changed files with 171 additions and 156 deletions.
21 changes: 17 additions & 4 deletions games/xnethack/Makefile
@@ -1,7 +1,6 @@
PORTNAME= xNetHack
DISTVERSIONPREFIX= xnh
DISTVERSION= 6.1
PORTREVISION= 1
DISTVERSION= 7.0
CATEGORIES= games

MAINTAINER= fuz@fuz.su
Expand All @@ -12,9 +11,10 @@ LICENSE_NAME= NETHACK GENERAL PUBLIC LICENSE
LICENSE_FILE= ${WRKSRC}/dat/license
LICENSE_PERMS= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept

FLAVORS= x11 nox11
FLAVORS= x11 nox11 qt
FLAVOR?= ${FLAVORS:[1]}
nox11_PKGNAMESUFFIX= -nox11
qt_PKGNAMESUFFIX= -qt

USES= alias compiler:c11 gmake ncurses tar:tgz lua:54
USE_GITHUB= yes
Expand All @@ -33,11 +33,20 @@ DOCSDIR= ${PREFIX}/share/doc/${HACKNAME}
.if ${FLAVOR} == "x11"
USES+= xorg
USE_XORG= xaw xpm xmu xext xt x11 sm ice
CFLAGS+= -DX11_GRAPHICS -DUSE_TILES
CFLAGS+= -DUSE_TILES
GRAPHICS= X11_GRAPHICS
.elif ${FLAVOR} == "nox11"
GRAPHICS= # none
.elif ${FLAVOR} == "qt"
USES+= localbase pkgconfig qt:5
USE_QT= buildtools_build core gui multimedia network widgets
MAKE_ENV+= MOCPATH=${MOC} LINK="${CXX} -pie"
# Qt wants PIC for some reason. For C code, PIE should be enough.
CFLAGS+= -I${QT_INCDIR} -fpie
CXXFLAGS+= -I${QT_INCDIR} -fpic
GRAPHICS= QT_GRAPHICS
.endif

CFLAGS+= -DNOMAIL -DCURSES_GRAPHICS

OPTIONS_DEFINE= DOCS
Expand All @@ -63,7 +72,10 @@ post-patch:
.endif

do-configure:
${TOUCH} ${WRKSRC}/dat/gitinfo.txt
@cd ${WRKSRC}/sys/unix; ${SH} setup.sh
# work around a race condition
cd ${WRKSRC}/util; ${MAKE_CMD} tiletxt.c

post-install:
${STRIP_CMD} ${STAGEDIR}${DATADIR}/recover
Expand All @@ -75,6 +87,7 @@ post-install:
@${CP} ${STAGEDIR}/${DATADIR}/sysconf ${STAGEDIR}/${DATADIR}/sysconf.sample
# Make "sample" files from records to prevent them being removed
# if they have been altered
@${CP} ${STAGEDIR}/${DATADIR}/logfile ${STAGEDIR}/${DATADIR}/livelog.sample
@${CP} ${STAGEDIR}/${DATADIR}/logfile ${STAGEDIR}/${DATADIR}/logfile.sample
@${CP} ${STAGEDIR}/${DATADIR}/record ${STAGEDIR}/${DATADIR}/record.sample
@${CP} ${STAGEDIR}/${DATADIR}/xlogfile ${STAGEDIR}/${DATADIR}/xlogfile.sample
Expand Down
6 changes: 3 additions & 3 deletions games/xnethack/distinfo
@@ -1,3 +1,3 @@
TIMESTAMP = 1620650405
SHA256 (copperwater-xNetHack-xnh6.1_GH0.tar.gz) = 48cdb14a0b30cd439e04ccc3daa21d4db8b2abe9090dd7dcb2fdfa839a9572d8
SIZE (copperwater-xNetHack-xnh6.1_GH0.tar.gz) = 5850953
TIMESTAMP = 1646737487
SHA256 (copperwater-xNetHack-xnh7.0_GH0.tar.gz) = d2f9ed47a2dde9d1dfeba073f4f2cbb6c226f8d98457a860b56ec00551429725
SIZE (copperwater-xNetHack-xnh7.0_GH0.tar.gz) = 5985717
4 changes: 2 additions & 2 deletions games/xnethack/files/patch-doc_dlb.6
@@ -1,6 +1,6 @@
--- doc/dlb.6.orig 2021-03-22 22:28:14 UTC
--- doc/dlb.6.orig 2022-03-07 23:57:15 UTC
+++ doc/dlb.6
@@ -96,7 +96,7 @@ List the contents of the archive 'foo':
@@ -95,7 +95,7 @@ List the contents of the archive 'foo':
Kenneth Lorber
.SH "SEE ALSO"
.PP
Expand Down
17 changes: 4 additions & 13 deletions games/xnethack/files/patch-doc_nethack.6
@@ -1,6 +1,6 @@
--- doc/nethack.6.orig 2021-03-22 22:28:14 UTC
--- doc/nethack.6.orig 2022-03-07 23:57:15 UTC
+++ doc/nethack.6
@@ -17,7 +17,7 @@ nethack \- Exploring The Mazes of Menace
@@ -16,7 +16,7 @@ nethack \- Exploring The Mazes of Menace
.SH SYNOPSIS
.na
.hy 0
Expand All @@ -9,7 +9,7 @@
[
.B \-d
.I directory
@@ -219,7 +219,7 @@ option, which must be the first argument if it appears
@@ -218,7 +218,7 @@ option, which must be the first argument if it appears
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
Expand All @@ -18,7 +18,7 @@
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
@@ -265,7 +265,7 @@ name is '.xnethackrc' in the user's home directory.
@@ -264,7 +264,7 @@ name is '.xnethackrc' in the user's home directory.

.br
All other files are in the playground directory,
Expand All @@ -27,12 +27,3 @@
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.
@@ -392,7 +392,7 @@ SHOPTYPE and SPLEVTYPE can be used in debugging (wizar
DEBUGFILES can be used if the program was built with 'DEBUG' enabled.
.SH "SEE ALSO"
.PP
-recover(6)
+recover(6)
.SH BUGS
.PP
Probably infinite.
6 changes: 3 additions & 3 deletions games/xnethack/files/patch-doc_recover.6
@@ -1,6 +1,6 @@
--- doc/recover.6.orig 2021-03-22 22:28:14 UTC
--- doc/recover.6.orig 2022-03-07 23:57:15 UTC
+++ doc/recover.6
@@ -43,7 +43,7 @@ option, which must be the first argument if it appears
@@ -42,7 +42,7 @@ option, which must be the first argument if it appears
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
Expand All @@ -9,7 +9,7 @@
.PP
^?ALLDOCS
For recovery to be possible,
@@ -130,7 +130,7 @@ but even a compression-using
@@ -129,7 +129,7 @@ but even a compression-using
.I nethack
will find them in the uncompressed form.
.SH "SEE ALSO"
Expand Down
8 changes: 4 additions & 4 deletions games/xnethack/files/patch-include-config.h
@@ -1,6 +1,6 @@
--- include/config.h.orig 2021-03-22 22:28:14 UTC
--- include/config.h.orig 2022-03-07 23:57:15 UTC
+++ include/config.h
@@ -294,11 +294,11 @@
@@ -303,11 +303,11 @@

#if defined(UNIX) && !defined(ZLIB_COMP) && !defined(COMPRESS)
/* path and file name extension for compression program */
Expand All @@ -16,7 +16,7 @@
#endif

#ifndef COMPRESS
@@ -383,7 +383,7 @@
@@ -392,7 +392,7 @@
* otherwise it will be the current directory.
*/
#ifndef HACKDIR
Expand All @@ -25,7 +25,7 @@
#endif

/*
@@ -646,7 +646,7 @@ typedef unsigned char uchar;
@@ -653,7 +653,7 @@ typedef unsigned char uchar;
#ifdef DUMPLOG

#ifndef DUMPLOG_FILE
Expand Down
4 changes: 2 additions & 2 deletions games/xnethack/files/patch-include-unixconf.h
@@ -1,4 +1,4 @@
--- include/unixconf.h.orig 2021-03-22 22:28:14 UTC
--- include/unixconf.h.orig 2022-03-07 23:57:15 UTC
+++ include/unixconf.h
@@ -20,13 +20,13 @@
*/
Expand All @@ -16,7 +16,7 @@
/* of Linux */
/* #define HPUX */ /* Hewlett-Packard's Unix, version 6.5 or higher */
/* use SYSV for < v6.5 */
@@ -315,7 +315,7 @@
@@ -317,7 +317,7 @@
#endif

#if defined(BSD) || defined(ULTRIX)
Expand Down
13 changes: 8 additions & 5 deletions games/xnethack/files/patch-sys-unix-Makefile.doc
@@ -1,8 +1,11 @@
--- sys/unix/Makefile.doc.orig 2021-03-22 22:28:14 UTC
--- sys/unix/Makefile.doc.orig 2022-03-07 23:57:15 UTC
+++ sys/unix/Makefile.doc
@@ -66,15 +66,15 @@ Guidebook.dvi: Guidebook.tex
latex Guidebook.tex

@@ -73,17 +73,17 @@ Guidebook.dvi : Guidebook.tex
# (note: 'make makedefs', not 'make $(MAKEDEFS)')
$(MAKEDEFS) : ../util/makedefs.c ../include/config.h ../src/mdlib.c \
../util/mdgrep.h
- ( cd ../util ; make makedefs )
+ ( cd ../util ; ${MAKE} makedefs )

-GAME = nethack
-MANDIR = /usr/man/man6
Expand All @@ -22,7 +25,7 @@
# manual installation for most SYSV-style systems
# GAMEMANCREATE = cat nethack.6 | $(NHGREP) | nroff -man - >
# RCVRMANCREATE = cat recover.6 | $(NHGREP) | nroff -man - >
@@ -82,10 +82,10 @@ MDMANCREATE = cat makedefs.6 | $(NHGREP) >
@@ -91,10 +91,10 @@ MDMANCREATE = cat makedefs.6 | $(NHGREP) >
# MDMANCREATE = cat makedefs.6 | $(NHGREP) | nroff -man - >

manpages:
Expand Down
72 changes: 42 additions & 30 deletions games/xnethack/files/patch-sys-unix-Makefile.src
@@ -1,6 +1,6 @@
--- sys/unix/Makefile.src.orig 2021-03-22 22:28:14 UTC
--- sys/unix/Makefile.src.orig 2022-03-07 23:57:15 UTC
+++ sys/unix/Makefile.src
@@ -169,9 +169,17 @@ SYSOBJ = $(TARGETPFX)ioctl.o $(TARGETPFX)unixmain.o $(
@@ -169,14 +169,22 @@ SYSOBJ = $(TARGETPFX)ioctl.o $(TARGETPFX)unixmain.o $(

# flags for debugging:
# CFLAGS = -g -I../include
Expand All @@ -15,11 +15,17 @@
#CFLAGS = -O -I../include
-#LFLAGS =
+LFLAGS += -L${LUA_LIBDIR}
+LINK = $(CC)
+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
@@ -297,6 +305,29 @@ WINBEOBJ =
# the C++ libraries linked in.
-CXXFLAGS = $(CCXXFLAGS) -I. -I$(QTDIR)/include $(QTCXXFLAGS)
+CXXFLAGS += -I. -I../include -I${LUA_INCDIR}
CXX ?= g++
MOC ?= moc
MOCPATH ?= $(QTDIR)/bin/$(MOC)
@@ -305,6 +313,29 @@ WINBEOBJ =
# Curses - Karl Garrison, Tangles
#WINSRC = $(WINCURSESSRC)
#WINOBJ = $(WINCURSESOBJ)
Expand Down Expand Up @@ -49,15 +55,15 @@
#
# on some systems the termcap library is in -ltermcap or -lcurses
# on 386 Xenix, the -ltermlib tputs() seems not to work; use -lcurses instead
@@ -313,6 +344,7 @@ WINBEOBJ =
@@ -321,6 +352,7 @@ WINBEOBJ =
# WINTTYLIB = -lcurses16
# WINTTYLIB = -lncurses
#WINTTYLIB = -ltermlib
+WINTTYLIB = -lncurses -L${LOCALBASE}/lib
#
# libraries for X11
# If USE_XPM is defined in config.h, you will also need -lXpm here.
@@ -320,10 +352,13 @@ WINBEOBJ =
@@ -328,16 +360,19 @@ WINBEOBJ =
# 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
Expand All @@ -67,12 +73,19 @@
# libraries for Qt 3
-WINQT3LIB = -L$(QTDIR)/lib -lqt
+#WINQTLIB = -L$(QTDIR)/lib -lqt
+WINQT3LIB = ${QTCFGLIBS} ${LIBQT}
+WINQTLIB = ${QTCFGLIBS} ${LIBQT}
+#WINQT3LIB = ${QTCFGLIBS} ${LIBQT}
+#WINQTLIB = ${QTCFGLIBS} ${LIBQT}
#
# libraries for Qt 4
WINQT4LIB = `pkg-config QtGui --libs`
@@ -339,7 +374,7 @@ WINBELIB = -lbe
#
# libraries for Qt 5 (use with WINQTSRC and WINQTOBJ)
-WINQT5LIB = `pkg-config Qt5Gui Qt5Widgets Qt5Multimedia --libs`
+WINQTLIB = `pkg-config Qt5Gui Qt5Widgets Qt5Multimedia --libs`
#
# libraries for KDE (with Qt)
WINKDELIB = -lkdecore -lkdeui -lXext
@@ -347,7 +382,7 @@ WINBELIB = -lbe
#
# libraries for curses port
# link with ncurses
Expand All @@ -81,7 +94,7 @@
# link with pdcurses for SDL, installed in a separate directory
#WINCURSESLIB = -L/usr/local/lib/pdcurses -lpdcurses -lSDL
# same as above, for XCurses
@@ -349,6 +384,18 @@ WINCURSESLIB = -lncurses
@@ -357,6 +392,18 @@ WINCURSESLIB = -lncurses
#
# For Curses
#WINLIB = $(WINCURSESLIB)
Expand All @@ -100,16 +113,16 @@
#
# some platforms need to build the support libraries
# BUILDMORE = $(TARGETPFX)pdcurses.a
@@ -384,7 +431,7 @@ WINCURSESLIB = -lncurses
# LIBS =

# make NetHack
-GAME = xnethack
+GAME = xnethack
# GAME = nethack.prg
GAMEBIN = $(GAME)
@@ -412,7 +459,7 @@ AWK = awk
# skip it--if nethack's sources don't reside in a git repository than
# the script which creates that file will fail benignly and 'makedefs -v'
# will proceed without it
-GITINFO=1
+GITINFO=0

@@ -412,7 +459,7 @@ GITINFO=1
# if you change this to 1, feedback while building will omit -Dthis -Wthat
# -Isomewhere so that each file being compiled is listed on one short line;
@@ -420,7 +467,7 @@ GITINFO=1
# (rather than just in suffix default rule), such as is implemented by
# gnu make and others which have picked up its extensions;
# allowed values are 0, 1, and empty (which behaves like 0)
Expand All @@ -118,17 +131,16 @@

# ----------------------------------------
#
@@ -465,7 +512,8 @@ PACKAGE=@true
@@ -473,7 +520,7 @@ PACKAGE=@true
MAKEDEFS = ../util/makedefs

# -lm required by lua
-LUALIB = ../lib/lua/liblua.a -lm
+#LUALIB = ../lib/lua/liblua.a -lm
+LUALIB = -llua-${LUA_VER} -lm
-LUALIB = ../lib/lua/liblua.a -lm $(DLLIB)
+LUALIB = -llua-${LUA_VER} -lm $(DLLIB)

# timestamp files to reduce `make' overhead and shorten .o dependency lists
CONFIG_H = ../src/config.h-t
@@ -654,7 +702,7 @@ DUMB.Setup: ../include/extern.h
@@ -668,7 +715,7 @@ DUMB.Setup: ../include/extern.h
cp ../include/extern.DUMB ../include/extern.h
@touch DUMB.Setup

Expand All @@ -137,18 +149,18 @@
@( cd .. ; $(MAKE) lua_support )

# dependencies for makedefs and its outputs, which the util
@@ -673,11 +721,11 @@ objects.o:
@@ -687,11 +734,11 @@ objects.o:

# Qt 3 windowport meta-object-compiler output
# outdated Qt 3 windowport meta-object-compiler output
qt3_kde0.moc: ../win/Qt3/qt3_kde0.h
- $(QTDIR)/bin/moc -o qt3kde0.moc ../win/Qt3/qt3_kde0.h
+ ${MOC} -o qt3kde0.moc ../win/Qt3/qt3_kde0.h
qt3_win.moc: ../win/Qt3/qt3_win.h
- $(QTDIR)/bin/moc -o qt3win.moc ../win/Qt3/qt3_win.h
+ ${MOC} -o qt3win.moc ../win/Qt3/qt3_win.h
qt3tableview.moc: ../win/Qt3/qt3tableview.h
- $(QTDIR)/bin/moc -o qt3tableview.moc ../win/Qt/qt3tableview.h
+ ${MOC} -o qt3tableview.moc ../win/Qt/qt3tableview.h
- $(QTDIR)/bin/moc -o qt3tableview.moc ../win/Qt3/qt3tableview.h
+ ${MOC} -o qt3tableview.moc ../win/Qt3/qt3tableview.h

# Qt 4 windowport meta-object-compiler output
qt_kde0.moc : ../win/Qt/qt_kde0.h
# build monst.o and objects.o before executing '$(MAKE) makedefs'
$(MAKEDEFS): $(FIRSTOBJ) \

0 comments on commit fa2a8dd

Please sign in to comment.