Installing Amaya for MacOSX

This is a draft provided for information, and only maintained by volunteers.

Please send coments to www-amaya@w3.org - archived in public

Contents

  1. Setting up the system requirements (you have to do this first)
  2. Installing from a binary package of Amaya (easiest)
  3. Using fink to compile Amaya (easy)
  4. Upgrading Amaya via fink or apt-get
  5. Using fink unstable to get a later version (not very hard)
  6. Compiling your own (more challenging - notes are available for version 8.3 and older)

Screenshot of 6.4 (120k), screenshot of 7.1 (30k)

Setting up the system requirements

These instructions explain how to install Amaya with fink, which makes it a lot easier. They should provide enough information to install it even if you don't use fink, but comments and improvements are always welcome.

Fink, Compilers and other tools

Fink is a packaging system for OS X. It provides tools to install software originally developed as open-source Unix software, and most importantly it manages dependencies (i.e. if you want to install Amaya it will make sure libpng is installed so Amaya can run) and updates (if there is a new version of Amaya packaged, you can update to it with a one-line command or using a piece of software with a relatively simple interface).

To install fink, follow the instructions at fink's download page. Note that you will need the developer tools (in OS 10.3 they are called XCode, and are on a separate disc, not installed by default). You can also download them (after registering) from Apple's developer site. Be warned - it is around 200MB.

X11, Gtk, and friends

There are a number of things you need in order to install Amaya. The most important is X11 - the X Window system that Amaya runs under. This can be installed from Apple, or using fink.

If you are using fink you only need to decide whether to install Apple's X11 or install it as provided by fink. Once you have installed one or the other, fink will install everything else you need.

Apple's X11 beta release

Download and install both the x11 package and the Developer's kit package from Apple's X11 site

(It seems that if you use the current beta - apple's second version - you no longer need to download and run the fink repair script for Apple's X11 libraries.)

You then need to run the command:

sudo apt-get install system-xfree86

The fink-provided X11

Note: You can get away with not doing this step - fink or apt-get will normally install this automatically because Amaya lists it as a dependency.

sudo apt-get xfree86-base

will install X11. You should also install a local rootless X server (if you don't know what this means, you need to do it - if you do then you have the option of running a remote X server without installing the package)

sudo apt-get xfree86-rootless

Installing from a binary package of Amaya (easiest)

run the command

sudo apt-get install amaya

That's it. Apt-get will install several libraries that Amaya needs if you don't already have them, as well as the Amaya code itself. If you agree to everything it suggests, there should be no problems - if you have some reason for doing something differently you need to understand what you are doing. When it has done its work, you will have Amaya installed.

Alternatively, version 8.5 as a fink debian package is now available from the Amaya site. You can download that package and install it with the command

sudo dpkg -i amaya_8.5-1_darwin-powerpc.deb

Using fink to compile Amaya (easy)

Make sure you have the current package list.

fink selfupdate-cvs

Once you have set up your system requirements, run the following command to install amaya for the first time:

fink install amaya

(This will install the GTK version of Amaya, which is the standard version now. If you have installed an older version it this method should replace it.)

Fink will then download Amaya (and anything else it needs that is not already installed) and compile it

Upgrading Amaya via fink or apt-get

If you have installed Amaya 5.3 using fink or apt-get, then you can upgrade. Use the same process as for installing, but change the command install to upgrade - for example

fink selfupdate-cvs

fink update amaya

or

sudo apt-get update

sudo apt-get upgrade amaya

If you have installed amaya-gtk

Until version 6.1 there were two versions of Amaya - one relied on Motif and one relied on GTK. The GTK version was recommended, but both were available as packages. From version 7.1 the GTK version is the only one supported, so there is only one package, called amaya, and using GTK.

If you want to upgrade from amaya-gtk to a new version of amaya you should follow the instructions for installing amaya (recommended is to install amaya via apt-get, because it is quicker). This will replace your existing amaya-gtk cleanly, and in future you can upgrade amaya as usual.

If you are planing to use the fink unstable to get the latest version the instructions given below include this step.

Using fink unstable to get the latest version (not very hard)

Often you will find there is a later version of Amaya in the unstable tree. To check if this is the case, look at the entry for amaya in the fink package database.

If there is a newer version in the unstable tree and you are not generally using the unstable version of fink, you can still use fink to install the later version.as follows

First you need to update the data fink has about packages:

fink selfupdate-cvs

then tweak your local fink setup so it compiles the newer version (copy the package information, then update the index that fink uses):

sudo cp /sw/fink/dists/unstable/main/finkinfo/web/amaya* /sw/fink/dists/local/main/finkinfo/

fink index

if you have a previous version of Amaya installed with fink or apt-get, use the upgrade command

fink update amaya

if you do not have amaya installed, or if you have a package called amaya-gtk installed, use the install command

fink install amaya

(Note that from version 7.1 onwards the -gtk extension has been dropped. This is because the GTK-based package is now the default, and is the only one currently supported in fink).

Troubleshooting

If it fails because of a "failed dependency"...

Sometimes fink will refuse to install or upgrade an unstable version, giving a message like

Dependency failed (imlib-shlib >= 1.9.14)

This means that fink couldn't find a package, or a recent enough version of a package, that Amaya relies on. Usually the required package will be in the list of unstable packages (just like Amaya itself).

What you need to do is find the package, move it to the local list, rebuild the index, and then do the install or update.

As an example, on 7 May 2003 the version of Amaya in the stable package list was 7.1 and latest package available was version 7.2. Installing this version fails with the error message above.

Finding the package:

The best way is to search the fink package database for the name of the package that was not found. in the example above searching for imlib-shlib gives the fink imlib-shlib package's page. From this you can see three important pieces of information:

  1. The actual name of the package (in this case imlib-shlib)
  2. The version number available in the "current unstable" release (in this case 1.9.14-2, read as version 1.9.14 revision 2) and
  3. The section that the package is in (in this case graphics).
moving it into the local index, and rebuilding it:

This is the same process as with the amaya package. For our example, the following two commands do it:

sudo cp /sw/fink/dists/unstable/main/finkinfo/graphics/imlib-shlib-1.9.14* /sw/fink/dists/local/main/finkinfo/

fink index

(graphics in this example is the section the package is in. Other packages may be in other sections, most likely lib or X11. imlib-shlib is the name of the package, and 1.9.14 is the version number, without the revision number. The asterisk/star "*" is there to ensure that all the necessary files are copied.)

You are now ready to install or upgrade Amaya in the "normal" way with:

fink update amaya

or

fink install amaya

Compiling your own (more challenging)

Joseph Myers reports successfully compiling version 8.1b without necessarily installing fink.

The following notes are for compiling version 8.3.

First steps

As usual, I recommand that you read the instruction for compilation at http://www.w3.org/Amaya/User/Autoconf.html. The build process is unchanged, but you may need some tricks to complete a successful build.

Go to the "How to build" section and follow steps 1 and 2 :

  1. If you have downloaded a tarball, unpack it
    tar xfvz amaya-src-xxx.tgz
    cd Amaya
  2. Create a subdirectory for darwin
    mkdir darwin

Easy way (without i18n):

Step 3 is the "configure" script:
../configure --host=ppc --build=ppc --with-gtk --without-i18n

If it fails to generate Makefile, config.h and so on, you should install GNU sed from fink and retry configure.

sudo fink install sed

(Choose distfiles.opendarwin.org as mirror if needed)

Then Step 4:

In Options:

  1. verify that -D_I18N_ is removed for Amaya and Thotlib
  2. verify that -D_GTK is present
  3. verify some paths for GTK (gtk-config may forget the basic /sw/include):

And a special trick to avoid conflicts with some Apple frameworks:

In config.h:

It is important to undefine something related to APPKIT because AppKit in MacOSX is not what is expected by amaya.

So comment the following line if present:

/* #define HAVE_APPKIT_APPKIT_H 1 */

You could have to do the same in libwww/wwwconf.h

Here is Step 5:

Just gnumake it!

Additional information for Amaya >= 7.x and MacOSX > 10.0

Dark side of the i18n support:

If you really want i18n support, then be prepared to work a little more. Let's start again from step 3. Replace the configure command by this one: ../configure --host=ppc --with-gtk

Then go through Step 4 but now -D_I18N_ must be present for Thotlib and Amaya in Options file. The following instructions work for Amaya 6.4 and 7.x

Since Darwin, like BSD systems, does not have wchar support in libc, you have to use a workaround for it:

  1. cd ../thotlib/include/
    Edit ustring.h around line 55 to get:
    	#ifdef _I18N_
    	/*#include <wchar.h>  DOES NOT EXIST IN MACOSX */
    	#include <stddef.h>   /* defines BSD_WCHAR_T  */
    	typedef wchar_t  CHAR_T;
    	typedef wchar_t *STRING;
    	typedef long int wint_t;  /* was in wchar.h in other systems */
    	#else  /* _I18N_ */
    	/* don't touch anything else */
    	
  2. Now you need the corresponding functions, since they are not in libc either.If you don't have them, you'll get a bunch of undefined symbols when linking. So download these from a libc source and hack to compile them.
    No, i'm kidding. All this is done for you!libwcs is now available from fink unstable, as lib/libwcs-1.0-2.info so you can use the following three commands to install it.
    sudo cp /sw/fink/dists/unstable/main/finkinfo/lib/libwcs-1.0-2.info /sw/fink/dists/local/main/finkinfofink index
    fink install libwcs

    Or you can download the libwcs source in your /tmp. Unpack it, compile it and install it:

    tar xfvz libwcs.tar.gz
    cd wcs
    make libwcs.a
    mv libwcs.a /sw/lib
  3. Go back to Amaya/darwin/ directory
    Edit Options to complete EXTRA_LIBS with:
    	EXTRA_LIBS = -L/sw/lib -lwcs
    	

    And add an option to the cc:

    	CC  = cc -no-cpp-precomp
    	
  4. Now cd batch/
    Edit Makefile to use these EXTRA_LIBS
    	LIBS  = ../thotlib/libThotKernel.a $(EXTRA_LIBS)
    	

Now you should be able to build it:
cd ..
gmake


carine@w3.org, charles@sidar.org. Thanks to Joseph Myers and Damian Steer for compiling/packaging and reporting it. This draft $Id: amaya-darwin.html,v 1.33 2004/03/31 14:15:56 cbournez Exp $