1Installing NetHack with a Qt or KDE interface
2---------------------------------------------
3$NHDT-Date: 1524689332 2018/04/25 20:48:52 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.11 $
4# Copyright (c) 2004 by Warwick Allison
5# NetHack may be freely redistributed.  See license for details.
6
7This document describes the installation of NetHack with a Qt interface
8on UNIX/X11 or Mac OS X. This code should also work with Qt/Windows, but
9support for that is not currently official.
10
11You can download Qt from http://www.trolltech.com.
12You need Qt 2.0 or later to use this code.
13
14To use this code on UNIX (not Mac OS X):
15
16   1. follow the directions for the UNIX installation (in ../../sys/unix)
17      to create the Makefiles.
18
19   2. ../../include/config.h
20
21        define QT_GRAPHICS (search for it).  You can comment out
22        TTY_GRAPHICS if you want to, or leave it in to support both
23        interfaces (in which case be sure you have the right curses
24        libraries etc. required for that interface).
25
26   3. ../../src/Makefile
27
28	ensure your QTDIR environment variable was set correctly when
29	you installed Qt - $QTDIR/include/qwidget.h should exist, for
30	example.
31
32	ensure CXX and LINK are set to the compiler and linker you need
33	for compiling and linking C++ software (e.g., set both to g++).
34
35        add $(WINQTSRC), $(WINQTOBJ), and $(WINQTLIB) to WINSRC, WINOBJ,
36        and WINLIB respectively, and compile.  This will give you an
37        executable supporting both Qt and tty windowing.
38
39   4. ../../Makefile (the top-level makefile)
40
41        Just change the VARDATND setting to contain the files
42	"x11tiles", "rip.xpm", and "nhsplash.xpm":
43
44            VARDATND = x11tiles rip.xpm nhsplash.xpm
45
46   5. Follow all the instructions in ../../sys/unix/Install.unx for
47      the remainder of the installation process.
48
49   6. Consider adding the lines below to your .nethackrc, as they are
50      likely to give the best interface for this window port:
51
52        OPTIONS=name:player,number_pad,menustyle:partial,!time,showexp
53        OPTIONS=hilite_pet,toptenwin,msghistory:200,windowtype:Qt
54
55If you are using KDE, you may want to also try the KDE version. It just
56uses the KDE menubar and follows other KDE conventions - there is no
57extra functionality. To do so:
58
59   1. Ensure that you have KDE 2.x libraries on your system
60        (in 1999 KDE 1.x was the norm)
61
62   2. ../../src/Makefile
63
64      Add $(KDECXXFLAGS) to the CXXFLAGS definition, $(KDELFLAGS) to
65      the LFLAGS definition and $(WINKDELIB) to WINLIB.
66
67   3. Some additional files here - knh-mini.xpm, knh.xpm, and
68      knethack.lnk are useful if you want to install "knethack" in
69      the KDE games directory.
70
71If you are using Qtopia, you can compile NetHack for that environment
72with the following additional steps:
73
74   1. First be sure that you can build a simple Qtopia application,
75      such as the examples that ship with Qtopia. Do not attempt
76      something as challenging to compile as NetHack before you can
77      already build a Qtopia application for your target device.
78
79   2. If you are cross-compiling (eg. targetting an ARM-based handheld),
80      be sure to follow the steps for cross-compiling in the Makefile.src
81      and Makefile.utl files.
82
83   3. To CXXFLAGS in Makefile.src, add:
84      -DQWS -I$(QPEDIR)/include -fno-rtti -fno-exceptions
85
86   4. Rather than -lqt in WINQTLIB, have:
87      -L$(QPEDIR)/lib -lqpe -lqte
88
89   5. After building, use the "mkipks" program that ships with Qtopia
90      to package the result into an ipk file.
91
92To use this code on Mac OS X:
93
94   1. follow the directions for the UNIX installation (in ../../sys/unix)
95      to create the Makefiles.
96
97   2. quite a number of changes are required to the Makefiles. They are
98        slowly being made 'official', but for now they are all in the patch
99	nethack-macosx-qt.patch:
100
101	    cd ../..
102	    patch -p0 < win/Qt/nethack-macosx-qt.patch
103
104   3. Follow all the instructions in ../../sys/unix/Install.unx for
105      the remainder of the installation process (basically run "make install").
106
107   4. Consider adding the lines below to a file called "NetHack Defaults",
108      in your "Library/Preferences" folder, as they are likely to give
109      the best interface for this window port:
110
111        OPTIONS=name:player,number_pad,menustyle:partial,!time,showexp
112        OPTIONS=hilite_pet,toptenwin,msghistory:200,windowtype:Qt
113
114