Open main menu

Gramps β

Changes

Mac OS X:Build from source:Application package

1,434 bytes added, 15:12, 16 May 2013
Update instructions for Gramps-4.0 & SVN trunk
Building Gramps from scratch is useful to produce a version not currently available as a binary (for example, a PPC version) or to produce a complete environment for debugging and further development, including debugging of all the C libraries Gramps uses, like gtk.
This is a command-line process. It's not too difficult, but you'll be using Terminal.app, not XCode. Unfortunately, Gtk has so far resisted efforts to get it to successfully cross-compile PPC on Intel or vice-versa, so the whole process must be repeated on machines of each architecture. '''''WebKit will N.B. This procedure has not build on been tested against OS X 10.4 (Tiger) or earlier systems, nor will it build against a 10.4 SDK. You must Some packages may not be running 10compatible with that very old version of OS X.5 (Leopard) or newer for this procedure to succeed!''''' You'll need XCode, Apple's development environment. There's a copy on your OS X distribution DVD, or you can download the latest version from [http://developer.apple.com/technologies/xcode.html Apple], though you must register as a Mac developer. For Lion/Mountain Lion users, XCode is available for free from the App Store.
Next, read [http://live.gnome.org/GTK%2B/OSX/Building the build instructions for Gtk-OSX], '''''especially the Prerequisites'''''. Download and run the [http://git.gnome.org/browse/gtk-osx/plain/gtk-osx-build-setup.sh gtk-osx-build-install.sh] script, which will set up jhbuild for you.
''It's important that jhbuild is not confused by any existing MacPorts or Fink installation.'' For this reason, it can be convenient to create a new Mac User account and log in to that accountif you have either of those installed.
If you are building for distribution, you'll need to set up your build system to build for Leopard (OS X 10.5) and later. For those using Leopard or Snow Leopard, this is straightforward: Just set up for SDK 10.5 in .jhbuildrc-custom. With more recent OS X versions, you'll need to [https://live.gnome.org/GTK%2B/OSX/Building#Installing_XCode_3_on_XCode_4_systems use Xcode 3].
jhbuild is installed in ~/Source/jhbuild, and produces a binary which appears in ~/.local/bin. You'll want to add ~/.local/bin to your path:
export PATH=~/.local/bin:$PATH
 
==== Gramps 3.x ====
Next, you'll need to get a local copy of the gramps mac configuration stuff from svn (if you already have a gramps svn sandbox, then skip this step and substitute the path to it where appropriate below). This varies by version. For the current release branch at the time of this writing:
svn co https://grampssvn.svncode.sourceforgesf.net/svnrootp/gramps/code/branches/maintenance/3.4gramps34/mac gramps-mac 
That will make a current copy from the repository in your current directory, which we'll assume to be ~.
jhbuild --moduleset=~/gramps-mac/gramps.modules build meta-gtk-osx-bootstrap berkeleydb python meta-gtk-osx-core meta-gtk-osx-python gramps
jhbuild by default puts everything it is building in ~/gtk (controlled by the hidden files ~/.jhbuildrc and ~/.jhbuildrc-custom ). ~/gtk/source contains the downloaded sources, and ~/gtk/inst contains the built libraries and applications. More is built than is needed Not everything that this procedure builds will be included in the final Gramps application - for example, the bundle; there are some intermediate dependencies and build tools that are themselves builtnecessary for building everything but not required at runtime. ```That doesn't mean that some modules can be skipped.```
At this point, you can do
Once you've done this once, you can generally get away with just running
jhbuild --moduleset=~/gramps-mac/gramps.modules build meta-gtk-osx-core meta-gtk-osx-freetype meta-gtk-osx-python gramps
to update everything that has been changed since the previous build. Most of the time nothing will have changed except gramps itself.
If you want ==== Gramps 4.0 and SVN Trunk ==== Gramps 4.0 is updated to build use the Gtk+-3 series for its GUI. This requires a couple of changes. Checkout the svn trunk, you should use appropriate branches of the trunk setup files: svn co httphttps://sourceforgesvn.code.sf.net/p/gramps/code/HEADbranches/maintenance/gramps40/mac gramps-macor svn co http://svn.code.sf.net/p/gramps/treecode/trunk/mac/ gramps-mac-svnand a different set The list of targetschanges to reflect using Gtk+-3: jhbuild --moduleset=~/gramps-mac/gramps.modules build meta-gtk-osx-bootstrap meta-gtk-osx-freetype meta-gtk-osx-gtk3 berkeleydb4.8 python2.7 berkeleydb python meta-gtk-osx-python-gtk3 gramps-svnShould you want both installed, you'll need to set up separate prefixes in Note that for Gramps-4.jhbuildrc-custom; gramps doesn't version its installations0, so the most recent will overwrite the previous buildlast module is <tt>gramps</tt> rather than <tt>gramps-svn</tt>.
== Gramps 3Should you want more than one version installed, you'll need to set up separate prefixes in .jhbuildrc-custom; gramps doesn't version its installations, so the most recent will overwrite the previous build.3 and EXIF Editing ==
==== .jhbuildrc-custom ====It's annoying and error-prone to type the long list of modules every time you want to build gramps, so you may want to modify <tt>~/.jhbuildrc-custom</tt> to declare the <tt>moduleset</tt> and <tt>modules</tt> variables. Note that <tt>.jhbuildrc-custom</tt> is a Python file that is loaded and executed by <tt>jhbuild</tt>, so you can make it quite complex. Do beware that defining new global variables will elicit a warning from <tt>jhbuild</tt> so be sure to prefix any top-level variables with '_'. == Gramps 3.x and EXIF Editing == Gramps 3.3.0 introduced a new module, EXIF Editing, which has two tricky dependencies, which that JHBuild doesn't know how to handle yet. Thanks to Gtk+-3, these have been replaced in Gramps-4.0 (and trunk) with a module that JHBuild can build, so ```these instructions apply only to Gramps-3.x```. In order to evade the persnickityness of jhbuild's dependencies, they're given as "soft" dependencies -- you have to add them to your modules list. If you don't, Gramps will still build fine, you'll just get a warning notice about Exiv2 not being installed.
'''Warning:'''Boost-python will not successfully build with either the 10.6 (Snow Leopard) or 10.7 (Lion) SDKs. With 10.7 it won't build at all; with 10.6, it will build but will crash Python on import. Consequently you can't build EXIF editing using Lion, since earlier SDKs are not available.
Quit the shell and pick "2" a few more times to move on to the next module.
=== Webkit ===
Gramps has an optional dependency on WebKit, which is used for the <tt>html-renderer</tt> add-on. If for some reason you want to use this add-on, add <tt>WebKit</tt> to your list of dependencies but be aware that it take a long time to build.
'''''WebKit will not build on 10.4 (Tiger) or earlier systems, nor will it build against a 10.4 SDK. You must be running 10.5 (Leopard) or newer for this procedure to succeed!'''''
== Bundling ==
The next step is to create an application bundle. You'll need gtk-mac-bundler, so follow the instructions in the [http://live.gnome.org/GTK%2B/OSX/Bundling Gtk-OSX Wiki] to download and install it.
Now open a jhbuild shell and run the bundler:
jhbuild shell
chmod +w $PREFIX/lib/libpython2.67.dylib
gtk-mac-bundler ~/gramps-mac/gramps.bundle
Good Luck!
 
'''Note:''' The 3.1.2 installer left out two files:
#''_strptime.py''. You can get the file from [http://www.gramps-project.org/bugs/view.php?id=3177 here].
#''keysyms.py''. You can get the file from [http://www.gramps-project.org/bugs/view.php?id=3157 here].