Installing Sketch ================= These installation instructions are divided into two parts. The first part describes the third party software you need for Sketch. The second part describes the installation of Sketch itself. If you've installed Sketch before you might want to go directly to the Sketch specific instructions. If you're installing on Linux, there are some platform specific notes about necessary packages and binaries of Sketch, Python et al. at the end. Installing the third party software. ==================================== 1. Install GTK and GLib -------------------------- GTK and Glib are availe from http://www.gtk.org/. Sketch needs at least version 1.2.4. Older version will not work correctly due to a thread-related bug in 1.2.3 and earlier. 2. Install Python -------------------------- Python is available from its WWW home page: or via ftp from . See Python's documentation for installation instructions. Alternatively, you can use the rpm-packages available at http://andrich.net/python. You need at least version 1.5.1. Version 1.5 or older will not work, since Sketch uses some features only provided by 1.5.1. 3. Install the Python Imaging Library (PIL) ---------------------------------------------------- This library is available from . See the accompanying documentation for installation instructions. The installation instructions of PIL versions 1.0b1 and earlier seem to state that you have to build PIL in the Python source tree; this is not true, you can build them anywhere you like if you have a complete Python installation. One point not mentioned in the PIL installation instructions are the headerfiles (.h files). For easier configuration of Sketch I recommend to install the files the following files found the libImaging subdirectory into a directory under the Python include directory: ImConfig.h ImPlatform.h Imaging.h (e.g. if your Python include directory is /usr/include/python1.5, put them into /usr/include/python1.5/Extensions) At the moment I use release 1.0b1 (older versions should also work). 4. Install PyGTK ---------------- PyGTK, the Python bindings for GTK are available from http://theopenlab.uml.edu/pygtools/. I use version 0.6.1 at the moment. 5. Optional: Python XML package ------------------------------- This step is optional. The XML package is only needed by the SVG import filter. If you don't know what XML is or SVG, just skip this step. It is not needed for normal use of Sketch. If you want to test the SVG import filter, you can get the source of the XML package at: http://www.python.org/topics/xml/download.html Installing Sketch: ================== Like the stable 0.6.x versions, this release uses the setup.py script. If this script fails you can use the 'pedestrian' method described below. For Sketch to work with fonts you also need the font-metrics for the PostScript standard fonts. I've left them out of the development archive to save some space since they don't change. You can get these font-metrics from Sketch's webpage or from a stable Sketch version. Just copy or link the .afm files from the directory Resources/Fontmetrics of your stable Sketch or the sketch-data archive to the same directory in the development source tree. Method 1: setup.py ================== Sketch comes with a script setup.py that can be used to configure, build and install Sketch on your System. The normal way to invoke this script is: $ setup.py [options...] where is either 'configure', 'build' or 'install'. The command may be followed by options, described below. Configuration: -------------- Sketch needs to access the Python Imaging Library from C, so it needs to know where its headerfiles are. Unfortunately there's no standard place where they are installed, but if you've installed them as described under 'Install PIL' above, you can just do: $ setup.py configure If your PIL headerfiles are somewhere else, use $ setup.py configure --imaging-include= where is the appropriate directory Compilation: ------------ This is simple, if configuration was successful. Just do $ setup.py build This compiles the C-modules. Installation: ------------- As this is a development version, I'd recommend to just bytecompile the python sources with $ setup.py bytecompile and run Sketch from the build directory. Strictly speaking this bytecompile step is not really necessary, you can just start Sketch and python will automatically bytecompile the files used. The old, pedestrian Method: =========================== First, change into the subdirectory Filter. You'll find a file Setup.in. Copy that file to Setup and edit it. Follow the comments in that file. This works just like the Setup file in Python's Modules directory which you may have edited if you installed Python from sources. Now, in Filter, type: $ make -f Makefile.pre.in boot $ make You should have a file Filter/streamfilter.so now. Now, go to the Sketch/Modules subdirectory and edit the file Setup.in there. Again, if you change anything, save the file as Setup. Now, in Sketch/Modules type (you guessed it): $ make -f Makefile.pre.in boot $ make You should have a file _sketchmodule.so now (and some other .so files). Finally, go to the topmost directory and run the python script finishinst.py. This will compile the Python source files. This step is not really necessary, but sketch should start a bit faster) Starting Sketch: ================ Now you can test Sketch from the topmost directory by running $ python sketch.py or $ ./sketch.py if your Python interpreter is somewhere in your $PATH. If you want to install Sketch somewhere outside of the source tree, use the setup.py script as described above. For further information on Sketch, have a look at the ``User's Guide'', or if you're interested how Sketch is implemented or if you want to extend it, read the ``Developer's Guide''. These documents come with the stable 0.6 releases and are available on the web-site. Platform specific notes: ======================== This section only covers two Linux distributions at the moment. If you have something to add here, or if the information here is wrong (I only have access to SuSE Linux at the moment), mail me about it. Linux: ------ SuSE 6.1: --------- This is the distribution I use at the moment. Sketch works with the Python 1.5.1 that comes with the distribution. You have to install the packages python and pyth_tk and of course the packages they depend on. The Python Imaging Library is not included in SuSE Linux, but there's a binary RPM available from Sketch's web site. Red Hat: -------- To compile Sketch and the Python Imaging Library, be sure to install the python-devel package. Alternatively, you can download RPMs of Python 1.5.2 from http://andrich.net/python. In particular, you need these RPMs python-1.5.2-2.i386.rpm python-imaging-1.0b1-3.i386.rpm