Mac OS X:Build from source:gtk-osx

From Gramps
Revision as of 06:51, 21 June 2009 by Emrys (Talk | contribs) (Page in process of creation, unfinished.)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Page in Process of Creation, Beware of Chaos!

This page tells how to build gramps and its supporting programs from source on Apple Mac OS X using the sourceforge gtk-osx project. This work is experimental and changing. It would be unwise to use this software with precious data at this time. It is hoped that, in some days or weeks (June 2009) a one-click-install packaged version of Mac gramps will become available. Meanwhile, it's still necessary to have a proper Apple development system, the xCode package, which is described at the Mac OS X MacPorts page. A system that has bult gramps with MacPorts should already have everything needed to build with gtk-osx.

One advantage of the gtk-osx Mac build is that this gramps no longer needs the Quartz Mac X11 software. That reduces complexity quite a bit. An advantage compared to Macports is that this gramps is built entirely in user space, with no admin access (root login, superuser mode) needed at all. That greatly reduces the chances of messing up the system by mistake. The python interpreter, libraries and gramps code all end up in the user files of whoever builds it, instead of embedded into the system-wide file space. Each user must have their own separate copy of gramps, but most Macs have onlyone user anyway.

There is gtk-osx documentation and jhbuild documentation but it shouldn't be necessary to read those if this page here works.

To build gramps with gtk-osx:

Set aside MacPorts and Fink

If Macports or Fink Files are in the PATH for looking up exectuables or libraries, or if shell variables have been set up by MacPorts or Fink for their specialised build methods, gtk-osx will fail in very obscure ways.

One way of avoiding any leftovers from MacPorts or Fink is to create a new user, using sytem preferences - accounts, and log in as that user. "trial" is a suitable name for the new user. That will create a new home directory /Users/trial where everything will live. User trial will not have write permission on any other user files, so cannot mess very much up. The trial account doesn't need admin privileges, so cannot even mess anything up with sudo. The symbol ~ means "my current home directory" and can be typed at the shell instead of /Users/trial (or whatever the account is called).

Get a terminal

Pop up a terminal with a command shell using Applications - Utilities - Terminal.

Get jhbuild for gtk-osx

Get and store it in the directory ~. (Move it there with the finder if it ended up on the desktop or in Downloads.) At the terminal window, give this program execute permission and execute by typing:

  • chmod +x
  • ./

The script should fetch the jhbuild code from the web. jhbuild is the tool used to control all the building here. The version fetched has been customised for gtk-osx. The script puts the code in ~/Source, and then builds the jhbuild executable. It's supposed to end up in ~/bin/jhbuild, but it seems to get stuck in ~/.local/bin/jhbuild, a hidden directory. The command ls -la shows hidden directories, which the finder cannot usually manage.

If jhbuild hasn't appeared in ~/bin, create ~/bin and link jhbuild there by typing

  • mkdir bin
  • ln .local/bin/jhbuild bin

Set up PATH to find new programs


  • PATH=~/gtk/inst/bin:~/bin:$PATH

~gtk/inst/bin is where jhbuild will put the programs it builds, including gramps. It's important that it is the first place that the system looks, at the front of the PATH, because jhbuild will also put a python there which has to be used in preference to any existing python program.

Set up the jhbuild environment


  • jhbuild bootstrap

to install a bunch of stuff from the web. A lot of text should scroll by, finishing with ** Success **.