Open main menu

Gramps β

Changes

Mac OS X:Build from source:gtk-osx

821 bytes added, 17:41, 21 June 2009
fixed some bugs, still not finished
====Get jhbuild for gtk-osx====
Get [http://downloads.sourceforge.net/sourceforge/gtk-osx/gtk-osx-build-setup.sh get-osx-build-setup.sh] 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 getgtk-osx-build-setup.sh* ./getgtk-osx-build-setup.sh
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.
* mkdir bin
* ln .local/bin/jhbuild bin
 
Problem: the following messages have been seen at least twice.
Initialized empty Git repository in /Users/trial/Source/jhbuild/.git/
fatal: The remote end hung up unexpectedly
Rerunning the script eventually fixed it. It's probably a problem with the server that delivers the source.
 
Problem: help, it's all hung up while downloading. The servers that provide the downloads for all this could be more reliable. They can hang up, literally, for hours. However, eventually, they start up again. Usually, there is no problem.
====Set up PATH to find new programs====
====Define the Patches Gramps needs for Mac====
Gramps hasn't traditionally been developed for Mac, so some things don't quite work right out of the box. jhbuild can apply patches to code after it ahs been downloaded and before it has been built, which is very handy. It does this with the patch utility. jhbuild looks for the patch files, that drive the patching process, in the directory ~/Source/jhbuild/patches. Again, I should like to provide the file to download, but don't know how to do that, so paste this text into the file ~/Source/jhbuild/patches/gramps-3.1.2.patch.
--- configure.orig 2009-06-20 20:17:18.000000000 +0100 +++ configure 2009-06-20 20:19:28.000000000 +0100 @@ -6514,7 +6514,8 @@ # Do not import gtk.glade, this can raise a RuntimeError if the # display cannot be opened. Just search it. import imp - imp.find_module('gtk/glade') + # imp.find_module('gtk/glade') # does not work on Mac + imp.find_module('glade',[imp.find_module('gtk')[1]]) # Does work on Mac and also on Linux out("gtk.glade") except ImportError: out("NO") --- src/Utils.py.orig 2009-06-21 16:07:43.000000000 +0100 +++ src/Utils.py 2009-06-21 16:09:22.000000000 +0100 @@ -1134,8 +1134,12 @@ ErrorDialog(_("Error Opening File"), str(msg)) else: search = os.environ['PATH'].split(':') + if os.sys.platform == 'darwin': + utility = 'open' + else: + utility = 'xdg-open' for lpath in search: - prog = os.path.join(lpath, 'xdg-open') + prog = os.path.join(lpath, utility') if os.path.isfile(prog): os.spawnvpe(os.P_NOWAIT, prog, [prog, norm_path], os.environ) return
This gobbledegook fixes two problems.
python is /usr/bin/python
====Build some more environment====
Type(one line at atime, with a long gap inbetween)
jhbuild build meta-gtk-osx-bootstrap
jhbuild build meta-gtk-osx-core
There will be a whole pile of warnings on the terminal from which gramps was started about deprecated functions. These annoying messages can be ignored. There probably will be a message about a missing spellchecker, which can also be ignored (although it is true).
 
Whenever starting gramps in the future, it is important that PATH searches ~/gtk/inst/bin first, to find the right python.
 
There are some bugs, listed at [[Mac gtk-osx port bugs]]. Please add new bugs you find there.
57
edits