Talk:Mac OS X:Build from source:MacPorts

From Gramps
Jump to: navigation, search

It's gotten easier

Updated the main page, WCT Feb 2013. Info was completely out of date and misleading. Next step should be to delete most of THIS page.

I think this page may change drastically as MacPorts corrects its bugs. I've finally gotten GRAMPS installed from MacPorts on OSX 10.4.11 and it was a lot easier than in the article. I don't know whether I should replace this article, or just put in a new dated section. Here were my steps; they will need to be elaborated for a wider audience.

1. Started with a clean MacPorts install (that is, I completely deleted /opt/local). It might suffice to update everything instead, but I wanted to be safe. If you're already using MacPorts then you might want to try updating all out-of-date packages first.

2. "sudo port install gtk2" (It might not be necessary to do this first, but it's what I did and it worked.)

3. "port activate -f python25" because the previous command stopped in the middle of the process, saying that it couldn't install python25.

4. "sudo port install gtk2" again to finish installing gtk2.

5. "sudo port install gramps" which finished without a hitch.

6. Type "launchctl load /Library/LaunchAgents/org.freedesktop.dbus-session.plist" into the terminal. This is necessary for the package dbus to work, and it actually tells you to do it back in the many pages of output from the installation, but of course you probably weren't watching the installation.  :) Make sure that you DON'T put sudo in front of this.

7. Run GRAMPS from X11/

--Lihtox 18:57, 4 February 2009 (UTC)

I wish I'd read this page!

I installed gramps on a brand new iMac with OSX 10.5.6 on 14 March 2009 by reading the article at this page without ever reading the discussion. Life would have been a lot easier if I'd read the discussion page first!

I'm not brave enough, just like the last user, to edit the article to remove the hints directly. I will edit the article to add some other things I had to do, though. Emrys 12:31, 19 March 2009 (UTC)

Old stuff removed from article

Copied here in case it's useful to anyone, but I think it probably belongs on a mailing list or somebody's blog rather than a how-to article.

--Richardsmith 06:45, 29 July 2009 (UTC)

This is what used to happen

So, assuming you have MacPorts installed and updated, you might as well try: sudo port install gramps Now, if you're like me and didn't have GNOME or anything like that installed, calling that command will attempt to go through all of the dependencies and install them all. This will take a while, and you might be at this installing gramps for a couple hours (there are a lot of dependencies)

What I did instead was run port deps gramps, which listed the major dependencies that gramps has. Then, I installed each separately. They are: shared-mime-info py-gnome py-bsddb I installed them in the following order:

  1. shared-mime-info
  2. py-bsddb
  3. py-gnome (the tough one)


In order to successfully install this, I first had to run: sudo port install p5-xml-sax sudo port install p5-xml-sax-expat After that, things installed smoothly


This actually installed smoothly on my computer.


For now, I merely list the libraries and what I did to fix the problem.

  1. py-gtk2
    • I had to make sure to upgrade expat. After that, it installed fine.
    • I had a real difficulty getting this to fully install. It kept choking on Cairo. After updating XTools to 2.5, Cairo installed without a problem. --A.southern.yankee 23:46, 1 May 2008 (EDT)
  2. py-orbit
    • This installed without any problems for me.
  3. libzvt
    • This package needs "dbus" which in turn needs "xmlto". It appears, however, that "xmlto" is not listed as a dependent of "dbus". Hence, I ran sudo port install xmlto by hand. This installed without any problems on my computer.
    • After installing that, and upgrading gtk2 (do this first), this seems to be installing correctly.
  4. gnome-desktop
    • This was the next problem for me. I installed p5-libxml-perl, p5-xml-simple, py-xml by hand, cleaned gnome-desktop, and then tried the installation again. Worked fine!
  5. gstreamer
    • This was the next problem for me. I installed p5-xml-libxslt, py-libxslt by hand, cleaned gstreamer, and then tried the installation again. Worked fine!
  6. liboil
    • First, I ran sudo port upgrade gtk-doc
    • Then, I installed the newest version of the liboil library from [1] and then tried to make the liboil library again. (From the manual download). This worked. I would assume it would work for the port version as well.
  7. nautilus
    • This was the last problem for me. To get around the error, I had to create a soft link for the libintl.3.dylib file in my /opt/local/lib/ directory.

And this is another error message that happened in March 2009

When I did

sudo port install gnome-desktop

I saw

Error: Target org.macports.activate returned: Image error: /opt/local/bin/nosetests
is being used by the active py-nose port. Please deactivate this port first, 
or use the -f flag to force the activation.
Error: The following dependencies failed to build: py25-gnome py25-gtk py25-cairo 
py25-numpy py25-nose py25-gobject py25-orbit startup-notification xorg-libsm xorg-libice
Error: Status 1 encountered during processing.

and I have no idea what it means or what deactivating a port implies. I typed

sudo port -f install gnome-desktop

and got

Registry error: py25-nose @0.10.4_0 already registered as installed. 
Please uninstall it first.

so I typed

sudo port uninstall py25-nose
sudo port -f install gnome-desktop

and that seemed to work. Goodness knows what chaos I caused!


As well as OpenOffice, Graphviz is needed to view reports. You have to download and install this separately from gramps but it's a simple click-to-install procedure. Once it's installed, the graphviz application appears in finder - applications, and running that gives a menu bar that allows the file to be opened and displayed. The command line version of graphviz, dot, documented at the graphviz website, works too.


It seems that the missing packages that one may trip over when installing via MacPorts vary depending on just who has last modified all the installation scripts. There may be some; it's easy to fix by guesswork; it's odd that the computer doesn't just go ahead and fix them by itself because it sure does everything else! In fact the whole process of installing xCode and MacPorts and then gramps is an astonishing tour de force and a tribute to the good architecture of the Linux and unix software development system. But it is scary!


There are some problems. An update of Mac OS X on about 15 May 2009 changed gramps's behaviour in several ways, too. Presumably, these changes are the results of fixing bugs in the Apple X11 implementation. After 15 May 2009, this was "XQuartz 2.1.6 (xorg-server 1.4.2-apple33)", running on Mac OS X 10.5.7; this program annoyingly broke copy-and-paste. Now, on 9 Jun 2009, without any action on my part, my iMac changed to "XQuartz (xorg-server 1.4.2-apple42)". That added more tabs to the X11 preferences screen. The new "X11 - Preferences - Pasteboard" screen selects various functionality in the convoluted copy-and-paste system used for running X11 linux applications on Mac OS. I ticked all boxes on that screen except "Update Pasteboard immediately when new text is selected" and copy and paste worked again between Gramps and other Mac applications.

  • Following the 15 May 2009 update, the font used in the gramps window is too large and too bold for convenience.
  • Gramps on Mac uses ctrl-x, ctrl-c, ctrl-v for cut, copy, paste. The standard for mac programs, including X11 programs, is cmd-x, cmd-c, cmd-v. To make paste work between other mac programs and gramps, set the X11 pasteboard preferences as described above
  • Before 15 May 2009, Some text pasted in - notably the contents of a cell from an Openoffice spreadsheet, but possibly other as well - had an <LF> character at the end, unexpectedly. After 9 Jun 2009, pasting text from openoffice to gramps works fine, with no spurious <LF>, but it's no longer possible to <copy> an openoffice spreadsheet cell and <paste> it direct into gramps. Instead, you have to first <copy> the cell in openoffice, then use openoffice - edit - paste-special - to paste the text (not the formula) into another openoffice cell. Then click on that cell and the text pops up in the openoffice edit box. Select that text and you can <copy> it in openoffice. Then <paste> it in Gramps, and that works. (Pity, pasting the cell used to work, except for the LF!)
  • Double clicking an image in the media reference editor doen't bring up an external viewer to show the picture full size. In fact, there seems to be no way to do this from within gramps on Mac.
  • Switching to another user, using the OS X fast user switching feature, gramps can mess up the display on returning to the original user. The cure is to quit gramps and restart it.
  • It is not possible to start Gramps by double clicking on a Mac OS icon, nor by double clicking on a Gramps database that is associated with the application. (It should be possible to create an installation that allows this, just as it is available for OpenOffice).
  • The plugin cannot be installed because ReportLab is not installed.
    • Note, using macports, run sudo port install py-reportlab . This will take care of this problem.
    • For fink, run fink install reportlab-py25 (py24 or py23, for earlier versions of python).
  • The plugin cannot be loaded because the python bindings for GNOME print are not installed.
  • Spell checking does not work (on starting Gramps, an error warning "Spelling checker is not installed" appears on the xterm). The python "bindings for [GNOME print and spell checking] are probably in fink's gnome-python2-desktop-py24 and gnome-python2-extras-py24 packages. Or would be, if fink had them at all, which we don't. They are only viable for for newer versions of gnome itself than fink presently has, or have other dependencies that are not yet satisfiable within fink. We're working on it".
  • All ODF (ODT) output failed with a "Could not create file" error on an Gramps installed via Macports as described above, on a 'virgin' Mac. Benny Malengier forwarded the suggestion from guylinton that zlib should be installed: with sudo port install py25-zlib all ODT output jumped into action.

In the past the following have been noted on Mac systems, but they worked fine when I tried them:

  • Help does not work (clicking Help or FAQ etc on the Help menu does nothing).
  • 'Enter' or 'return' does not act as OK for closing windows (the button has to be pressed with the mouse). However Esc does work to exit from the window.
  • The browser and email links under the help menu do nothing.
  • Before the 15 May 2009 update: Little popup yellow help notices notices which are supposed to appear when you hover over a button do appear, but do so even when the gramps window isn't in focus and there's a window from another application covering it up. After the 15 May 2009 update, this seems to be fixed, and popup notices only appear when the gramps window is in focus.