Skip to content

Commit

Permalink
games/xnethack: update to 8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
clausecker committed Jun 5, 2023
1 parent eb72fc1 commit e675bcb
Show file tree
Hide file tree
Showing 17 changed files with 148 additions and 96 deletions.
17 changes: 8 additions & 9 deletions games/xnethack/Makefile
@@ -1,7 +1,6 @@
PORTNAME= xNetHack
DISTVERSIONPREFIX= xnh
DISTVERSION= 7.1
PORTREVISION= 1
DISTVERSION= 8.0
CATEGORIES= games

MAINTAINER= fuz@FreeBSD.org
Expand Down Expand Up @@ -42,10 +41,10 @@ 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
MAKE_ENV+= MOCPATH=${MOC} LINK=${CXX}
CFLAGS+= -I${QT_INCDIR} -DSND_LIB_QTSOUND
CXXFLAGS+= -fpic -I${QT_INCDIR} -DQT_WIDGETS_LIB -DQT_MULTIMEDIA_LIB \
-DQT_NETWORK_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DSND_LIB_QTSOUND
GRAPHICS= QT_GRAPHICS
.endif

Expand All @@ -61,12 +60,12 @@ SANDBOX_CFLAGS= -DNHL_SANDBOX

.include <bsd.port.pre.mk>

post-patch:
.for f in include/config.h sys/unix/Makefile.doc sys/unix/Makefile.src sys/unix/Makefile.top
pre-configure:
.for f in include/config.h sys/unix/Makefile.top
@${REINPLACE_CMD} -e 's|%%HACKDIR%%|${PREFIX}/${HACKDIR}|g' \
${WRKSRC}/${f}
.endfor
.for f in dlb.6 nethack.6 recover.6
.for f in nethack.6 recover.6
@${REINPLACE_CMD} -e 's|%%HACKDIR%%|${PREFIX}/${HACKDIR}|g' \
${WRKSRC}/doc/${f}
.endfor
Expand Down
6 changes: 3 additions & 3 deletions games/xnethack/distinfo
@@ -1,3 +1,3 @@
TIMESTAMP = 1653608416
SHA256 (copperwater-xNetHack-xnh7.1_GH0.tar.gz) = 086c12275463c5c008e594713a6a5ee26dd075ce8740c956e19485771f2d46f6
SIZE (copperwater-xNetHack-xnh7.1_GH0.tar.gz) = 6102486
TIMESTAMP = 1685888297
SHA256 (copperwater-xNetHack-xnh8.0_GH0.tar.gz) = a9861ccec6274037ad95877a9b5c1c1ef6727bbc96f8a896ada672b4ad4c80bb
SIZE (copperwater-xNetHack-xnh8.0_GH0.tar.gz) = 10779285
34 changes: 26 additions & 8 deletions games/xnethack/files/patch-doc_nethack.6
@@ -1,15 +1,33 @@
--- doc/nethack.6.orig 2022-03-07 23:57:15 UTC
--- doc/nethack.6.orig 2023-05-16 21:33:58 UTC
+++ doc/nethack.6
@@ -16,7 +16,7 @@ nethack \- Exploring The Mazes of Menace
.SH SYNOPSIS
.na
.hy 0
@@ -20,7 +20,7 @@ nethack \- Exploring The Mazes of Menace
.\" have been arranged to fit within an 80-column page with nearly full
.\" lines while avoiding splitting "[" and "-opt ]" or "[ -opt" and "]"
.\" across line boundaries. It would be better to do that with 'roff magic.
-.B nethack
+.B xnethack
[
.B \-d
.BR \-d | \-\-directory
.I directory
@@ -218,7 +218,7 @@ option, which must be the first argument if it appears
@@ -92,7 +92,7 @@ Also
.BR \-W | \-Wiz
]
.PP
-.B nethack
+.B xnethack
[
.BR \-d | \-\-directory
.I directory
@@ -114,7 +114,7 @@ Also
.I playernames
]
.PP
-.B nethack
+.B xnethack
[
.B \-\-usage
|
@@ -310,7 +310,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 +36,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
@@ -264,7 +264,7 @@ name is '.xnethackrc' in the user's home directory.
@@ -418,7 +418,7 @@ name is '.xnethackrc' in the user's home directory.

.br
All other files are in the playground directory,
Expand Down
15 changes: 12 additions & 3 deletions games/xnethack/files/patch-include-config.h
@@ -1,4 +1,4 @@
--- include/config.h.orig 2022-05-26 12:31:08 UTC
--- include/config.h.orig 2023-05-16 21:33:58 UTC
+++ include/config.h
@@ -312,11 +312,11 @@

Expand Down Expand Up @@ -26,15 +26,24 @@

/*
@@ -662,7 +662,7 @@ typedef unsigned char uchar;
#ifdef DUMPLOG
/* TEMPORARY - MAKE UNCONDITIONAL BEFORE RELEASE */
/* undef this to check if sandbox breaks something */
-#define NHL_SANDBOX
+/* #define NHL_SANDBOX */

/* End of Section 4 */

@@ -691,7 +691,7 @@ typedef unsigned char uchar;
#define DUMPLOG_MSG_COUNT 50
#endif /* DUMPLOG_MSG_COUNT */
#ifndef DUMPLOG_FILE
-#define DUMPLOG_FILE "/tmp/xnethack.%n.%d.log"
+#define DUMPLOG_FILE "/tmp/xnethack.%v.%u.%n.%D.log"
/* DUMPLOG_FILE allows following placeholders:
%% literal '%'
%v version (eg. "3.6.3-0")
@@ -697,7 +697,7 @@ typedef unsigned char uchar;
@@ -720,7 +720,7 @@ typedef unsigned char uchar;
/* TEMPORARY - MAKE UNCONDITIONAL BEFORE RELEASE */
/* undef this to check if sandbox breaks something */
Expand Down
13 changes: 0 additions & 13 deletions games/xnethack/files/patch-include-system.h

This file was deleted.

4 changes: 2 additions & 2 deletions games/xnethack/files/patch-include-unixconf.h
@@ -1,4 +1,4 @@
--- include/unixconf.h.orig 2022-03-07 23:57:15 UTC
--- include/unixconf.h.orig 2023-05-16 21:33:58 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 */
@@ -317,7 +317,7 @@
@@ -327,7 +327,7 @@
#endif

#if defined(BSD) || defined(ULTRIX)
Expand Down
25 changes: 8 additions & 17 deletions games/xnethack/files/patch-src_nhlua.c
Expand Up @@ -6,35 +6,26 @@ mismatch.
To rule out that possibility, the sandbox code is left disabled by
default but can be enabled if desired through the SANDBOX option.

--- src/nhlua.c.orig 2022-06-25 04:31:43 UTC
--- src/nhlua.c.orig 2023-05-16 21:33:58 UTC
+++ src/nhlua.c
@@ -1652,20 +1652,6 @@ DISABLE_WARNING_CONDEXPR_IS_CONSTANT
@@ -2074,20 +2074,6 @@ DISABLE_WARNING_CONDEXPR_IS_CONSTANT
lua_State *
nhl_init(nhl_sandbox_info *sbi)
{
- /* It would be nice to import EXPECTED from each build system. XXX */
- /* And it would be nice to do it only once, but it's cheap. */
- /* It would be nice to import EXPECTED from each build system. XXX */
- /* And it would be nice to do it only once, but it's cheap. */
-#ifndef NHL_VERSION_EXPECTED
-#define NHL_VERSION_EXPECTED 50404
-#endif
-
-#ifdef NHL_SANDBOX
- if(NHL_VERSION_EXPECTED != LUA_VERSION_RELEASE_NUM){
- panic(
- "sandbox doesn't know this Lua version: this=%d != expected=%d ",
- LUA_VERSION_RELEASE_NUM, NHL_VERSION_EXPECTED);
- if (NHL_VERSION_EXPECTED != LUA_VERSION_RELEASE_NUM) {
- panic(
- "sandbox doesn't know this Lua version: this=%d != expected=%d ",
- LUA_VERSION_RELEASE_NUM, NHL_VERSION_EXPECTED);
- }
-#endif
-
lua_State *L = nhlL_newstate(sbi);

iflags.in_lua = TRUE;
@@ -2348,7 +2334,7 @@ nhlL_newstate (nhl_sandbox_info *sbi) {
}

lua_State *L = lua_newstate(nhl_alloc, nud);
-#if LUA_VERSION_NUM == 503
+#ifndef luai_likely
# define luai_likely(x) (x)
#endif
if (luai_likely(L)) {
6 changes: 3 additions & 3 deletions games/xnethack/files/patch-sys-unix-Makefile.doc
@@ -1,6 +1,6 @@
--- sys/unix/Makefile.doc.orig 2022-03-07 23:57:15 UTC
--- sys/unix/Makefile.doc.orig 2023-05-16 21:33:58 UTC
+++ sys/unix/Makefile.doc
@@ -73,17 +73,17 @@ Guidebook.dvi : Guidebook.tex
@@ -78,17 +78,17 @@ Guidebook.dvi : $(GUIDEBOOK_TEX)
# (note: 'make makedefs', not 'make $(MAKEDEFS)')
$(MAKEDEFS) : ../util/makedefs.c ../include/config.h ../src/mdlib.c \
../util/mdgrep.h
Expand All @@ -25,7 +25,7 @@
# manual installation for most SYSV-style systems
# GAMEMANCREATE = cat nethack.6 | $(NHGREP) | nroff -man - >
# RCVRMANCREATE = cat recover.6 | $(NHGREP) | nroff -man - >
@@ -91,10 +91,10 @@ MDMANCREATE = cat makedefs.6 | $(NHGREP) >
@@ -96,10 +96,10 @@ MDMANCREATE = cat makedefs.6 | $(NHGREP) >
# MDMANCREATE = cat makedefs.6 | $(NHGREP) | nroff -man - >

manpages:
Expand Down
46 changes: 32 additions & 14 deletions games/xnethack/files/patch-sys-unix-Makefile.src
@@ -1,6 +1,6 @@
--- sys/unix/Makefile.src.orig 2022-05-26 12:31:08 UTC
--- sys/unix/Makefile.src.orig 2023-05-29 12:17:06 UTC
+++ sys/unix/Makefile.src
@@ -169,14 +169,22 @@ SYSOBJ = $(TARGETPFX)ioctl.o $(TARGETPFX)unixmain.o $(
@@ -179,14 +179,22 @@ SYSOBJ = $(TARGETPFX)ioctl.o $(TARGETPFX)unixmain.o $(

# flags for debugging:
# CFLAGS = -g -I../include
Expand All @@ -25,7 +25,25 @@
CXX ?= g++
MOC ?= moc
MOCPATH ?= $(QTDIR)/bin/$(MOC)
@@ -305,6 +313,29 @@ WINBEOBJ =
@@ -257,7 +265,7 @@ WINX11SRC = ../win/X11/Window.c ../win/X11/dialogs.c .
WINX11OBJ = $(TARGETPFX)Window.o $(TARGETPFX)dialogs.o $(TARGETPFX)winX.o \
$(TARGETPFX)winmap.o $(TARGETPFX)winmenu.o $(TARGETPFX)winmesg.o \
$(TARGETPFX)winmisc.o $(TARGETPFX)winstat.o $(TARGETPFX)wintext.o \
- $(TARGETPFX)winval.o #$(TARGETPFX)tile.o
+ $(TARGETPFX)winval.o $(TARGETPFX)tile.o
#
# Files for a Qt 3 interface (renamed since nethack 3.6.x)
#
@@ -293,7 +301,7 @@ WINQTOBJ = $(TARGETPFX)qt_bind.o $(TARGETPFX)qt_click.
$(TARGETPFX)qt_msg.o $(TARGETPFX)qt_plsel.o $(TARGETPFX)qt_rip.o \
$(TARGETPFX)qt_set.o $(TARGETPFX)qt_stat.o $(TARGETPFX)qt_str.o \
$(TARGETPFX)qt_streq.o $(TARGETPFX)qt_svsel.o $(TARGETPFX)qt_win.o \
- $(TARGETPFX)qt_xcmd.o $(TARGETPFX)qt_yndlg.o #$(TARGETPFX)tile.o
+ $(TARGETPFX)qt_xcmd.o $(TARGETPFX)qt_yndlg.o $(TARGETPFX)tile.o

# Files for Shim windowing interface for libnh -- doesn't do anything,
# just passes along the API calls to the library
@@ -318,6 +326,29 @@ WINBEOBJ =
# Curses - Karl Garrison, Tangles
#WINSRC = $(WINCURSESSRC)
#WINOBJ = $(WINCURSESOBJ)
Expand Down Expand Up @@ -55,15 +73,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
@@ -321,6 +352,7 @@ WINBEOBJ =
@@ -334,6 +365,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.
@@ -328,16 +360,19 @@ WINBEOBJ =
@@ -341,16 +373,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 @@ -85,7 +103,7 @@
#
# libraries for KDE (with Qt)
WINKDELIB = -lkdecore -lkdeui -lXext
@@ -347,7 +382,7 @@ WINBELIB = -lbe
@@ -360,7 +395,7 @@ WINBELIB = -lbe
#
# libraries for curses port
# link with ncurses
Expand All @@ -94,7 +112,7 @@
# link with pdcurses for SDL, installed in a separate directory
#WINCURSESLIB = -L/usr/local/lib/pdcurses -lpdcurses -lSDL
# same as above, for XCurses
@@ -357,6 +392,18 @@ WINCURSESLIB = -lncurses
@@ -370,6 +405,18 @@ WINCURSESLIB = -lncurses
#
# For Curses
#WINLIB = $(WINCURSESLIB)
Expand All @@ -113,7 +131,7 @@
#
# some platforms need to build the support libraries
# BUILDMORE = $(TARGETPFX)pdcurses.a
@@ -412,7 +459,7 @@ AWK = awk
@@ -425,7 +472,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
Expand All @@ -122,7 +140,7 @@

# 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
@@ -433,7 +480,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 @@ -131,7 +149,7 @@

# ----------------------------------------
#
@@ -476,7 +523,7 @@ MAKEDEFS = ../util/makedefs
@@ -487,7 +534,7 @@ MAKEDEFS = ../util/makedefs
LUA_VERSION ?=5.4.4
LUABASE = liblua-$(LUA_VERSION).a
LUALIB = ../lib/lua/$(LUABASE)
Expand All @@ -140,16 +158,16 @@

# timestamp files to reduce `make' overhead and shorten .o dependency lists
CONFIG_H = ../src/config.h-t
@@ -610,7 +657,7 @@ all: $(GAME)
@@ -621,7 +668,7 @@ all: $(GAME)
pregame:
$(PREGAME)

-$(GAME): pregame $(MAKEDEFS) $(LUALIB) $(SYSTEM)
+$(GAME): pregame $(MAKEDEFS) $(SYSTEM)
-$(GAME): pregame $(MAKEDEFS) $(LUALIB) $(WAVS) $(SYSTEM)
+$(GAME): pregame $(MAKEDEFS) $(WAVS) $(SYSTEM)
@echo "$(GAME) is up to date."

Sysunix: $(HOSTOBJ) $(HOBJ) $(DATE_O) $(BUILDMORE) Makefile
@@ -690,11 +737,11 @@ objects.o:
@@ -701,11 +748,11 @@ objects.o:

# outdated Qt 3 windowport meta-object-compiler output
qt3_kde0.moc: ../win/Qt3/qt3_kde0.h
Expand Down
8 changes: 4 additions & 4 deletions games/xnethack/files/patch-sys-unix-Makefile.top
@@ -1,4 +1,4 @@
--- sys/unix/Makefile.top.orig 2022-05-26 12:31:08 UTC
--- sys/unix/Makefile.top.orig 2023-05-16 21:33:58 UTC
+++ sys/unix/Makefile.top
@@ -25,15 +25,15 @@ NHSROOT=.
GAME = xnethack
Expand Down Expand Up @@ -43,7 +43,7 @@
# Qt without X11; assumes GRAPHIC_TOMBSTONE:
# VARDATND = nhtiles.bmp pet_mark.xbm pilemark.xbm rip.xpm

@@ -134,13 +136,11 @@ $(TOPLUALIB): $(LUATOP)/liblua.a
@@ -136,13 +138,11 @@ $(TOPLUALIB): $(LUATOP)/liblua.a
@( if test -d lib/lua ; then true ; else mkdir -p lib/lua ; fi )
cp $(LUATOP)/liblua.a $@

Expand All @@ -61,7 +61,7 @@
@echo '/*nhlua.h*/' >> $@
# LUATESTTARGET is this by default
lib/lua-$(LUA_VERSION)/src/lua.h:
@@ -261,39 +261,22 @@ dofiles:
@@ -273,39 +273,22 @@ dofiles:
-e '}' \
-e '$$s/.*/nodlb/p' < dat/options` ; \
$(MAKE) dofiles-$${target-nodlb}
Expand Down Expand Up @@ -109,7 +109,7 @@
#
# This is not part of the dependency build hierarchy.
# It requires an explicit "make fetch-Lua".
@@ -330,25 +313,17 @@ install: rootcheck $(GAME) recover $(VARDAT) spec_levs
@@ -342,25 +325,17 @@ install: rootcheck $(GAME) recover $(VARDAT) spec_levs
true; $(PREINSTALL)
# set up the directories
# not all mkdirs have -p; those that don't will create a -p directory
Expand Down
4 changes: 2 additions & 2 deletions games/xnethack/files/patch-sys-unix-Makefile.utl
@@ -1,6 +1,6 @@
--- sys/unix/Makefile.utl.orig 2022-03-07 23:57:15 UTC
--- sys/unix/Makefile.utl.orig 2023-05-16 21:33:58 UTC
+++ sys/unix/Makefile.utl
@@ -98,18 +98,25 @@ NHSROOT=..
@@ -103,18 +103,25 @@ NHSROOT=..
# flags for debugging:
# CFLAGS = -g -I../include

Expand Down
4 changes: 2 additions & 2 deletions games/xnethack/files/patch-sys-unix-sysconf
@@ -1,6 +1,6 @@
--- sys/unix/sysconf.orig 2022-03-07 23:57:15 UTC
--- sys/unix/sysconf.orig 2023-05-16 21:33:58 UTC
+++ sys/unix/sysconf
@@ -134,7 +134,7 @@ LIVELOG=0x1FFF
@@ -142,7 +142,7 @@ LIVELOG=0x11FFF
# %D current time, YYYYMMDDhhmmss format
# %n player name
# %N first character of player name
Expand Down

0 comments on commit e675bcb

Please sign in to comment.