To update, run "perl DEVEL/nhgitset.pl"
Fixes:
- "nhcommit -a" has been fixed
- NHDT was hardwired in places
- no longer complain about a missing dat directory outside of the
NetHack source tree
- make update of gitinfo atomic
- Replace some hardwired directory separators with OS-dependent constructs
Backwards Incompatibilities:
- NH_DATESUB's DATE() is now Date() to match the other variables
- MSYS2 requires an additional Perl package - the MSYS2 docs have
been updated
New Help System:
- git nhhelp
This command mirrors "git help" for nh* commands.
- See git nhhelp nhsub for general help on substitution variables
New Substitution Variables:
-Brev()
An aBREViation of $PREFIX-Branch$:$PREFIX-Revision$ - this
may help get line length under control in file headers.
-Assert(TYPE=VALUE)
If TYPE does not match VALUE, do not substitute on this line.
TYPE P checks VALUE against nethack.substprefix
-Project(arg)
Returns nethack.projectname if there is no arg and an uppercase
version if arg is uc.
Other New Features:
- Add nethack.projectname
- Documentation updates - see "git nhhelp nhsub"
- On checkout or merge of a branch, check for nhgitset version updates
and provide an optional message to the user.
- Move NH_DATESUB substitutions here from cron job to keep dates in sync
- PREFIX-* keywords now available in NH_DATESUB templates
- Support use of nhgitset.pl from a different repo; note that update
checks will be dependent on keeping the original source repo up-to-date
and in the same location.
151 lines
6.0 KiB
Plaintext
151 lines
6.0 KiB
Plaintext
Building NetHack using MSYS2
|
|
|
|
Prerequisite Requirements:
|
|
|
|
o MSYS2
|
|
- https://www.msys2.org/
|
|
- Download and run the installer, and start the UCRT64 shell.
|
|
then
|
|
pacman -S mingw-w64-ucrt-x86_64-gcc
|
|
pacman -S git
|
|
pacman -S make
|
|
pacman -S vim (or your editor of choice)
|
|
pacman -S man (otherwise "git help foo" will not work)
|
|
pacman -S perl-doc (otherwise "git nhhelp foo" will not work,
|
|
so only needed if you use nhgitset.pl)
|
|
o Lua
|
|
o pdcursesmod (Only required if curses interface support is desired)
|
|
Instructions for obtaining these are later in this file.
|
|
|
|
/---------------------------------------------\
|
|
| Directories for a Windows NetHack build |
|
|
\---------------------------------------------/
|
|
|
|
(NetHack-top)
|
|
|
|
|
+-----+------+-----+-------+-----------+-----------+-----~-----+------+
|
|
| | | | | | | | |
|
|
dat doc include lib src sys win submodules util
|
|
| | | |
|
|
+----------+ +------+ +----+ +----+
|
|
| | | | | | | |
|
|
| | | | | | | |
|
|
lua-5.4.6 pdcursesmod share windows tty win32 lua pdcursesmod
|
|
|
|
|
vs
|
|
|
|
|
+----------+-------+--------+--------+-----------+-------+-----+------+
|
|
| | | | | | | | |
|
|
makedefs NetHack NetHackW PDCurses PDCursesGui tile2bmp tilemap tiles uudecode
|
|
|
|
/-----------------------------------------------------------\
|
|
| Building from MSYS2 bash |
|
|
\-----------------------------------------------------------/
|
|
|
|
Required components that are not bundled in the NetHack repository, but
|
|
are required to build NetHack yourself.
|
|
|
|
Lua
|
|
NetHack 3.7 for Windows requires 3rd party Lua source that is not part
|
|
of the NetHack distribution or repository.
|
|
|
|
A bash shell script for fetching prerequisite
|
|
sources is available, and can be run as follows from the top of
|
|
the NetHack source tree to obtain lua:
|
|
sh sys/windows/fetch.sh lua
|
|
|
|
Curses
|
|
If you want to include curses interface support in NetHack 3.7 for
|
|
3rd part pdcursesmod source code is required and is not part of the
|
|
NetHack distribution or repository.
|
|
|
|
A bash shell script for fetching prerequisite
|
|
sources is available, and can be run as follows from the top of
|
|
the NetHack source tree to obtain pdcursesmod:
|
|
sh sys/windows/fetch.sh pdcursesmod
|
|
|
|
Building
|
|
|
|
Two different versions of NetHack will be built for Windows from the
|
|
command line using the Makefile approach:
|
|
A tty port utilizing the Win32 Console I/O subsystem Console,
|
|
and a curses interface in an executable called NetHack.exe.
|
|
|
|
A Win32 native port built on the Windows API Graphical NetHack,
|
|
and graphical curses in an executable called NetHackW.exe.
|
|
|
|
The Makefile configurations will build both NetHack.exe and NetHackW.exe
|
|
and will be able to use the same datafiles, save files and bones files.
|
|
|
|
Since the last official release of NetHack, compilers and computer
|
|
architectures have evolved and you can now choose whether to build
|
|
a 32-bit x86 version, or a 64-bit x64 version. The default Makefile
|
|
is set up for a 32-bit x86 version, but that's only because it will
|
|
run on the largest number of existing Windows environments. Change it if you
|
|
want. Be aware that NetHack's save files and bones files in the 3.7.0
|
|
release are not interchangeable between the 32-bit version and the
|
|
64-bit version (or between different platforms).
|
|
|
|
I. Dispelling the Myths:
|
|
|
|
Compiling NetHack for Windows is not as easy as it sounds, nor as hard
|
|
as it looks, however it will behoove you to read this entire section
|
|
through before beginning the task.
|
|
|
|
We have provided Makefile.mingw32 in
|
|
sys/windows/Makefile.mingw32, which you use from the bash Windows command
|
|
shell included with MSYS2.
|
|
|
|
|
|
II. To compile your copy of NetHack on a Windows machine using MSYS2:
|
|
|
|
Setting Up
|
|
|
|
1. Change your current directory the top of the nethack
|
|
source tree if it isn't there already.
|
|
|
|
2. Execute the following command to place copies of the Makefiles in
|
|
the src subfolder.
|
|
cp sys/windows/Makefile.mingw32* src
|
|
|
|
3. Change your current directory to the src subfolder of the nethack
|
|
source tree. The following command assumes you are still in the
|
|
sys/windows folder from steps #1 and #2 above:
|
|
cd src
|
|
|
|
Compiling
|
|
|
|
4. Now that everything is set up, you should be ready to start the
|
|
process.
|
|
|
|
Your current directory should be the NetHack src directory.
|
|
|
|
Issue these following commands:
|
|
make -f Makefile.mingw32 clean
|
|
make -f Makefile.mingw32 depend
|
|
make -f Makefile.mingw32
|
|
|
|
If all goes well, intermediate NetHack files will be placed in the
|
|
binary subfolder of the NetHack tree, and the final NetHack package
|
|
for windows will be in the package subfolder.
|
|
|
|
Notes:
|
|
|
|
1. To rebuild NetHack after changing something, change your current directory
|
|
to src and issue the appropriate command for your compiler:
|
|
|
|
For gcc:
|
|
make -f Makefile.mingw32
|
|
|
|
2. An alternative to MSYS2 may be MinGW-w64 - winlibs standalone build.
|
|
That has not been tested by us at time of writing.
|
|
MinGW-w64 - winlibs standalone build
|
|
- https://github.com/brechtsanders/winlibs_mingw
|
|
- Download one of the releases from
|
|
https://github.com/brechtsanders/winlibs_mingw/releases
|
|
and extract the contents into a folder (ideally in a folder
|
|
without spaces in the path), and add the location of the
|
|
subfolder containing gcc.exe to your PATH.
|
|
|
|
|