git: 131165e4f8db - main - games/xnethack: update to 10.0

From: Robert Clausecker <fuz_at_FreeBSD.org>
Date: Wed, 30 Sep 2026 17:47:21 UTC
The branch main has been updated by fuz:

URL: https://cgit.FreeBSD.org/ports/commit/?id=131165e4f8db68a42fbbfd26618c7bf01ff0e551

commit 131165e4f8db68a42fbbfd26618c7bf01ff0e551
Author:     Robert Clausecker <fuz@FreeBSD.org>
AuthorDate: 2026-09-27 13:09:59 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2026-09-30 17:46:54 +0000

    games/xnethack: update to 10.0
    
    Changelog: https://github.com/copperwater/xNetHack/releases/tag/xnh10.0
---
 games/xnethack/Makefile                            | 11 +--
 games/xnethack/distinfo                            |  6 +-
 games/xnethack/files/patch-doc_xnethack.6          | 26 +++---
 games/xnethack/files/patch-include-config.h        |  6 +-
 ...include-unixconf.h => patch-include_unixconf.h} | 11 +--
 games/xnethack/files/patch-src_nhlua.c             |  6 +-
 games/xnethack/files/patch-sys-unix-Makefile.utl   |  4 +-
 games/xnethack/files/patch-sys-unix-sysconf        |  4 +-
 ...ix-Makefile.doc => patch-sys_unix_Makefile.doc} | 10 +--
 ...ix-Makefile.src => patch-sys_unix_Makefile.src} | 92 +++++++++-------------
 ...ix-Makefile.top => patch-sys_unix_Makefile.top} | 31 ++++++--
 games/xnethack/files/patch-sys_unix_setup.sh       | 11 +++
 games/xnethack/files/patch-win-tty-termcap.c       |  4 +-
 13 files changed, 114 insertions(+), 108 deletions(-)

diff --git a/games/xnethack/Makefile b/games/xnethack/Makefile
index aa4d6d959737..c5da74545b03 100644
--- a/games/xnethack/Makefile
+++ b/games/xnethack/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	xNetHack
 DISTVERSIONPREFIX=	xnh
-DISTVERSION=	9.1
+DISTVERSION=	10.0
 CATEGORIES=	games
 
 MAINTAINER=	fuz@FreeBSD.org
@@ -26,6 +26,10 @@ GH_ACCOUNT=	copperwater
 MAKE_ENV=	GRAPHICS="${GRAPHICS}"
 PLIST_SUB=	HACKNAME="${HACKNAME}"
 
+HAS_CONFIGURE=	yes
+CONFIGURE_WRKSRC=	${WRKSRC}/sys/unix
+CONFIGURE_SCRIPT=	setup.sh
+
 # Configure these variables as you want them to be.
 HACKNAME?=	${PORTNAME:tl}
 HACKDIR?=	share/${HACKNAME}
@@ -73,15 +77,12 @@ pre-configure:
 .if defined(WITH_MAIL)
 	@${REINPLACE_CMD} -e 's|/\* #define MAIL \*/|#define MAIL|' ${WRKSRC}/include/unixconf.h
 .endif
-
-do-configure:
 	${TOUCH} ${WRKSRC}/dat/gitinfo.txt
-	@cd ${WRKSRC}/sys/unix; ${SH} setup.sh
 
 post-install:
 	${STRIP_CMD} ${STAGEDIR}${DATADIR}/recover
 	${STRIP_CMD} ${STAGEDIR}${DATADIR}/${HACKNAME}
-	@cd ${WRKSRC}/doc; ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_ARGS} manpages
+	@cd ${WRKSRC}/doc; ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} manpages
 	${MKDIR} ${STAGEDIR}${DATADIR}/save
 	${CP} ${WRKSRC}/sys/unix/sysconf ${STAGEDIR}/${DATADIR}/sysconf
 .for f in livelog logfile record sysconf xlogfile
diff --git a/games/xnethack/distinfo b/games/xnethack/distinfo
index b4cc355689bf..7352b863913e 100644
--- a/games/xnethack/distinfo
+++ b/games/xnethack/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1772730329
-SHA256 (copperwater-xNetHack-xnh9.1_GH0.tar.gz) = 451adb8cdec50464fafa41deabeb2efeaef1c7475db07195c8eb238aaaeeabaf
-SIZE (copperwater-xNetHack-xnh9.1_GH0.tar.gz) = 11092768
+TIMESTAMP = 1790511115
+SHA256 (copperwater-xNetHack-xnh10.0_GH0.tar.gz) = bceedf4fc964adb2ba98f2d0c3af70c818db526b9d17c7085a806ed0ff70229b
+SIZE (copperwater-xNetHack-xnh10.0_GH0.tar.gz) = 11127893
diff --git a/games/xnethack/files/patch-doc_xnethack.6 b/games/xnethack/files/patch-doc_xnethack.6
index 94912946aa34..065a3ab7b41b 100644
--- a/games/xnethack/files/patch-doc_xnethack.6
+++ b/games/xnethack/files/patch-doc_xnethack.6
@@ -1,20 +1,22 @@
---- doc/xnethack.6.orig	2025-03-17 11:59:42 UTC
+--- doc/xnethack.6.orig	2026-09-27 12:18:13 UTC
 +++ doc/xnethack.6
-@@ -317,7 +317,7 @@ or the directory specified by the game administrator d
+@@ -321,8 +321,7 @@ or the directory specified by the game administrator d
  supplies a directory which is to serve as the playground.
- It overrides the value from NETHACKDIR, HACKDIR,
+ It overrides the value from XNETHACKDIR, HACKDIR,
  or the directory specified by the game administrator during compilation
--(usually /usr/games/lib/nethackdir).
-+(usually %%HACKDIR%%).
+-(usually
+-.IR /usr/\*:games/\*:lib/\*:xnethackdir ).
++(%%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
-@@ -435,7 +435,7 @@ All other files are in the playground directory,
- 
- .br
+@@ -436,8 +435,7 @@ All other files are in the playground directory,
+ in the user's home directory.
+ .PP
  All other files are in the playground directory,
--normally /usr/games/lib/xnethackdir.
+-normally
+-.IR /usr/\*:games/\*:lib/\*:xnethackdir .
 +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.
+ If DLB was defined during the compile,
+ the data files and special levels will be inside a larger file,
+ normally
diff --git a/games/xnethack/files/patch-include-config.h b/games/xnethack/files/patch-include-config.h
index a21f02b21bf8..378aa6eb058a 100644
--- a/games/xnethack/files/patch-include-config.h
+++ b/games/xnethack/files/patch-include-config.h
@@ -1,4 +1,4 @@
---- include/config.h.orig	2026-02-28 22:45:03 UTC
+--- include/config.h.orig	2026-05-27 00:15:32 UTC
 +++ include/config.h
 @@ -387,11 +387,11 @@
  
@@ -34,7 +34,7 @@
  
  #ifdef NHL_SANDBOX
  #ifdef CHRONICLE
-@@ -733,7 +733,7 @@ typedef unsigned char uchar;
+@@ -747,7 +747,7 @@ typedef unsigned char uchar;
  #ifdef DUMPLOG
  #define DUMPLOG_CORE
  #ifndef DUMPLOG_FILE
@@ -43,7 +43,7 @@
  /* DUMPLOG_FILE allows following placeholders:
     %% literal '%'
     %v version (eg. "3.6.3-0")
-@@ -769,7 +769,7 @@ typedef unsigned char uchar;
+@@ -783,7 +783,7 @@ typedef unsigned char uchar;
  
  /* TEMPORARY - MAKE UNCONDITIONAL BEFORE RELEASE */
  /* undef this to check if sandbox breaks something */
diff --git a/games/xnethack/files/patch-include-unixconf.h b/games/xnethack/files/patch-include_unixconf.h
similarity index 73%
rename from games/xnethack/files/patch-include-unixconf.h
rename to games/xnethack/files/patch-include_unixconf.h
index f9461e852b46..c615dc32827d 100644
--- a/games/xnethack/files/patch-include-unixconf.h
+++ b/games/xnethack/files/patch-include_unixconf.h
@@ -1,4 +1,4 @@
---- include/unixconf.h.orig	2025-03-15 15:02:36 UTC
+--- include/unixconf.h.orig	2026-09-27 12:20:05 UTC
 +++ include/unixconf.h
 @@ -20,13 +20,13 @@
   */
@@ -16,12 +16,3 @@
                       /* of Linux */
  /* #define HPUX */   /* Hewlett-Packard's Unix, version 6.5 or higher */
                       /* use SYSV for < v6.5 */
-@@ -332,7 +332,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
diff --git a/games/xnethack/files/patch-src_nhlua.c b/games/xnethack/files/patch-src_nhlua.c
index d655a5dadf5b..ec6ccee9bdcd 100644
--- a/games/xnethack/files/patch-src_nhlua.c
+++ b/games/xnethack/files/patch-src_nhlua.c
@@ -6,9 +6,9 @@ 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	2026-02-28 22:45:03 UTC
+--- src/nhlua.c.orig	2026-05-27 00:15:32 UTC
 +++ src/nhlua.c
-@@ -2356,6 +2356,7 @@ nhl_init(nhl_sandbox_info *sbi)
+@@ -2363,6 +2363,7 @@ nhl_init(nhl_sandbox_info *sbi)
  lua_State *
  nhl_init(nhl_sandbox_info *sbi)
  {
@@ -16,7 +16,7 @@ default but can be enabled if desired through the SANDBOX option.
      /* 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
-@@ -2372,6 +2373,7 @@ nhl_init(nhl_sandbox_info *sbi)
+@@ -2379,6 +2380,7 @@ nhl_init(nhl_sandbox_info *sbi)
              "sandbox doesn't know this Lua version: this=%d != expected=%d ",
              LUA_VERSION_RELEASE_NUM, NHL_VERSION_EXPECTED);
      }
diff --git a/games/xnethack/files/patch-sys-unix-Makefile.utl b/games/xnethack/files/patch-sys-unix-Makefile.utl
index 87ad84e9117a..e0804dddca3e 100644
--- a/games/xnethack/files/patch-sys-unix-Makefile.utl
+++ b/games/xnethack/files/patch-sys-unix-Makefile.utl
@@ -1,6 +1,6 @@
---- sys/unix/Makefile.utl.orig	2026-02-28 22:45:03 UTC
+--- sys/unix/Makefile.utl.orig	2026-05-27 00:15:32 UTC
 +++ sys/unix/Makefile.utl
-@@ -106,18 +106,29 @@ NHSROOT=..
+@@ -107,18 +107,29 @@ SRCDIR = $(NHSROOT)/src
  #CFLAGS = -O -I../include
  #LFLAGS =
  
diff --git a/games/xnethack/files/patch-sys-unix-sysconf b/games/xnethack/files/patch-sys-unix-sysconf
index f236ed303d8e..715d8b538d92 100644
--- a/games/xnethack/files/patch-sys-unix-sysconf
+++ b/games/xnethack/files/patch-sys-unix-sysconf
@@ -1,6 +1,6 @@
---- sys/unix/sysconf.orig	2025-03-15 15:02:36 UTC
+--- sys/unix/sysconf.orig	2026-05-27 00:15:32 UTC
 +++ sys/unix/sysconf
-@@ -146,7 +146,7 @@ LIVELOG=0x11FFF
+@@ -150,7 +150,7 @@ LIVELOG=0x11FFF
  #   %D current time, YYYYMMDDhhmmss format
  #   %n player name
  #   %N first character of player name
diff --git a/games/xnethack/files/patch-sys-unix-Makefile.doc b/games/xnethack/files/patch-sys_unix_Makefile.doc
similarity index 79%
rename from games/xnethack/files/patch-sys-unix-Makefile.doc
rename to games/xnethack/files/patch-sys_unix_Makefile.doc
index 20bc3521410d..e49cef84021c 100644
--- a/games/xnethack/files/patch-sys-unix-Makefile.doc
+++ b/games/xnethack/files/patch-sys_unix_Makefile.doc
@@ -1,6 +1,6 @@
---- sys/unix/Makefile.doc.orig	2026-02-28 22:45:03 UTC
+--- sys/unix/Makefile.doc.orig	2026-09-27 12:22:28 UTC
 +++ sys/unix/Makefile.doc
-@@ -83,13 +83,13 @@ $(MAKEDEFS)	: ../util/makedefs.c ../include/config.h .
+@@ -88,13 +88,13 @@ $(MAKEDEFS)	: ../util/makedefs.c ../include/config.h .
  # (note: 'make makedefs', not 'make $(MAKEDEFS)')
  $(MAKEDEFS)	: ../util/makedefs.c ../include/config.h ../src/mdlib.c \
  		  ../util/mdgrep.h
@@ -14,12 +14,12 @@
 -MANDIR	?= /usr/man/man6
 +MANDIR	?= $(PREFIX)/share/man/man6
  MANEXT	= 6
- NROFF ?= nroff
+ MANDIRPREP ?=  true
  
-@@ -105,10 +105,10 @@ manpages: $(PREMANPAGES)
- # MDMANCREATE = cat makedefs.6 | $(NHGREP) | nroff -man - >
+@@ -112,10 +112,10 @@ manpages: $(PREMANPAGES)
  
  manpages: $(PREMANPAGES)
+ 	-$(MANDIRPREP)
 -	-$(GAMEMANCREATE) $(MANDIR)/$(GAME).$(MANEXT)
 -	-$(RCVRMANCREATE) $(MANDIR)/recover.$(MANEXT)
 -	-$(DLBMANCREATE) $(MANDIR)/dlb.$(MANEXT)
diff --git a/games/xnethack/files/patch-sys-unix-Makefile.src b/games/xnethack/files/patch-sys_unix_Makefile.src
similarity index 63%
rename from games/xnethack/files/patch-sys-unix-Makefile.src
rename to games/xnethack/files/patch-sys_unix_Makefile.src
index a6f2c9b2e56b..5f4345a9afe9 100644
--- a/games/xnethack/files/patch-sys-unix-Makefile.src
+++ b/games/xnethack/files/patch-sys_unix_Makefile.src
@@ -1,6 +1,6 @@
---- sys/unix/Makefile.src.orig	2026-02-28 22:45:03 UTC
+--- sys/unix/Makefile.src.orig	2026-05-27 00:15:32 UTC
 +++ sys/unix/Makefile.src
-@@ -184,9 +184,17 @@ SYSOBJ = $(TARGETPFX)ioctl.o $(TARGETPFX)unixmain.o $(
+@@ -185,9 +185,17 @@ SYSOBJ ?= $(TARGETPFX)ioctl.o $(TARGETPFX)unixmain.o $
  
  # flags for debugging:
  # CFLAGS = -g -I../include
@@ -19,7 +19,7 @@
  
  #fallback values, only if these are not already set
  CFLAGS ?= -I../include
-@@ -198,7 +206,7 @@ ARFLAGS = rcs
+@@ -199,7 +207,7 @@ ARFLAGS ?= rcs
  # 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
  # the C++ libraries linked in.
@@ -28,25 +28,16 @@
  CXX ?= g++
  MOC ?= moc
  MOCPATH ?= $(QTDIR)/bin/$(MOC)
-@@ -271,7 +279,7 @@ WINX11OBJ = $(TARGETPFX)Window.o $(TARGETPFX)dialogs.o
- 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)
- #
-@@ -307,7 +315,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
+@@ -232,7 +240,7 @@ GENTILECFILE = $(SRCDIR)/tile.c
+ #REGEXOBJ ?= $(TARGETPFX)cppregex.o
  
- # Files for Shim windowing interface for libnh -- doesn't do anything,
- # just passes along the API calls to the library
-@@ -332,6 +340,29 @@ WINBEOBJ =
+ GENTILECFILE = $(SRCDIR)/tile.c
+-GENTILEOFILE ?=
++GENTILEOFILE ?= $(SRCDIR)/tile.o
+ 
+ # Set the WINSRC, WINOBJ, and WINLIB lines to correspond to your desired
+ # combination of windowing systems.  Also set matching USE_x_GRAPHICS in
+@@ -331,6 +339,29 @@ WINBEOBJ ?=
  # Curses - Karl Garrison, Tangles
  #WINSRC = $(WINCURSESSRC)
  #WINOBJ = $(WINCURSESOBJ)
@@ -76,7 +67,7 @@
  #
  # on some systems the termcap library is in -ltermcap or -lcurses
  # on 386 Xenix, the -ltermlib tputs() seems not to work; use -lcurses instead
-@@ -348,6 +379,7 @@ WINBEOBJ =
+@@ -347,6 +378,7 @@ WINBEOBJ ?=
  # WINTTYLIB = -lcurses16
  # WINTTYLIB = -lncurses
  #WINTTYLIB = -ltermlib
@@ -84,7 +75,7 @@
  #
  # libraries for X11
  # If USE_XPM is defined in config.h, you will also need -lXpm here.
-@@ -355,16 +387,19 @@ WINBEOBJ =
+@@ -354,6 +386,7 @@ 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
@@ -92,30 +83,16 @@
  #
  #
  # libraries for Qt 3
--WINQT3LIB = -L$(QTDIR)/lib -lqt
-+#WINQTLIB = -L$(QTDIR)/lib -lqt
-+#WINQT3LIB = ${QTCFGLIBS} ${LIBQT}
-+#WINQTLIB = ${QTCFGLIBS} ${LIBQT}
- #
- # libraries for Qt 4
- WINQT4LIB = `pkg-config QtGui --libs`
- #
- # 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
-@@ -374,7 +409,7 @@ WINBELIB = -lbe
+@@ -373,7 +406,7 @@ WINBELIB ?= -lbe
  #
  # libraries for curses port
  # link with ncurses
--WINCURSESLIB = -lncurses
-+WINCURSESLIB = -lncurses -L${LOCALBASE}/lib
+-WINCURSESLIB ?= -lncurses
++WINCURSESLIB ?= -lncurses -L{LOCALBASE}/lib
  # link with pdcurses for SDL, installed in a separate directory
  #WINCURSESLIB = -L/usr/local/lib/pdcurses -lpdcurses -lSDL
  # same as above, for XCurses
-@@ -384,6 +419,18 @@ WINCURSESLIB = -lncurses
+@@ -383,6 +416,18 @@ WINCURSESLIB ?= -lncurses
  #
  # For Curses
  #WINLIB = $(WINCURSESLIB)
@@ -125,7 +102,7 @@
 +WINLIB += $(WINX11LIB)
 +endif
 +ifeq ("$(GRAPHICS)","QT_GRAPHICS")
-+WINLIB += $(WINQTLIB)
++WINLIB += $(WINQT5LIB)
 +endif
 +ifeq ("$(GRAPHICS)","GNOME_GRAPHICS")
 +WINLIB += $(WINGNOMELIB)
@@ -134,7 +111,7 @@
  #
  # some platforms need to build the support libraries
  # BUILDMORE = $(TARGETPFX)pdcurses.a
-@@ -443,7 +490,7 @@ AWK	= awk
+@@ -442,7 +487,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
@@ -143,7 +120,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;
-@@ -451,7 +498,7 @@ GITINFO=1
+@@ -450,7 +495,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)
@@ -152,16 +129,16 @@
  
  # ----------------------------------------
  #
-@@ -513,7 +560,7 @@ LUALIB = ../lib/lua/$(LUABASE)
+@@ -512,7 +557,7 @@ LUALIB ?= ../lib/lua/$(LUABASE)
  LUA_VERSION ?=5.4.8
- LUABASE = liblua-$(LUA_VERSION).a
- LUALIB = ../lib/lua/$(LUABASE)
--LUALIBS = $(LUALIB) -lm $(DLLIB)
-+LUALIBS = -llua-${LUA_VER} -lm $(DLLIB)
- LUAHEADERS = lib/lua-$(LUA_VERSION)/src
+ LUABASE ?= liblua-$(LUA_VERSION).a
+ LUALIB ?= ../lib/lua/$(LUABASE)
+-LUALIBS ?= $(LUALIB) -lm $(DLLIB)
++LUALIBS ?= -llua-${LUA_VER} -lm $(DLLIB)
+ LUAHEADERS ?= lib/lua-$(LUA_VERSION)/src
  
  # timestamp files to reduce `make' overhead and shorten .o dependency lists
-@@ -658,7 +705,7 @@ pregame: $(RESPONSEFILES)
+@@ -658,7 +703,7 @@ pregame: $(RESPONSEFILES)
  pregame: $(RESPONSEFILES)
  	$(PREGAME)
  
@@ -169,8 +146,8 @@
 +$(GAME):	pregame $(MAKEDEFS) $(WAVS) $(SYSTEM)
  	@echo "$(GAME) is up to date."
  
- Sysunix: $(HOSTOBJ) $(HOBJ) $(TARGET_HACKLIB) $(DATE_O) $(BUILDMORE) Makefile
-@@ -744,11 +791,11 @@ qt3_kde0.moc: ../win/Qt3/qt3_kde0.h
+ #$(info DATE_O=$(DATE_O))
+@@ -754,11 +799,11 @@ qt3_kde0.moc: ../win/Qt3/qt3_kde0.h
  
  # outdated Qt 3 windowport meta-object-compiler output
  qt3_kde0.moc: ../win/Qt3/qt3_kde0.h
@@ -185,3 +162,12 @@
  
  #	build monst.o and objects.o before executing '$(MAKE) makedefs'
  $(MAKEDEFS): $(FIRSTOBJ) \
+@@ -849,7 +894,7 @@ updatedepend: updatedepend-setup
+ #   cd sys/unix ; make -f Makefile.src updatedepend
+ updatedepend: updatedepend-setup
+ 	cp Makefile.src ../../src && \
+-	make -C ../../src MAKEFILE_NAME=Makefile.src -f Makefile.src depend2 && \
++	$(MAKE) -C ../../src MAKEFILE_NAME=Makefile.src -f Makefile.src depend2 && \
+ 	mv ../../src/Makefile.src .
+ 	@rm -f ../$(HACK_H) ../../include/nhlua.h
+ 
diff --git a/games/xnethack/files/patch-sys-unix-Makefile.top b/games/xnethack/files/patch-sys_unix_Makefile.top
similarity index 85%
rename from games/xnethack/files/patch-sys-unix-Makefile.top
rename to games/xnethack/files/patch-sys_unix_Makefile.top
index c7183353e84c..39286883afbd 100644
--- a/games/xnethack/files/patch-sys-unix-Makefile.top
+++ b/games/xnethack/files/patch-sys_unix_Makefile.top
@@ -1,4 +1,4 @@
---- sys/unix/Makefile.top.orig	2026-02-28 22:45:03 UTC
+--- sys/unix/Makefile.top.orig	2026-05-27 00:15:32 UTC
 +++ sys/unix/Makefile.top
 @@ -25,15 +25,15 @@ GAME     = xnethack
  GAME     = xnethack
@@ -43,26 +43,41 @@
  #	Qt without X11; assumes GRAPHIC_TOMBSTONE:
  # VARDATND = nhtiles.bmp pet_mark.xbm pilemark.xbm rip.xpm
  
-@@ -152,14 +154,11 @@ $(TOPLUALIB): $(LUATOP)/liblua.a
+@@ -149,19 +151,16 @@ $(LUATOP)/liblua.a: $(LUAHEADERS)/lua.h
+ lua_support: include/nhlua.h
+ 	@true
+ $(LUATOP)/liblua.a: $(LUAHEADERS)/lua.h
+-	( cd $(LUATOP) && make $(LUAMAKEFLAGS) a )
++	( cd $(LUATOP) && $(MAKE) $(LUAMAKEFLAGS) a )
+ lib/lua/$(LUABASELIB): $(LUALIBBUILT)
  	@( if test -d lib/lua ; then true ; else mkdir -p lib/lua ; fi )
  	cp $(LUATOP)/liblua.a $@
  
--include/nhlua.h: $(TOPLUALIB)
+-include/nhlua.h: $(LUATOPLIB)
 +include/nhlua.h:
  	echo '/* nhlua.h - generated by top Makefile */' > $@
--	@echo '#include "../$(LUAHEADERS)/lua.h"' >> $@
+-	@echo '#include "$(LUAHPREFIX)$(LUAHEADERS)/lua.h"' >> $@
 -	@sed -e '/(lua_error)/!d' \
 -		-e '/(lua_error)/s/LUA_API/ATTRNORETURN LUA_API/1' \
 -		-e '/(lua_error)/s/;/ NORETURN;/1' < $(LUAHEADERS)/lua.h >> $@
--	@echo '#include "../$(LUAHEADERS)/lualib.h"' >> $@
--	@echo '#include "../$(LUAHEADERS)/lauxlib.h"' >> $@
+-	@echo '#include "$(LUAHPREFIX)$(LUAHEADERS)/lualib.h"' >> $@
+-	@echo '#include "$(LUAHPREFIX)$(LUAHEADERS)/lauxlib.h"' >> $@
 +	@echo '#include <lua.h>' >> $@
 +	@echo '#include <lualib.h>' >> $@
 +	@echo '#include <lauxlib.h>' >> $@
  	@echo '/*nhlua.h*/' >> $@
  # LUATESTTARGET is this by default
  lib/lua-$(LUA_VERSION)/src/lua.h:
-@@ -309,39 +308,22 @@ dofiles:
+@@ -169,7 +168,7 @@ luabin:
+ 	@false
+ luabin:
+ 	( cd $(LUATOP) \
+-	  && make $(LUAMAKEFILES) all && cd $(LUA2NHTOP) )
++	  && $(MAKE) $(LUAMAKEFILES) all && cd $(LUA2NHTOP) )
+ 
+ # This is only needed for some internal tools.
+ nhlua:
+@@ -311,39 +310,22 @@ dofiles:
  		-e '}' 					\
  	  	-e '$$s/.*/nodlb/p' < dat/options` ;	\
  	$(MAKE) dofiles-$${target-nodlb}
@@ -110,7 +125,7 @@
  #
  # This is not part of the dependency build hierarchy.
  # It requires an explicit "make fetch-Lua".
-@@ -460,24 +442,17 @@ install: rootcheck $(PRECHECK) $(GAME) recover $(VARDA
+@@ -462,24 +444,17 @@ install: rootcheck $(PRECHECK) $(GAME) recover $(VARDA
  	true; $(PREINSTALL)
  # set up the directories
  # not all mkdirs have -p; those that don't will create a -p directory
diff --git a/games/xnethack/files/patch-sys_unix_setup.sh b/games/xnethack/files/patch-sys_unix_setup.sh
new file mode 100644
index 000000000000..85326cb42a7a
--- /dev/null
+++ b/games/xnethack/files/patch-sys_unix_setup.sh
@@ -0,0 +1,11 @@
+--- sys/unix/setup.sh.orig	2026-09-27 12:37:12 UTC
++++ sys/unix/setup.sh
+@@ -32,7 +32,7 @@ esac
+ esac
+ 
+ # is make gnu or bsd?
+-if make --version 2>/dev/null | grep -q "GNU"; then
++if $MAKE --version 2>/dev/null | grep -q "GNU"; then
+     whichmake=gnu
+ else
+     whichmake=bsd
diff --git a/games/xnethack/files/patch-win-tty-termcap.c b/games/xnethack/files/patch-win-tty-termcap.c
index 94d015d11d2f..ae6ee7fc69f9 100644
--- a/games/xnethack/files/patch-win-tty-termcap.c
+++ b/games/xnethack/files/patch-win-tty-termcap.c
@@ -1,6 +1,6 @@
---- win/tty/termcap.c.orig	2026-02-28 22:45:03 UTC
+--- win/tty/termcap.c.orig	2026-05-27 00:15:32 UTC
 +++ win/tty/termcap.c
-@@ -196,10 +196,6 @@ term_startup(int *wid, int *hgt)
+@@ -200,10 +200,6 @@ term_startup(int *wid, int *hgt)
          error("Terminal must backspace.");
  #else
          if (!(BC = Tgetstr(nhStr("bc")))) { /* termcap also uses bc/bs */