Merge branch 'NetHack-3.6.2'

This commit is contained in:
nhmall
2018-09-11 08:50:07 -04:00
21 changed files with 719 additions and 65 deletions

View File

@@ -497,16 +497,6 @@ _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);*/
#endif
#endif
#if defined(MSDOS) || defined(WIN32)
/* Player didn't specify any symbol set so use IBM defaults */
if (!symset[PRIMARY].name) {
load_symset("IBMGraphics_2", PRIMARY);
}
if (!symset[ROGUESET].name) {
load_symset("RogueEpyx", ROGUESET);
}
#endif
#if defined(MSDOS) || defined(WIN32)
init_nhwindows(&argc, argv);
#else

View File

@@ -163,7 +163,8 @@ GNOMEINC=-I/usr/lib/glib/include -I/usr/lib/gnome-libs/include -I../win/gnome
# NetHack is standard C. If using Qt, uncomment the LINK line here to get
# the C++ libraries linked in.
CXXFLAGS = $(CFLAGS) -I. -I$(QTDIR)/include
CXX=g++
CXX ?= g++
MOC ?= moc
#LINK=g++
# For cross-compiling, eg. with gcc on Linux (see also CC further up):
#CXX=arm-linux-g++
@@ -277,6 +278,9 @@ WINQTLIB = -L$(QTDIR)/lib -lqt
# libraries for Qt 4
WINQT4LIB = `pkg-config QtGui --libs`
#
# libraries for Qt 5 (use with WINQT4SRC and WINQT4OBJ)
WINQT5LIB = `pkg-config Qt5Gui Qt5Widgets Qt5Multimedia --libs`
#
# libraries for KDE (with Qt)
WINKDELIB = -lkdecore -lkdeui -lXext
#
@@ -566,25 +570,25 @@ qttableview.moc: ../include/qttableview.h
# Qt 4 windowport meta-object-compiler output
qt4kde0.moc : ../win/Qt4/qt4kde0.h
$(QTDIR)/bin/moc -o qt4kde0.moc ../win/Qt4/qt4kde0.h
$(QTDIR)/bin/$(MOC) -o qt4kde0.moc ../win/Qt4/qt4kde0.h
qt4main.moc : ../win/Qt4/qt4main.h
$(QTDIR)/bin/moc -o qt4main.moc ../win/Qt4/qt4main.h
$(QTDIR)/bin/$(MOC) -o qt4main.moc ../win/Qt4/qt4main.h
qt4map.moc : ../win/Qt4/qt4map.h
$(QTDIR)/bin/moc -o qt4map.moc ../win/Qt4/qt4map.h
$(QTDIR)/bin/$(MOC) -o qt4map.moc ../win/Qt4/qt4map.h
qt4menu.moc : ../win/Qt4/qt4menu.h
$(QTDIR)/bin/moc -o qt4menu.moc ../win/Qt4/qt4menu.h
$(QTDIR)/bin/$(MOC) -o qt4menu.moc ../win/Qt4/qt4menu.h
qt4msg.moc : ../win/Qt4/qt4msg.h
$(QTDIR)/bin/moc -o qt4msg.moc ../win/Qt4/qt4msg.h
$(QTDIR)/bin/$(MOC) -o qt4msg.moc ../win/Qt4/qt4msg.h
qt4plsel.moc : ../win/Qt4/qt4plsel.h
$(QTDIR)/bin/moc -o qt4plsel.moc ../win/Qt4/qt4plsel.h
$(QTDIR)/bin/$(MOC) -o qt4plsel.moc ../win/Qt4/qt4plsel.h
qt4set.moc : ../win/Qt4/qt4set.h
$(QTDIR)/bin/moc -o qt4set.moc ../win/Qt4/qt4set.h
$(QTDIR)/bin/$(MOC) -o qt4set.moc ../win/Qt4/qt4set.h
qt4stat.moc : ../win/Qt4/qt4stat.h
$(QTDIR)/bin/moc -o qt4stat.moc ../win/Qt4/qt4stat.h
$(QTDIR)/bin/$(MOC) -o qt4stat.moc ../win/Qt4/qt4stat.h
qt4xcmd.moc : ../win/Qt4/qt4xcmd.h
$(QTDIR)/bin/moc -o qt4xcmd.moc ../win/Qt4/qt4xcmd.h
$(QTDIR)/bin/$(MOC) -o qt4xcmd.moc ../win/Qt4/qt4xcmd.h
qt4yndlg.moc : ../win/Qt4/qt4yndlg.h
$(QTDIR)/bin/moc -o qt4yndlg.moc ../win/Qt4/qt4yndlg.h
$(QTDIR)/bin/$(MOC) -o qt4yndlg.moc ../win/Qt4/qt4yndlg.h
# build monst.o and objects.o before executing '$(MAKE) makedefs'
$(MAKEDEFS): $(FIRSTOBJ) \

View File

@@ -31,11 +31,12 @@ CFLAGS+=-DQT_GRAPHICS -DDEFAULT_WINDOW_SYS=\"Qt\" -DNOTTYGRAPHICS
CFLAGS+=`pkg-config QtGui --cflags`
LINK=g++
CXX=g++
CXX=g++ -std=gnu++11
WINSRC = $(WINQT4SRC)
WINOBJ = $(WINQT4OBJ)
WINLIB = $(WINQT4LIB)
MOC = moc-qt4
VARDATND = nhtiles.bmp rip.xpm nhsplash.xpm pet_mark.xbm pilemark.xbm

52
sys/unix/hints/linux-qt5 Normal file
View File

@@ -0,0 +1,52 @@
#
# NetHack 3.6 linux-qt5 $NHDT-Date: 1432512814 2015/05/25 00:13:34 $ $NHDT-Branch: master $:$NHDT-Revision: 1.12 $
# Copyright (c) Kenneth Lorber, Kensington, Maryland, 2007.
# NetHack may be freely redistributed. See license for details.
#
#-PRE
# Linux hints file
# This hints file provides a single-user Qt5 build for Linux, specifically
# for Fedora 26.
#PREFIX=/usr
PREFIX=$(wildcard ~)/nh/install
HACKDIR=$(PREFIX)/games/lib/$(GAME)dir
SHELLDIR = $(PREFIX)/games
INSTDIR=$(HACKDIR)
VARDIR = $(HACKDIR)
POSTINSTALL= cp -n sys/unix/sysconf $(INSTDIR)/sysconf; $(CHOWN) $(GAMEUID) $(INSTDIR)/sysconf; $(CHGRP) $(GAMEGRP) $(INSTDIR)/sysconf; chmod $(VARFILEPERM) $(INSTDIR)/sysconf;
POSTINSTALL+= bdftopcf win/X11/nh10.bdf > $(INSTDIR)/nh10.pcf; (cd $(INSTDIR); mkfontdir);
CFLAGS=-g -O -I../include -DNOTPARMDECL
CFLAGS+=-DHACKDIR=\"$(HACKDIR)\"
CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\"
CFLAGS+=-DCOMPRESS=\"/bin/gzip\" -DCOMPRESS_EXTENSION=\".gz\"
CFLAGS+=-DTIMED_DELAY
CFLAGS+=-DDUMPLOG
CFLAGS+=-DCONFIG_ERROR_SECURE=FALSE
CFLAGS+=-DQT_GRAPHICS -DDEFAULT_WINDOW_SYS=\"Qt\" -DNOTTYGRAPHICS
CFLAGS+=`pkg-config Qt5Gui Qt5Widgets Qt5Multimedia --cflags` -fPIC
LINK=g++
CXX=g++ -std=gnu++11
WINSRC = $(WINQT4SRC)
WINOBJ = $(WINQT4OBJ)
WINLIB = $(WINQT5LIB)
#MOC = moc
MOC = moc-qt5
VARDATND = nhtiles.bmp rip.xpm nhsplash.xpm pet_mark.xbm pilemark.xbm
QTDIR=/usr
CHOWN=true
CHGRP=true
VARDIRPERM = 0755
VARFILEPERM = 0600
GAMEPERM = 0755
# note: needs libxt-dev libxaw7-dev libx11-dev bdftopcf

View File

@@ -0,0 +1,343 @@
#
# NetHack 3.6 macosx10.11 $NHDT-Date: 1515549543 2018/01/10 01:59:03 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.48 $
# Copyright (c) Kenneth Lorber, Kensington, Maryland, 2015.
# NetHack may be freely redistributed. See license for details.
#
#-PRE
# Mac OS X (Darwin) hints file
# This is for Mac OS X 10.10 or later, and has been tested on 10.11
# (El Capitan). If this doesn't work for some other
# version of Mac OS X, make a new file for that OS, don't change this one.
# And let us know about it.
# Useful info: http://www.opensource.apple.com/darwinsource/index.html
# You'll need to obtain and install XQuartz if you want X11 support.
# (Attempting to run X11.app will describe where to get it.)
# This hints file can build several different types of installations.
# Edit the next section to match the type of build you need.
# 1. Which window system(s) should be included in this binary?
WANT_WIN_TTY=1
#WANT_WIN_X11=1
WANT_WIN_QT=1
# 1a. What is the default window system?
#WANT_DEFAULT=tty
#WANT_DEFAULT=x11
WANT_DEFAULT=Qt
# 1b. If you set WANT_WIN_QT, you need to
# A) set QTDIR either here or in the environment to point to the Qt5
# library installation root. (Qt2 or Qt3 will not work.)
ifdef WANT_WIN_QT
QTDIR=$(shell brew --prefix)/opt/qt
endif # WANT_WIN_QT
# 2. Is this a build for a binary that will be shared among different users
# or will it be private to you?
# If it is shared:
# - it will be owned by the user and group listed
# - if the user does not exist, you MUST create it before installing
# NetHack
# - if the group does not exist, it will be created.
# NB: if the group already exists and is being used for something
# besides games, you probably want to specify a new group instead
# NB: the group will be created locally; if your computer is centrally
# administered this may not be what you (or your admin) want.
# Consider a non-shared install (WANT_SHARE_INSTALL=0) instead.
# - 'make install' must be run as "sudo make install"
#WANT_SHARE_INSTALL=1
GAMEUID = $(USER)
GAMEGRP = games
# build to run in the source tree - primarily for development. Build with "make all"
#WANT_SOURCE_INSTALL=1
CC=clang
CXX=clang++ -std=gnu++11
# At the moment this is just for debugging, but in the future it could be
# useful for other things. Requires SYSCF and an ANSI compiler.
#WANT_WIN_CHAIN=1
#
# You shouldn't need to change anything below here.
#
#CFLAGS+=-W -Wimplicit -Wreturn-type -Wunused -Wformat -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -DGCC_WARN
CFLAGS+=-Wall -Wextra -Wno-missing-field-initializers -Wimplicit -Wreturn-type -Wunused -Wformat -Wswitch -Wshadow -Wwrite-strings -DGCC_WARN
# As of LLVM build 2336.1.00, this gives dozens of spurious messages, so
# leave it out by default.
#CFLAGS+=-Wunreachable-code
# XXX -g vs -O should go here, -I../include goes in the makefile
CFLAGS+=-g -I../include
# older binaries use NOCLIPPING, but that disables SIGWINCH
#CFLAGS+=-DNOCLIPPING
CFLAGS+= -DNOMAIL -DNOTPARMDECL -DHACKDIR=\"$(HACKDIR)\"
CFLAGS+= -DDEFAULT_WINDOW_SYS=\"$(WANT_DEFAULT)\" -DDLB
CFLAGS+= -DGREPPATH=\"/usr/bin/grep\"
ifdef WANT_WIN_CHAIN
CFLAGS+= -DWINCHAIN
HINTSRC=$(CHAINSRC)
HINTOBJ=$(CHAINOBJ)
endif
WINSRC =
WINOBJ0 =
WINLIB =
LINK = $(CC)
VARDATND =
ifdef WANT_WIN_TTY
WINSRC += $(WINTTYSRC)
WINOBJ0 += $(WINTTYOBJ)
WINLIB += $(WINTTYLIB)
WINTTYLIB=-lncurses
else # !WANT_WIN_TTY
CFLAGS += -DNOTTYGRAPHICS
endif # !WANT_WIN_TTY
ifdef WANT_WIN_X11
WINSRC += $(WINX11SRC)
WINOBJ0 += $(WINX11OBJ)
WINLIB += $(WINX11LIB)
LFLAGS += -L/opt/X11/lib
VARDATND += x11tiles NetHack.ad pet_mark.xbm pilemark.xbm
POSTINSTALL+= bdftopcf win/X11/nh10.bdf > $(HACKDIR)/nh10.pcf; (cd $(HACKDIR); mkfontdir);
CFLAGS += -DX11_GRAPHICS -I/opt/X11/include
# avoid repeated complaints about _X_NONNULL(args...) in <X11/Xfuncproto.h>
CFLAGS += -Wno-variadic-macros
endif # WANT_WIN_X11
ifdef WANT_WIN_QT
CFLAGS += -DQT_GRAPHICS -DNOUSER_SOUNDS
CFLAGS += $(shell PKG_CONFIG_PATH=$(QTDIR)/lib/pkgconfig pkg-config Qt5Gui Qt5Widgets Qt5Multimedia --cflags)
WINLIB += $(shell PKG_CONFIG_PATH=$(QTDIR)/lib/pkgconfig pkg-config Qt5Gui Qt5Widgets Qt5Multimedia --libs)
LINK=$(CXX)
WINSRC += $(WINQT4SRC)
WINOBJ0 += $(WINQT4OBJ)
VARDATND += rip.xpm
MOC = moc
# XXX if /Developer/qt exists and QTDIR not set, use that
ifndef QTDIR
$(error QTDIR not defined in the environment or Makefile)
endif # QTDIR
# XXX make sure QTDIR points to something reasonable
endif # WANT_WIN_QT
# prevent duplicate tile.o in WINOBJ
WINOBJ = $(sort $(WINOBJ0))
ifdef WANT_SHARE_INSTALL
# if $GAMEUID is root, we install into roughly proper Mac locations, otherwise
# we install into ~/nethackdir
ifeq ($(GAMEUID),root)
PREFIX:=/Library/NetHack
SHELLDIR=/usr/local/bin
HACKDIR=$(PREFIX)/nethackdir
CHOWN=chown
CHGRP=chgrp
# We run sgid so the game has access to both HACKDIR and user preferences.
GAMEPERM = 02755
else # ! root
PREFIX:=/Users/$(GAMEUID)
SHELLDIR=$(PREFIX)/bin
HACKDIR=$(PREFIX)/Library/NetHack/nethackdir
CHOWN=/usr/bin/true
CHGRP=/usr/bin/true
GAMEPERM = 0500
endif # ! root
VARFILEPERM = 0664
VARDIRPERM = 0775
ROOTCHECK= [[ `id -u` == 0 ]] || ( echo "Must run install with sudo."; exit 1)
# XXX it's nice we don't write over sysconf, but we've already erased it
# make sure we have group GAMEUID and group GAMEGRP
PREINSTALL= . sys/unix/hints/macosx.sh user2 $(GAMEUID); . sys/unix/hints/macosx.sh group2 $(GAMEGRP); mkdir $(SHELLDIR); chown $(GAMEUID) $(SHELLDIR)
POSTINSTALL+= sys/unix/hints/macosx.sh editsysconf sys/unix/sysconf $(HACKDIR)/sysconf; $(CHOWN) $(GAMEUID) $(HACKDIR)/sysconf; $(CHGRP) $(GAMEGRP) $(HACKDIR)/sysconf; chmod $(VARFILEPERM) $(HACKDIR)/sysconf;
CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" -DSECURE
else ifdef WANT_SOURCE_INSTALL
PREFIX=$(abspath $(NHSROOT))
# suppress nethack.sh
#SHELLDIR=
HACKDIR=$(PREFIX)/playground
CHOWN=/usr/bin/true
CHGRP=/usr/bin/true
GAMEPERM = 0700
VARFILEPERM = 0600
VARDIRPERM = 0700
POSTINSTALL+= sys/unix/hints/macosx.sh editsysconf sys/unix/sysconf $(HACKDIR)/sysconf;
# We can use "make all" to build the whole thing - but it misses some things:
MOREALL=$(MAKE) install
CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" -DSECURE
else # !WANT_SOURCE_INSTALL
PREFIX:=$(wildcard ~)
SHELLDIR=$(PREFIX)/bin
HACKDIR=$(PREFIX)/nethackdir
CHOWN=/usr/bin/true
CHGRP=/usr/bin/true
GAMEPERM = 0700
VARFILEPERM = 0600
VARDIRPERM = 0700
ifdef WANT_WIN_X11
# install nethack.rc as ~/.nethackrc if no ~/.nethackrc exists
PREINSTALL= cp -n win/X11/nethack.rc ~/.nethackrc
endif # WANT_WIN_X11
POSTINSTALL+= sys/unix/hints/macosx.sh editsysconf sys/unix/sysconf $(HACKDIR)/sysconf; $(CHOWN) $(GAMEUID) $(HACKDIR)/sysconf; $(CHGRP) $(GAMEGRP) $(HACKDIR)/sysconf; chmod $(VARFILEPERM) $(HACKDIR)/sysconf;
CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" -DSECURE
endif # !WANT_SOURCE_INSTALL
INSTDIR=$(HACKDIR)
VARDIR=$(HACKDIR)
# ~/Library/Preferences/NetHack Defaults
# OPTIONS=name:player,number_pad,menustyle:partial,!time,showexp
# OPTIONS=hilite_pet,toptenwin,msghistory:200,windowtype:Qt
#
# Install.Qt mentions a patch for macos - it's not there (it seems to be in the Qt binary
# package under the docs directory).
#-POST
ifdef MAKEFILE_TOP
###
### Packaging
###
# Notes:
# 1) The Apple developer utilities must be installed in the default location.
# 2) Do a normal build before trying to package the game.
# 3) This matches the 3.4.3 Term package, but there are some things that should
# be changed.
ifdef WANT_WIN_TTY
DEVUTIL=/Developer/Applications/Utilities
SVS=$(shell $(NHSROOT)/util/makedefs --svs)
SVSDOT=$(shell $(NHSROOT)/util/makedefs --svs .)
PKGROOT_UG = PKGROOT/$(PREFIX)
PKGROOT_UGLN = PKGROOT/$(HACKDIR)
PKGROOT_BIN = PKGROOT/$(SHELLDIR)
build_tty_pkg:
ifneq (,$(WANT_WIN_X11)$(WANT_WIN_QT))
-echo build_tty_pkg only works for a tty-only build
exit 1
else
rm -rf NetHack-$(SVS)-mac-Term.pkg NetHack-$(SVS)-mac-Term.dmg
$(MAKE) build_package_root
rm -rf RESOURCES
mkdir RESOURCES
#enscript --language=rtf -o - < dat/license >RESOURCES/License.rtf
sys/unix/hints/macosx.sh descplist > RESOURCES/Description.plist
sys/unix/hints/macosx.sh infoplist > Info.plist
mkdir PKGROOT/Applications
#osacompile -o NetHackQt/NetHackQt.app/nethackdir/NetHackRecover.app \
# win/macosx/NetHackRecover.applescript
#cp win/macosx/recover.pl NetHackQt/NetHackQt.app/nethackdir
osacompile -o PKGROOT/Applications/NetHackRecover.app \
win/macosx/NetHackRecover.applescript
cp win/macosx/recover.pl $(PKGROOT_UGLN)
osacompile -o PKGROOT/Applications/NetHackTerm.app \
win/macosx/NetHackTerm.applescript
# XXX integrate into Makefile.doc
(cd doc; cat Guidebook.mn | ../util/makedefs --grep --input - --output - \
| tbl tmac.n - | groff | pstopdf -i -o Guidebook.pdf)
cp doc/Guidebook.pdf $(PKGROOT_UG)/doc/NetHackGuidebook.pdf
osacompile -o PKGROOT/Applications/NetHackGuidebook.app \
win/macosx/NetHackGuidebook.applescript
mkdir -p PKG
pkgbuild --root PKGROOT --identifier org.nethack.term --scripts PKGSCRIPTS PKG/NH-Term.pkg
productbuild --synthesize --product Info.plist --package PKG/NH-Term.pkg Distribution.xml
productbuild --distribution Distribution.xml --resources RESOURCES --package-path PKG NetHack-$(SVS)-mac-Term.pkg
hdiutil create -verbose -srcfolder NetHack-$(SVS)-mac-Term.pkg NetHack-$(SVS)-mac-Term.dmg
build_package_root:
cd src/.. # make sure we are at TOP
rm -rf PKGROOT
mkdir -p $(PKGROOT_UG)/lib $(PKGROOT_BIN) $(PKGROOT_UG)/man/man6 $(PKGROOT_UG)/doc $(PKGROOT_UGLN)
install -p src/nethack $(PKGROOT_BIN)
# XXX should this be called nethackrecover?
install -p util/recover $(PKGROOT_BIN)
install -p doc/nethack.6 $(PKGROOT_UG)/man/man6
install -p doc/recover.6 $(PKGROOT_UG)/man/man6
install -p doc/Guidebook $(PKGROOT_UG)/doc
install -p dat/nhdat $(PKGROOT_UGLN)
sys/unix/hints/macosx.sh editsysconf sys/unix/sysconf $(PKGROOT_UGLN)/sysconf
cd dat; install -p $(DATNODLB) ../$(PKGROOT_UGLN)
# XXX these files should be somewhere else for good Mac form
touch $(PKGROOT_UGLN)/perm $(PKGROOT_UGLN)/record $(PKGROOT_UGLN)/logfile $(PKGROOT_UGLN)/xlogfile
mkdir $(PKGROOT_UGLN)/save
# XXX what about a news file?
mkdir -p PKGSCRIPTS
echo '#!/bin/sh' > PKGSCRIPTS/postinstall
echo dseditgroup -o create -r '"Games Group"' -s 3600 $(GAMEGRP) >> PKGSCRIPTS/postinstall
echo $(CHOWN) -R $(GAMEUID) $(HACKDIR) >> PKGSCRIPTS/postinstall
echo $(CHGRP) -R $(GAMEGRP) $(HACKDIR) >> PKGSCRIPTS/postinstall
echo $(CHOWN) $(GAMEUID) $(SHELLDIR)/nethack >> PKGSCRIPTS/postinstall
echo $(CHGRP) $(GAMEGRP) $(SHELLDIR)/nethack >> PKGSCRIPTS/postinstall
echo $(CHOWN) $(GAMEUID) $(SHELLDIR)/recover >> PKGSCRIPTS/postinstall
echo $(CHGRP) $(GAMEGRP) $(SHELLDIR)/recover >> PKGSCRIPTS/postinstall
echo chmod $(VARDIRPERM) $(HACKDIR) >> PKGSCRIPTS/postinstall
echo chmod $(VARDIRPERM) $(HACKDIR)/save >> PKGSCRIPTS/postinstall
echo chmod $(FILEPERM) $(HACKDIR)/license >> PKGSCRIPTS/postinstall
echo chmod $(FILEPERM) $(HACKDIR)/nhdat >> PKGSCRIPTS/postinstall
echo chmod $(FILEPERM) $(HACKDIR)/symbols >> PKGSCRIPTS/postinstall
echo chmod $(VARFILEPERM) $(HACKDIR)/perm >> PKGSCRIPTS/postinstall
echo chmod $(VARFILEPERM) $(HACKDIR)/record >> PKGSCRIPTS/postinstall
echo chmod $(VARFILEPERM) $(HACKDIR)/logfile >> PKGSCRIPTS/postinstall
echo chmod $(VARFILEPERM) $(HACKDIR)/xlogfile >> PKGSCRIPTS/postinstall
echo chmod $(VARFILEPERM) $(HACKDIR)/sysconf >> PKGSCRIPTS/postinstall
echo chmod $(GAMEPERM) $(SHELLDIR)/nethack >> PKGSCRIPTS/postinstall
echo chmod $(EXEPERM) $(SHELLDIR)/recover >> PKGSCRIPTS/postinstall
chmod 0775 PKGSCRIPTS/postinstall
endif # end of build_tty_pkg
endif # WANT_WIN_TTY for packaging
ifdef WANT_WIN_QT
# XXX untested and incomplete (see below)
build_qt_pkg:
ifneq (,$(WANT_WIN_X11)$(WANT_WIN_TTY))
-echo build_qt_pkg only works for a qt-only build
exit 1
else
$(MAKE) build_package_root
rm -rf NetHackQt
mkdir -p NetHackQt/NetHackQt.app/nethackdir/save
mkdir NetHackQt/Documentation
cp doc/Guidebook.txt doc/nethack.txt doc/recover.txt NetHackQt/Documentation
osacompile -o NetHackQt/NetHackQt.app/nethackdir/NetHackRecover.app \
win/macosx/NetHackRecover.applescript
cp win/macosx/recover.pl NetHackQt/NetHackQt.app/nethackdir
mkdir -p NetHackQt/NetHackQt.app/Contents/Frameworks
cp $(QTDIR)/libqt-mt.3.dylib NetHackQt/NetHackQt.app/Contents/Frameworks
mkdir NetHackQt/NetHackQt.app/Contents/MacOS
mv PKGROOT/nethack NetHackQt/NetHackQt.app/Contents/MacOS
mv PKGROOT/lib/nethackdir NetHackQt/NetHackQt.app/nethackdir
# XXX still missing:
#NetHackQt/NetHackQt.app
# /Contents
# Info.plist
# Resources/nethack.icns
#NetHackQt/Documentation
#NetHackQtRecover.txt
#NetHack Defaults.txt
#changes.patch XXX is this still needed? why isn't it part of the tree?
# doesn't go here
hdiutil create -verbose -srcfolder NetHackQt NetHack-$(SVS)-macosx-qt.dmg
endif # end of build_qt_pkg
endif # WANT_WIN_QT for packaging
endif # MAKEFILE_TOP

1
sys/winnt/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
NetHack.ico

View File

@@ -33,10 +33,16 @@
#==============================================================================
# BUILD DECISIONS SECTION
#
# There are currently only 3 decisions that you have to make.
# There are currently only 4 decisions that you have to make.
# 1. 32-bit or 64-bit?
# 2. Where do you want your build to end up?
# 3. Do you want debug information in the executable?
# 4. Do you want additional GUI interfaces in the executable?
#
# Note that additional GUI interfaces may require external libraries.
# Qt is placed where the official installer places it.
# Other libraries are placed in a subdirectory of your home directory, either
# x86libs or x64libs depending on whether you're building for 64 bits.
#
#==============================================================================
# 1. 32-bit or 64-bit?
@@ -62,6 +68,26 @@ GAMEDIR = ../binary
DEBUGINFO = Y
#
#---------------------------------------------------------------
# 4. Do you want additional GUI interfaces in the executable?
# Make these Y to enable the GUIs. Win32 is always enabled,
# and is the default.
#
WANT_WIN_QT4 = N
# WANT_WIN_QT4 requires Qt 4 or Qt 5, see
# https://www.qt.io/download-open-source/
# Earlier versions of Qt are not compatible with Windows
# For Qt 5, use:
QT4_DIRECTORY = c:/Qt/Qt5.9.2/5.9.2/mingw53_32
HAVE_QT5 = Y
# For Qt 4, comment out the above two lines and use:
#QT4_DIRECTORY = c:/Qt/4.8.6
#HAVE_QT5 = N
# This marks the end of the BUILD DECISIONS section.
#==============================================================================
#
@@ -97,6 +123,8 @@ MSWSYS = ../sys/winnt
TTY = ../win/tty
# window port files (WIN32)
MSWIN = ../win/win32
# window port files (Qt4)
QT4 = ../win/Qt4
# Tile support files
WSHR = ../win/share
@@ -107,8 +135,12 @@ WSHR = ../win/share
OBJ = o
cc = gcc
cxx = g++
rc = windres
link = gcc
ifeq "$(WANT_WIN_QT4)" "Y"
link = g++
endif
#
#==========================================
@@ -159,6 +191,9 @@ RANDOM = $(OBJ)/random.o
#RANDOM =
WINPFLAG = -DTILES -DMSWIN_GRAPHICS -DWIN32CON -D_WIN32_IE=0x0400 -D_WIN32_WINNT=0x0501
ifeq "$(WANT_WIN_QT4)" "Y"
WINPFLAG += -DQT_GRAPHICS -DPIXMAPDIR='"."'
endif
# To store all the level files,
# help files, etc. in a single library file.
# USE_DLB = Y is left uncommented
@@ -191,8 +226,38 @@ CFLAGSBASE = -c $(cflags) -I$(INCL) $(WINPINC) $(cdebug)
#LFLAGSBASEC = $(linkdebug)
#LFLAGSBASEG = $(linkdebug) -mwindows
conlibs = -lwinmm
conlibs = -lgdi32 -lwinmm
guilibs = -lcomctl32 -lwinmm
ifeq "$(WANT_WIN_QT4)" "Y"
# Might be either Qt 4 or Qt 5
ifeq "$(HAVE_QT5)" "Y"
guilibs += $(QT4_DIRECTORY)/lib/libQt5Core.a
guilibs += $(QT4_DIRECTORY)/lib/libQt5Gui.a
guilibs += $(QT4_DIRECTORY)/lib/libQt5Widgets.a
conlibs += $(QT4_DIRECTORY)/lib/libQt5Core.a
else
guilibs += $(QT4_DIRECTORY)/lib/libQtCore4.a
guilibs += $(QT4_DIRECTORY)/lib/libQtGui4.a
conlibs += $(QT4_DIRECTORY)/lib/libQtCore4.a
endif
endif
#==========================================
# Extra files needed for some ports
#==========================================
EXTRA_FILES =
ifeq "$(WANT_WIN_QT4)" "Y"
ifeq "$(HAVE_QT5)" "Y"
EXTRA_FILES += $(GAMEDIR)/Qt5Core.dll
EXTRA_FILES += $(GAMEDIR)/Qt5Gui.dll
EXTRA_FILES += $(GAMEDIR)/Qt5Widgets.dll
else
# TODO: define QT 4 DLLs here
EXTRA_FILES += $(GAMEDIR)/QtCore4.dll
EXTRA_FILES += $(GAMEDIR)/QtGui4.dll
endif
EXTRA_FILES += $(GAMEDIR)/rip.xpm
endif
#==========================================
# Util builds
@@ -208,6 +273,8 @@ LFLAGSU = $(LFLAGSBASEC)
CFLAGS = $(CFLAGSBASE) $(WINPFLAG) $(DLBFLG)
lflags = $(LFLAGSBASEC) $(linkdebuf)
CXXFLAGS = $(CFLAGS)
ifeq "$(USE_DLB)" "Y"
DLB = nhdat
else
@@ -320,12 +387,28 @@ GUIOBJ = $(O)mhaskyn.o $(O)mhdlg.o \
$(O)mhfont.o $(O)mhinput.o $(O)mhmain.o $(O)mhmap.o \
$(O)mhmenu.o $(O)mhmsgwnd.o $(O)mhrip.o $(O)mhsplash.o \
$(O)mhstatus.o $(O)mhtext.o $(O)mswproc.o $(O)winhack.o
ifeq "$(WANT_WIN_QT4)" "Y"
GUIOBJ += $(O)qt4bind.o $(O)qt4click.o $(O)qt4clust.o $(O)qt4delay.o \
$(O)qt4glyph.o $(O)qt4icon.o $(O)qt4inv.o $(O)qt4key.o $(O)qt4line.o \
$(O)qt4main.o $(O)qt4map.o $(O)qt4menu.o $(O)qt4msg.o $(O)qt4plsel.o \
$(O)qt4rip.o $(O)qt4set.o $(O)qt4stat.o $(O)qt4str.o $(O)qt4streq.o \
$(O)qt4svsel.o $(O)qt4win.o $(O)qt4xcmd.o $(O)qt4yndlg.o
endif
GUIHDR = $(MSWIN)/mhaskyn.h $(MSWIN)/mhdlg.h $(MSWIN)/mhfont.h \
$(MSWIN)/mhinput.h $(MSWIN)/mhmain.h $(MSWIN)/mhmap.h \
$(MSWIN)/mhmenu.h $(MSWIN)/mhmsg.h $(MSWIN)/mhmsgwnd.h \
$(MSWIN)/mhrip.h $(MSWIN)/mhstatus.h \
$(MSWIN)/mhtext.h $(MSWIN)/resource.h $(MSWIN)/winMS.h
ifeq "$(WANT_WIN_QT4)" "Y"
GUIHDR += $(QT4)/qt4bind.h $(QT4)/qt4click.h $(QT4)/qt4clust.h \
$(QT4)/qt4delay.h $(QT4)/qt4glyph.h $(QT4)/qt4icon.h $(QT4)/qt4inv.h \
$(QT4)/qt4kde0.h $(QT4)/qt4key.h $(QT4)/qt4line.h $(QT4)/qt4main.h \
$(QT4)/qt4map.h $(QT4)/qt4menu.h $(QT4)/qt4msg.h $(QT4)/qt4plsel.h \
$(QT4)/qt4rip.h $(QT4)/qt4set.h $(QT4)/qt4stat.h $(QT4)/qt4str.h \
$(QT4)/qt4streq.h $(QT4)/qt4svsel.h $(QT4)/qt4win.h $(QT4)/qt4xcmd.h \
$(QT4)/qt4yndlg.h
endif
KEYDLLS = $(GAMEDIR)/nhdefkey.dll $(GAMEDIR)/nh340key.dll $(GAMEDIR)/nhraykey.dll
@@ -385,7 +468,7 @@ DATABASE = $(DAT)/data.base
#================ RULES ==================
#==========================================
.SUFFIXES: .exe .o .til .uu .c .y .l
.SUFFIXES: .exe .o .til .uu .c .y .l .moc
#==========================================
# Rules for files in src
@@ -405,7 +488,7 @@ $(OBJ)/%.o : $(SSYS)/%.c
$(cc) $(CFLAGS) -o$@ $<
$(OBJ)/%.o : $(SSYS)/%.cpp
g++ $(CFLAGS) -std=c++11 -o$@ $<
$(cxx) $(CXXFLAGS) -std=c++11 -o$@ $<
#==========================================
# Rules for files in sys/winnt
@@ -451,6 +534,21 @@ $(OBJ)/%.o : $(TTY)/%.c
$(OBJ)/%.o : $(MSWIN)/%.c
$(cc) $(CFLAGS) -o$@ $<
#==========================================
# Rules for files in win/Qt4
#==========================================
ifeq "$(HAVE_QT5)" "Y"
QT4_CXXFLAGS = -std=c++11
else
QT4_CXXFLAGS =
endif
$(OBJ)/%.o : $(QT4)/%.cpp
$(cxx) $(CXXFLAGS) $(QT4_CXXFLAGS) -I$(MSWIN) -I$(QT4_DIRECTORY)/include -o$@ $<
$(QT4)/%.moc : $(QT4)/%.h
$(QT4_DIRECTORY)\bin\moc -o $@ $<
#==========================================
#=============== TARGETS ==================
#==========================================
@@ -472,7 +570,7 @@ default : install
all : install
install: graphicschk $(O)obj.tag $(GAMEDIR)/NetHack.exe $(GAMEDIR)/NetHackW.exe $(O)install.tag
install: graphicschk $(O)obj.tag $(GAMEDIR)/NetHack.exe $(GAMEDIR)/NetHackW.exe $(O)install.tag $(EXTRA_FILES)
@echo NetHack is up to date.
@echo Done.
@@ -1035,8 +1133,33 @@ spotless: clean
$(subst /,\,if exist $(U)recover.exe del $(U)recover.exe)
$(subst /,\,if exist $(DAT)/dlb.lst del $(DAT)/dlb.lst)
$(subst /,\,if exist nhdat. del nhdat.)
$(subst /,\,if exist $(QT4)/*.moc del $(QT4)/*.moc)
$(subst /,\,if exist $(DAT)/bogusmon del $(DAT)/bogusmon)
$(subst /,\,if exist $(DAT)/engrave del $(DAT)/engrave)
$(subst /,\,if exist $(DAT)/epitaph del $(DAT)/epitaph)
$(subst /,\,if exist $(DAT)/porthelp del $(DAT)/porthelp)
$(subst /,\,if exist $(INCL)/dgn_comp.h del $(INCL)/dgn_comp.h)
$(subst /,\,if exist $(INCL)/lev_comp.h del $(INCL)/lev_comp.h)
$(subst /,\,if exist $(INCL)/win32api.h del $(INCL)/win32api.h)
$(subst /,\,if exist $(MSWSYS)/NetHack.ico del $(MSWSYS)/NetHack.ico)
$(subst /,\,if exist $(U)dgn_flex.c del $(U)dgn_flex.c)
$(subst /,\,if exist $(U)dgn_yacc.c del $(U)dgn_yacc.c)
$(subst /,\,if exist $(U)dlb_main.exe del $(U)dlb_main.exe)
$(subst /,\,if exist $(U)lev_flex.c del $(U)lev_flex.c)
$(subst /,\,if exist $(U)lev_yacc.c del $(U)lev_yacc.c)
$(subst /,\,if exist $(U)tile2bmp.exe del $(U)tile2bmp.exe)
$(subst /,\,if exist $(U)tilemap.exe del $(U)tilemap.exe)
$(subst /,\,if exist $(U)uudecode.exe del $(U)uudecode.exe)
$(subst /,\,if exist $(MSWIN)/NetHack.ico del $(MSWIN)/NetHack.ico)
$(subst /,\,if exist $(MSWIN)/mnsel.bmp del $(MSWIN)/mnsel.bmp)
$(subst /,\,if exist $(MSWIN)/mnselcnt.bmp del $(MSWIN)/mnselcnt.bmp)
$(subst /,\,if exist $(MSWIN)/mnunsel.bmp del $(MSWIN)/mnunsel.bmp)
$(subst /,\,if exist $(MSWIN)/petmark.bmp del $(MSWIN)/petmark.bmp)
$(subst /,\,if exist $(MSWIN)/pilemark.bmp del $(MSWIN)/pilemark.bmp)
$(subst /,\,if exist $(MSWIN)/rip.bmp del $(MSWIN)/rip.bmp)
$(subst /,\,if exist $(MSWIN)/splash.bmp del $(MSWIN)/splash.bmp)
ifneq "$(OBJ)" ""
$(subst /,\,rmdir $(OBJ)) /s /Q
$(subst /,\,if exist $(OBJ) rmdir $(OBJ)) /s /Q
endif
clean:
@@ -1057,6 +1180,40 @@ clean:
# OTHER DEPENDENCIES
#===================================================================
# Other files needed by some ports
$(GAMEDIR)/Qt5Core.dll : $(QT4_DIRECTORY)/bin/Qt5Core.dll
$(subst /,\,@copy $< $@ >nul)
$(GAMEDIR)/Qt5Gui.dll : $(QT4_DIRECTORY)/bin/Qt5Gui.dll
$(subst /,\,@copy $< $@ >nul)
$(GAMEDIR)/Qt5Widgets.dll : $(QT4_DIRECTORY)/bin/Qt5Widgets.dll
$(subst /,\,@copy $< $@ >nul)
$(GAMEDIR)/QtCore4.dll : $(QT4_DIRECTORY)/bin/QtCore4.dll
$(subst /,\,@copy $< $@ >nul)
$(GAMEDIR)/QtGui4.dll : $(QT4_DIRECTORY)/bin/QtGui4.dll
$(subst /,\,@copy $< $@ >nul)
$(GAMEDIR)/nhtiles.bmp : $(SRC)/tiles.bmp
$(subst /,\,@copy $< $@ >nul)
$(GAMEDIR)/rip.xpm : ../win/X11/rip.xpm
$(subst /,\,@copy $< $@ >nul)
# Dependencies on .moc files (for Qt 4 or 5)
$(OBJ)/qt4main.o : $(QT4)/qt4main.cpp $(QT4)/qt4main.moc $(QT4)/qt4kde0.moc
$(OBJ)/qt4map.o : $(QT4)/qt4map.cpp $(QT4)/qt4map.moc
$(OBJ)/qt4menu.o : $(QT4)/qt4menu.cpp $(QT4)/qt4menu.moc
$(OBJ)/qt4msg.o : $(QT4)/qt4msg.cpp $(QT4)/qt4msg.moc
$(OBJ)/qt4plsel.o : $(QT4)/qt4plsel.cpp $(QT4)/qt4plsel.moc
$(OBJ)/qt4set.o : $(QT4)/qt4set.cpp $(QT4)/qt4set.moc
$(OBJ)/qt4stat.o : $(QT4)/qt4stat.cpp $(QT4)/qt4stat.moc
$(OBJ)/qt4xcmd.o : $(QT4)/qt4xcmd.cpp $(QT4)/qt4xcmd.moc
$(OBJ)/qt4yndlg.o : $(QT4)/qt4yndlg.cpp $(QT4)/qt4yndlg.moc
#
# dat dependencies
#

View File

@@ -12,6 +12,10 @@
int GUILaunched;
struct window_procs mswin_procs = { "guistubs" };
#ifdef QT_GRAPHICS
struct window_procs Qt_procs = { "guistubs" };
int qt_tilewidth, qt_tileheight, qt_fontsize, qt_compact_mode;
#endif
void
mswin_destroy_reg()
{