HOWTO Build AngbandTk on Unix

System Requirements

You need X-Windows with the MIT Shared-Memory Extension and shared-pixmap support. You must also have the libraries and headers needed to build X clients with your compiler.

You must set your monitor depth to 8, 16 or 24-bit color. No other depths are supported. Note that performance at 16-bit is much better than 24-bit, so 16-bit is preferred. With 8-bit you get the best performance and also get transparency, although the screen colors may flash due to Tk palette usage.

Your Unix system must be one which supports Tcl and Tk.

You need the Zlib compression library (headers and library).

Required Files

You need the full sources to Tcl and Tk 8.3.3 from here:
tcl8.3.3.tar.gz
tk8.3.3.tar.gz

You need these files from the YahooGroups site:
commontk-1.3-src.zip
image-1.3.zip
dbwin.zip
jamtk.zip
tclzip.zip
tkhtml.zip

You need at least one of these:
angtk-292r1-src.zip
kangtk-292r1-src.zip
oangtk-051r1-src.zip
zangtk-240r4-src.zip

Optional Files

You have 2 choices for playing sound. The sound support is fully optional, so you will want to get AngbandTk working before trying either. Only one of OpenAL or SDL is required, not both. You may want to try more recent versions of these libraries if any are available, but they may not build.

To use OpenAL you need this:
ftp://ftp.openal.org/openal-20000714.tar.gz

To use SDL Mixer, you need both of these:
SDL-1.1.4.tar.gz
SDL_mixer-1.0.6.tar.gz

Unpacking the files

You can pick any directory on your system (probably somewhere under your Home directory) to unpack the files to. We'll call this directory ROOT.

Create a directory ROOT/tcltk8.3.3. Extract tcl8.3.3.tar.gz and tk8.3.3.tar.gz into this directory. This will create two directories called tcl8.3.3 and tk8.3.3.

commontk-1.3-src.zip: Unpack into ROOT. This creates a directory CommonTk.
dbwin.zip: Unpack into ROOT. This creates a directory dbwin.
jamtk.zip: Unpack into ROOT. This creates a directory JamTk.
tclzip.zip: Unpack into ROOT. This creates a directory TclZip.
tkhtml.zip: Unpack into ROOT. This creates a directory TkHTML.

image-1.3.zip: Unpack into ROOT. This creates a directory CommonTk-1.3.
Move the CommonTk-1.3/tk/image directory into CommonTk/tk.

angtk-292r1-src.zip: Unpack into ROOT. This creates a directory AngbandTk.

You should now have a directory layout like this:

ROOT/
    CommonTk/
    dbwin/
    JamTk/
    TclZip/
    TkHTML/
    tcltk8.3.3/
        tcl8.3.3/
        tk8.3.3/
    AngbandTk/

Build Tcl and Tk

This is the easiest part, using Configure and Make. The reason for the tcltk8.3.3 directory is to keep all the installed Tcl files separate from the rest of your system. This should avoid conflicts with any other versions of Tcl on your system.

Enter the tcl8.3.3/unix directory, and enter these commands at the command prompt:

    ./configure --prefix=ROOT/tcltk8.3.3
    make
    make install

Replace ROOT with the full pathname of that directory. On my system this is:

    ./configure --prefix=/home/tnb/tcltk8.3.3

Now enter the tk8.3.3/unix directory, and enter these commands (Yes, they are the same as for Tcl).

    ./configure --prefix=ROOT/tcltk8.3.3
    make
    make install

There should now be four new directories under ROOT/tcltk8.3.3/ -- bin, lib, include and man -- where Tcl and Tk are installed. Do not rearrange or rename any of these files, or move them anywhere else.

Using JamTk

JamTk is a GUI project builder I hacked together just for building AngbandTk on Linux. Jam is a build tool I prefer to use instead of Make, and Jam is used by JamTk to build AngbandTk etc. Start JamTk using the ROOT/tcltk8.3.3/bin/wish8.3 program:

cd ROOT/JamTk
ROOT/tcltk8.3.3/bin/wish8.3 main.tcl

Take a look at the main.sh file for an example of doing this with a shell script. It is very important to always start JamTk using the version of wish you built above. You could add the ROOT/tcltk8.3.3/bin/ directory to your PATH if you wanted.

JamTk should be a no-brainer to use, although 100 things could go wrong, ha-ha. The basic idea is to choose a project from the Project menu and click the Build button (or type Control+B). The first project you need to build is called JamTk.

Be sure to read the messages in the main window. If you find a problem you can't fix, save the output with the "Save As..." menu entry and send an email to the mailing list (angbandtk@yahoogroups.com).

Build AngbandTk

If by some miracle all that worked, you are now ready to build AngbandTk. Choose AngbandTk from the Project menu and click the Build button. This will automatically build all the projects required to build (and run) AngbandTk. See below if you want sound support.

Running AngbandTk

Just run AngbandTk/angband without any arguments. There are some problems with the X window manager which is the reason some windows jump all over the screen. You should run AngbandTk in a terminal window so you can catch any messages it prints out.

Sound - OpenAL (optional)

AngbandTk can use the OpenAL sound library. Create a directory ROOT/openal. Extract openal-*.tar.gz into ROOT/openal.

    cd ROOT/openal/openal/linux
    ./configure --prefix=ROOT/openal
    make
    make install

This will build and install libopenal.so in ROOT/openal/lib. Choose "Sound (OpenAL)" from the Project menu and click the Build button. When you run AngbandTk, click the Setup button and choose OpenAL for sound.

Sound - SDL Mixer (optional)

AngbandTk can use the SDL Mixer sound library. Create a directory ROOT/SDL. Extract SDL-*.tar.gz and SDL_mixer-*.tar.gz into ROOT/SDL. Now build and install them:

    cd ROOT/SDL/SDL-1.1.4
    ./configure --prefix=ROOT/SDL
    make
    make install
    cd ROOT/SDL/SDL_mixer-1.0.6
    ./configure --with-sdl-prefix=ROOT/SDL --prefix=ROOT/SDL
    make
    make install

Choose "Sound (SDL)" from the Project menu and click the Build button. When you run AngbandTk, click the Setup button and choose SDL for sound.

Problems?

Send any comments and problem reports to the mailing list angbandtk@yahoogroups.com. Any patches needed for your system are also welcome.