sampledoc

MacPorts Inkscape + Textext Howto

(by Brian Clarke)

This document describes how to get Inkscape up and running on Mac OS X 10.5 (Leopard) using MacPorts. It may work with other versions of Mac OS X; I am not able to test this.

DISCLAIMER: I make no guarantee that this will work, and cannot be responsible for anything that happens to your computer as a result of you trying to install Inkscape via this guide. I am a relatively new user to Inkscape and MacPorts and have written this simply as a convenience for other newbies and to help them get past the difficulties I encountered. In addition, this file was written based on the situation at a particular time (Feb 2008). By the time you read it, it could be outdated.

ACKNOWLEDGEMENTS: Most of this was culled together from comments on the MacPorts bug tracking server. So thanks to everyone who contributed there.

PREREQUISITES: I’ll assume that you’re at least somewhat familiar with the UNIX underpinnings of OS X, in particular, you should know how to use the Terminal, a text editor (for plain text files) and the command “sudo”.

The first thing you need to do is to get MacPorts installed. To do this, follow the instructions on the Macports website:

http://www.macports.org/

Once this is installed, you’ll need to install the port called “inkscape”. Normally, you would do this by simply issuing the command:

sudo port install inkscape

in the Terminal, then getting yourself a cup of coffee (or five) while waiting for it to compile.

Unfortunately, the current port of inkscape has a bug that causes the installed executable to hang and eat up 100% of your processor cycles. The problem seems to be with the boehmgc 7.0, which is used by MacPorts to build Inkscape. There is no problem with boehmgc 6.7, though, so we’re going to hack the inkscape portfile to use boehmgc 6.7.

We need to create a local portfile for boehmgc 6.7, since it’s not part of the current MacPorts distribution. So first, create a directory called “ports” (without the quotation marks) in your home directory. In that directory, create a directory “devel”, and in that directory, create a directory “boehmgc67”.

Now, enter the “boehmgc67” directory and use your favorite text editor to create a text file called “Portfile”. The contents of that file should be the following (not including the dashes at the top and bottom):

# $Id $

PortSystem 1.0
name                boehmgc67
version             6.7
categories  devel
maintainers waqar@macports.org
description Boehm-Demers-Weiser conservative garbage collector
long_description   The Boehm-Demers-Weiser conservative garbage collector \
               can be used as a garbage collecting replacement for C \
               malloc or C++ new. It is also used by a number of \
               programming language implementations that use C as \
               intermediate code.
set d_name      gc
homepage        http://www.hpl.hp.com/personal/Hans_Boehm/${d_name}/
platforms   darwin
master_sites        ${homepage}gc_source/
distname    ${d_name}${version}
checksums   sha1 22d7f81bf141bd1df8fe7a692e80b03754717498
configure.args  --with-threads=posix \
            --enable-parallel-mark \
            --enable-cplusplus

variant redirect {
    configure.args-append  --enable-redirect-malloc
}

platform darwin 8 {
    configure.compiler      gcc-4.0
}

platform darwin 9 {
    configure.cflags-append -D_NONSTD_SOURCE
}

test.run    yes
test.target check

livecheck.check regex
livecheck.url   ${master_sites}?C=M&O=D
livecheck.regex ${d_name}-(\\d+(?:\\.\\d+)*)

This file tells the “port” command how to download, build and install boehmgc 6.7. But we still need to make sure the port command knows about it, so we change to the “~/ports” directory and run the command:

portindex

Assuming this goes well, it should output something like:

Creating software index in /Users/yourusername/ports
Adding port devel/boehmgc67

Total number of ports parsed:     1
Ports successfully parsed:        1
Ports failed:                     0

Now that “port” knows about our local portfile, we need to create a “variant” of the Inkscape package that uses boehmgc67 instead of boehmgc.

The portfile for Inkscape is located in the excessively long-named directory:

/opt/local/var/macports/sources/rsync.macports.org/release/ports/gnome/inkscape

Edit the file “Portfile” (you’ll need to do this as root to be able to save your changes) and add this lines (again, without the dashes at the top and bottom):

variant boehmgc67 {
    # uses boehmgc 6.7 instead of boehmgc 7.0
    depends_lib-delete port:boehmgc
    depends_lib-append port:boehmgc67
}

I added these below the other bracketed expressions involving variants and before the lines involving “post-patch”. I don’t know if this is necessary, though.

Now that this is all set up, we are ready to install Inkscape. Do this with the command:

port install inkscape +boehmgc67

Now, go get yourself a cup of coffee (or five), as this can take quite some time. When it’s done, though, you should have a working copy of Inkscape, which you can launch by simply entering the command “inkscape” into the Terminal. (On OS X versions previous to Leopard, you’ll have to do this in an xterm.)

If any problems arise during the install process, consult the MacPorts TracTicketing page and search for the error you get:

http://trac.macports.org/projects/macports/search

Otherwise, happy drawing!


MacPorts Textext Howto

(by Brian Clarke)

This document describes how to get Textext up and running on Mac OS X 10.5 (Leopard) using the MacPorts version of Inkscape. It may work with other versions of Mac OS X; I am not able to test this.

DISCLAIMER: I make no guarantee that this will work, and cannot be responsible for anything that happens to your computer as a result of you trying to install Textext via this guide. I am a relatively new user to Inkscape and MacPorts and have written this simply as a convenience for other newbies and to help them get past the difficulties I encountered. In addition, this file was written based on the situation at a particular time (Feb 2008). By the time you read it, it could be outdated.

PREREQUISITES: I’ll assume that you’re at least somewhat familiar with the UNIX underpinnings of OS X, in particular, you should know how to use the Terminal, a text editor (for plain text files) and the command “sudo”. Also, I’ll assume that you’ve installed Inkscape via MacPorts (e.g., by using the guide above). You could in theory also install the .dmg package from the Inkscape website, but you’ll then have to somehow set up your environment so that Inkscape uses the right version of Python and that it finds the necessary files. You also need to have a working TeX distribution.

If you don’t have MacPorts installed, you can do this by following the instructions on the MacPorts homepage:

http://www.macports.org/

Once MacPorts is installed, you can use it to install the dependencies for Textext. This is done by simply entering the command:

sudo port install py25-gtk py25-xml pstoedit

(or for Textext >= 0.4)
sudo port install py25-gtk py25-lxml pstoedit

into Terminal. You’ll be prompted for your login password, and then MacPorts will get to work installing the software. Presumably everything will go fine; if problems arise, search the MacPorts bug database at:

http://trac.macports.org/projects/macports/search

Now, assuming everything went okay, we’re ready to install Textext. If you’ve run Inkscape before, you should have a directory named ”.inkscape” in your home directory. If not, you’ll need to create this. Inside the ”.inkscape” folder, create another folder called “extensions”. This is where we need to install Textext’s files.

Download Textext from:

http://www.iki.fi/pav/software/textext/

After unpacking the archive, you’ll have a folder called “textext-X.Y.Z”, where X.Y.Z is the version number. Move all of these files to the folder you created, “~/.inkscape/extensions/”.

Now, open Inkscape (e.g., by running the command “inkscape” in Terminal), and you can access Textext through the “Effects” menu. After you enter your LaTeX and hit “OK” you may get some kind of gtk error. This seems to be harmless, though, so just click it away and enjoy the new LaTeX in your Inkscape drawing.