forked from NetHack/NetHack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-hannethack.txt
More file actions
161 lines (106 loc) · 5.25 KB
/
Copy pathbuild-hannethack.txt
File metadata and controls
161 lines (106 loc) · 5.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
Building HanNetHack on Windows (Visual Studio)
================================================
This guide covers building HanNetHack (Korean NetHack) on Windows
using Visual Studio. The game reads Korean strings from an in-memory
message catalog (src/mo_reader.c) loaded out of nhdat; it does **not**
link GNU libintl or ship gettext runtime DLLs.
Quick Start
-----------
If you just want to build and play, run these commands from the
top of the HanNetHack source tree in a Windows Command Prompt:
sys\windows\fetch.cmd lua
sys\windows\fetch.cmd pdcursesmod
Then open sys\windows\vs\NetHack.sln in Visual Studio, select
Release | x64, and build the solution (Ctrl+Shift+B).
After building, run the install script to set up the game directory:
sys\windows\install.cmd
The game will be ready to play in the install\HanNetHack\ directory.
Optional — only if you change po/*.po or need to regenerate the
message catalog (dat/locale/ko/nethack.mo) for nmake package:
sys\windows\setup-gettext.cmd
Prerequisites
-------------
1. Visual Studio 2022 or later (Community edition is free)
- "Desktop development with C++" workload must be installed
- Install: https://visualstudio.microsoft.com/vs/community/
If installing from command line:
winget install Microsoft.VisualStudio.2022.Community ^
--override "--add Microsoft.VisualStudio.Workload.NativeDesktop --includeRecommended --passive"
2. Lua 5.4.8 (downloaded automatically)
From the top of the source tree:
sys\windows\fetch.cmd lua
3. PDCursesMod 4.4.0 (optional, for curses/graphics support)
From the top of the source tree:
sys\windows\fetch.cmd pdcursesmod
4. gettext *tools* (optional — translators / nmake package only)
msgfmt and msgcat must be on PATH or under lib\gettext\bin\ when
rebuilding .mo from .po. One-shot setup:
sys\windows\setup-gettext.cmd
Building from Visual Studio IDE
-------------------------------
1. Open sys\windows\vs\NetHack.sln
2. Select configuration: Release (or Debug)
3. Select platform: x64
4. Build Solution (Ctrl+Shift+B)
Output:
binary\Release\x64\NetHack.exe - Console (TTY) version
binary\Release\x64\NetHackW.exe - GUI (Windows) version
binary\Release\x64\recover.exe - Save file recovery tool
Building from Command Line (MSBuild)
-------------------------------------
Open "Developer Command Prompt for VS 2022" and run:
cd <HanNetHack source directory>
msbuild sys\windows\vs\NetHack.sln /p:Configuration=Release /p:Platform=x64 /m
Or use the PowerShell helper (optional fetch, optional po compile, MSBuild,
then sys\windows\install.cmd by default):
pwsh -File sys\windows\Build-HanNetHack.ps1
If you see errors about platform toolset (v145), add:
/p:PlatformToolset=v143
Full data package (nmake, from src\)
--------------------------------------
To rebuild nhdat370 with the Korean locale bundle and .mo catalog
(the same output as CI `nmake package`), run from src\ after nhsetup.
HanNetHack `nhsetup.bat` defaults to a non-destructive install: it writes
`src\Makefile.win` (and GNUmakefile.win) without overwriting `src\Makefile`,
so a Unix `setup.sh` tree on the same clone stays intact. Build with:
nmake /f Makefile.win package
CI and anyone who wants the classic NetHack layout (`src\Makefile`) should run:
sys\windows\nhsetup.bat /install-makefile
(`/im` is short. Legacy: `/overwrite`, `/o`.) Then from src\:
nmake package
That path needs msgfmt/msgcat (see prerequisite 4).
Post-Build: Installing
----------------------
Run the install script to copy all necessary files:
sys\windows\install.cmd
This creates an install\HanNetHack\ directory with:
- NetHack.exe / NetHackW.exe
- Game data files (nhdat — includes Korean catalog and locale text)
- Configuration template
You can move the install\HanNetHack\ directory anywhere.
Double-click NetHackW.exe to play the GUI version,
or run NetHack.exe from a terminal for the console version.
Differences from Upstream NetHack
---------------------------------
HanNetHack adds the following to the Windows build:
- i18n.c, mo_reader.c, and ko_postpos.c for Korean localization
- Custom in-tree message catalog loader (no libintl link)
- /utf-8 compiler flag for Korean string literals in source
- DISABLE_WARNING_FORMAT / RESTORE_WARNING_FORMAT macros for MSVC
- Windows-compatible wcwidth() implementation for CJK character widths
Troubleshooting
---------------
Q: Build fails with "v145 build tools not found"
A: Add /p:PlatformToolset=v143 to your MSBuild command,
or retarget the solution in Visual Studio (right-click solution
-> Retarget Solution).
Q: nmake fails with "msgfmt" / "msgcat" not found when building nhdat
A: Run sys\windows\setup-gettext.cmd so tools land in lib\gettext\bin,
or install gettext on PATH.
Q: Build fails with "unresolved external symbol" in i18n / mo_reader
A: Ensure mo_reader.c is compiled and linked in the project (same as
i18n.c). NetHack.vcxproj / NetHackW.vcxproj should list it.
Q: Older docs mention libintl.h or copying intl-8.dll
A: Those steps applied to an earlier HanNetHack branch. Current
builds statically decode the catalog; no gettext DLLs beside the
.exe are required.