# PfaEdit on Mac OS/X

## Building PfaEdit

If you want to build PfaEdit on Mac OS/X you have to go through certain contortions. I hope eventually to ease some of these.

(1)
  First of all you must install development tools on your Mac.
  I was not able to figure out how this should be done, but I found a fairly painful solution. I could not find any development tool package for Mac OS/X, instead I had to download the Darwin system (120Mb of binary installer from Apple), and create a Darwin system on a seperate partition.
  Then I had to make symbolic links on the Mac OS/X volume to all files on the Darwin volume in directories /usr/bin, /usr/lib, /usr/libexec.

  I'm told that Mac OS/X ships with a developer tools CD. Mine didn't. If yours did then using it is obviously a better approach.

  I'm also told that the developer tools are available by joining Apple Developer Connection, and one may do this for free. As I don't like joining stuff and I have a working system, I haven't tried this.

(2)
  Secondly you must install X.
  This appears to be a two step process itself
  1. Load the base binary distribution from XFree86, with installation instructions here and here. Make sure you include the programming package Xprog.tgz
  2. After that is installed, install the XonX binary, XDarwin1.0a2.tgz
(3)
  Thirdly you may choose to install the image libraries
  - libpng (and required helper zlib)
  - libtiff
  - libungif
  - libjpeg

  I was able to build libpng (and libz) with no trouble, but for libungif the configure script failed to produce a working Makefile, but I was able to complete the build and install manually. I did not attempt the other two libraries.

(4)
  PfaEdit's own configure script should now handle the oddities of Mac OS/X building that I'm aware of.

You may find it easier just to download my pre-built binary.

## Installing the Mac OS/X binary distribution

Before installing PfaEdit you should ensure that you have X windows up and running. This is free software available from:

1. Load the base binary distribution from XFree86, with installation instructions here and here.
2. After that is installed, install the XonX binary, XDarwin1.0a2.tgz

Then gunzip and untar my distribution

- Download pfaedit Mac OS/X executable Version: 24-Nov-2002
- Download pfaedit Mac OS/X WITHOUT X11 Version: 25-Nov-2002
  You might want this version if you aren't interested in downloading X onto your machine.
  Without X11 you will have no user interface, but you can run scripts.

It is traditional to install programs like PfaEdit under /usr/local. My mac did not come with such a directory tree, so you might not want to

    $ sudo -s
    # mkdir -p /usr/local/share/pfaedit /usr/local/bin /usr/local/share/man
    # cp *.ui /usr/local/share/pfaedit
    # cp pfaedit /usr/local/bin
    # cp pfaedit.1 /usr/local/share/man/man1
    # ^D

Edit your shell start up script (.bashrc, .cshrc, etc.) to set the PATH environment variable to include /usr/local/bin and the MANPATH variable to include /usr/local/share/man. If your shell is tcsh (or csh)

>     $ vi ~/.cshrc
>     setenv PATH /usr/local/bin:$PATH
>     setenv MANPATH /usr/local/share/man:$MANPATH

If your shell is bash

>     $ vi ~/.bashrc
>     PATH=/usr/local/bin:$PATH ; export PATH
>     MANPATH=/usr/local/share/man:$MANPATH ; export MANPATH

## Running PfaEdit on Mac OS/X

The X server (XDarwin) must be running before PfaEdit can start. XDarwin lives in the Applications folder and may be started by double clicking on it.

You may start PfaEdit either from an xterm or from a Terminal window. If you start it from a Terminal window you must first type:
$ setenv DISPLAY :0

The default window manager (twm) doesn't work well with PfaEdit when X is running in rootless mode.

PfaEdit allows the window manager to position its windows for it, and twm does this by allowing the user to click anywhere on the screen to position the upper left corner of the new window. Unfortunately unless X has a window under the location where you want the upper left corner to be Aqua will put X into the background and steal the click from X.

You can only open a window if you position it so that it's upper left corner is on one of X's already existing windows.

## Caveats for Mac OS/X

1. PfaEdit does not conform to Apple's Human Interface Guidelines

(Hexley the platypus, unofficial Darwin mascot, copyright Jon Hooper)