I recently returned to NH after a couple year hiatus, and in the
interim I had switched from my usual Solaris and Linux boxen to using
Mac OS X on my laptop. I was dismayed to find that precompiled NH
binaries assumed the Mac user's preference for a graphical interface. I
much prefer that which I learned on in the late 80s, a plain old TTY.
So I set out to compile NH for myself, something I hadn't done in
years.
Well, it turns out that NH doesn't compile out of the box on Mac OS X
10.4, at least not with only TTY graphics. I did a little tinkering and
got it to work satisfactorily. After a couple weeks of DYWYPI I started
playing with the recent patches, and eventually ended up trying out
Slash'EM for the first time. That necessitated repeating the whole hack
and compile process over again. Here are my notes so others don't have
to do as much error interpretation as I did.
Share and Enjoy!
---8<--- cut here --->8---
Nethack 3.4.3 won't compile on OS X straight out of the box. The same
appears to be true for Slash'EM 0.8.0E0. These are some basic
instructions on getting either running on OS X 10.4.
First set it up as a Unix, ie go to sys/unix and say "sh setup.sh".
Then edit src/Makefile. Comment out this line
WINTTYLIB = -ltermlib
and uncomment this one
# WINTTYLIB = -lncurses
OS X has ncurses built in, so we want to use it. Using termlib is
broken.
While you're editing Makefiles, in the top level Makefile you may also
want to change GAMEUID and GAMEGRP to "unknown" and "admin"
respectively. This fixes a make install complaint. You can substitute
your username, eg "james" instead of "unknown" if you are on a single
user system.
Next, edit win/tty/termcap.c and comment out this line
extern char *tparm();
I'm not quite certain about the rationale behind this, but I think it's
because we're perhaps using terminfo rather than termcap. Anyway, it
works.
OS X Terminal optimizes text output so Nethack's display-slowing tricks
don't work properly. Instead it should use a timer. Edit the file
include/unixconf.h and uncomment this define (but not the wing comment)
/* #define TIMED_DELAY */ /* usleep() */
For best results, use this in combination with the game options !null
and timed_delay, and set runmode to walk or crawl.
If you like the menucolors patch then there's an additional fix
necessary. I couldn't get USE_REGEX_MATCH in config.h to work for me,
so I commented it out. However, in include/unixconf.h it may be
possible to enable the regex matching if a define is tweaked, but I
haven't tested this. The relevant magic is
#if defined(USE_REGEX_MATCH)
# if defined(__FreeBSD__) || defined(__OpenBSD__)
# define POSIX_REGEX
# else
# define GNU_REGEX
# endif
#endif
Presumably something like || defined(__Darwin__) or whatever should be
added. GNU Regex isn't built in, but a POSIX one does seem to exist (ie
"apropos regex" pointed me to regex(3) which looks BSDish). I'm too
lazy to figure this out because all I want are the blessed and cursed
colors which don't need fancy regexps.
In addition, if you want nicer dungeon walls instead of the -- and | |
cruft, you can use the free (libre) DejaVu Sans Mono font which has
good support for the VT100 line drawing characters. This with Nethack's
DECgraphics option gives nice continuous lines for the dungeon walls
among other minor enhancements. Make sure for your Terminal window you
play Nethack in that the "Wide glyphs for Japanese/Chinese/etc." option
in "Display" is unchecked. Terminal tries to be smart and assumes that
the VT100 line drawing characters (mostly found only in CJK fonts
nowadays) are doublewidth, which is wrong for our purposes. Also
necessary is setting the "Character Set Encoding" to "Unicode (UTF-

".
Other Terminal settings I've found pleasant include using white (or 90%
gray) text on black background, a cursor color that is not among the 16
ANSI colors, a block cursor so you can pick out your own @ easily,
disabled scrollback buffer, and a large font size with antialiasing - I
use 20 point on a 15 inch PowerBook G4. To wrap up the whole thing in a
clickable pseudoapp you can use Terminal's "Save As..." and create a
..term file. In the save options select "Execute this command" and put
in something like
/usr/local/games/nethack
but note that you can't type the initial / at first (the dialog tries
too hard to be smart). If you check "Execute command in a shell" you
get a shell after DYWYPI happens so you can return to the dungeons with
ease.