Difference between revisions of "Mac OS X:Build from source:MacPorts"

From Gramps
Jump to: navigation, search
(Added xCode info)
(Installing Gramps using MacPorts)
 
(39 intermediate revisions by 7 users not shown)
Line 1: Line 1:
[[Category:Documentation]][[Category:Developers/Packaging]]
+
MacPorts is a package manager for Apple Mac providing access to thousands of open source packages. It allows you to easily install, upgrade or even uninstall software onto your Mac.
== Installing gramps for X11 using MacPorts ==
 
  
This page has been updated with information gleaned from installing gramps 3.0.4.1. from Macports onto a brand new iMac with OS X 10.5.6 on 14 March 2009.
+
==Installing Gramps using MacPorts==
  
=== Starting ===
+
Gramps version available from MacPorts is: {{version_MacPort}} ( https://ports.macports.org/port/gramps/ )
  
The MacPorts information says that you have to install X11, either from an Apple disk or from an open source version. My iMac came pre-installed with X11 out of the Apple box, so that is probably the default nowadays. In that case, no action is needed.
+
# Download and install the latest Xcode tools from https://developer.apple.com/xcode/
 +
# Download and install Macports from http://www.macports.org/install.php
 +
# Open Terminal.app from /Applications/Utilities and enter these commands:
 +
sudo port selfupdate
 +
sudo port install gramps
  
MacPorts installs everything as a superuser, using sudo. That could cause a lot of grief if it didn't work, so it is well worth while setting up the Apple Time Machine backup software before starting any of this work. With that in place, it is possible to undo any disasters more or less however bad they get. I've not needed to use it but it's a warm feeling. The Time Machine software works either with an Apple branded network drive, Time Capsule, or with a generic direct-wired USB or firewire disk plugged in the back of the iMac. I picked a generic disk, plugged it in, and the Time Machine software sprang to life and I completed the process in a couple of clicks (and several hours of writing the new disk). Well worth while.
+
If you are running a recent version of macOS / OS X (Snow Leopard, or later, at this point), much of the support software is pre-compiled and will install as quickly as it is downloaded.
  
The advice from the [[Mac OS X]] page to install [http://www.openoffice.org/ OpenOffice] first is sound. That should complete without any errors. Be aware that the running openoffice icon in the Mac dock doesn't do anything when clicked. It has to be ctrl-clicked to pop up a menu.
+
==Running Gramps==
  
[http://www.macports.org/ MacPorts] should now install successfully with a couple of clicks. I just clicked on the "leopard" link on the [http://www.macports.org/install.php install] page and it just worked.
+
Use Terminal to start gramps:  
 +
gramps
  
Before going further, it's worth finding out whether your Mac is set up for software development. open a terminal window (in finder-applications-utilities-terminal) and type in the line ended with the <CR> key
+
==Graphviz==
  
  type make
+
You may wish to install Graphviz to handle some of the graphical reports that Gramps can produce. MacPorts can provide you with either graphical or command-line based versions of either a 'stable' or 'development' release of Graphviz.  'graphviz-gui' is recommended unless you know that you have a need for the development version.  Install with:
  
and if it says
+
sudo port install graphviz-gui
  
make is /usr/bin/make
+
==Issues==
  
then all is well, but if it says
+
Please don't hesitate to create a macports [https://ports.macports.org/port/gramps/tickets ticket] if you find a problem that you believe is related to the MacPorts build process.
  
-bash: type: make: not found
 
  
then the Mac doesn't have the software development code loaded. This was the case with my new iMac straight from the store.
+
[[Category:Developers/Packaging]]
 
 
If you don't already have the software development code, you need the [http://developer.apple.com/TOOLS/xcode/ Xcode] package from Apple. This free and installs with just a click, despite its size (1 Gbyte download). However, you do have to become a member of the [http://developer.apple.com/ Apple Developer Connection] in order to get it. This too is free and can be done straight away online, but does require you to agree to a large legal contract which allows, among other things, Apple staff to enter your home. To complicate matters, I had trouble with the Apple website while applying for membership and had to try three times. However, eventually, the sign-up email came through and all was well and I could go ahead and download xCode. Succeeding in this turns the iMac into a full-fledged software development workstation. You don't actually need to develop any software -  not one line of code - to install gramps, but the MacPort software does need the software development tools to do the installation.
 
 
 
After all that (it takes a couple of hours to download and install xCode) the "type make" test above should succeed.
 
 
 
The following text here was from the orignal version of this page and was what I used to install gramps. In fact, it's out of date. A current experience is shown on the discussion page of this article, and it would have been better for me to do that instead. We should re-hash this page to make more sense, but none of us quite ahs the courage to go ahead and do it!
 
 
 
So, assuming you have MacPorts installed and updated, you might as well try:
 
<code>
 
sudo port install gramps</code>
 
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 <code>
 
port deps gramps</code>, which listed the major dependencies that gramps has. Then, I installed each separately. They are:
 
<code>
 
shared-mime-info
 
py-gnome
 
py-bsddb</code>
 
I installed them in the following order:
 
# shared-mime-info
 
# py-bsddb
 
# py-gnome (the tough one)
 
 
 
=== shared-mime-info ===
 
In order to successfully install this, I first had to run:<code>
 
sudo port install p5-xml-sax
 
sudo port install p5-xml-sax-expat</code>
 
After that, things installed smoothly
 
 
 
=== py-bsddb ===
 
This actually installed smoothly on my computer.
 
 
 
=== py-gnome ===
 
For now, I merely list the libraries and what I did to fix the problem.
 
# 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.'' --[[User:A.southern.yankee|A.southern.yankee]] 23:46, 1 May 2008 (EDT)
 
# py-orbit
 
#* This installed without any problems for me.
 
# 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 <code>sudo port install xmlto</code> 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.
 
# 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!
 
# 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!
 
#liboil
 
#* First, I ran <code>sudo port upgrade gtk-doc</code>
 
#* Then, I installed the newest version of the liboil library from [http://liboil.freedesktop.org/download/] 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.
 
# 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.
 
 
 
=== Conclusion ===
 
Those errors were the ones I ran into. I was able to get gramps to work after that, with some of the same glitches as described below.
 
 
 
== Glitches ==
 
 
 
There are some problems.
 
 
 
* 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.
 
* 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 PdfDoc.py plugin cannot be installed because ReportLab is not installed.
 
** Note, using macports, run <code> sudo port install py-reportlab </code>. This will take care of this problem.
 
** For fink, run <code>fink install reportlab-py25</code> (py24 or py23, for earlier versions of python).
 
* The LPRDoc.py 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 <code>zlib</code>  should be installed: with <code> sudo port install py25-zlib </code> all ODT output jumped into action.
 
 
 
==Starting Gramps using X11==
 
Once you have successfully installed gramps using MacPorts, you will need to make a note of where the executable is. You can do this in your terminal, by typing "which gramps" (no quotes, of course). You should make a note of this and then start X11 from the Applications folder (in my case from within the Utilities folder). Once you have an X terminal you can type the command, in my case "/opt/local/bin/gramps". If /opt/local/bin is in the PATH for X11, then you should just be able to type "gramps".
 

Latest revision as of 05:38, 24 March 2022

MacPorts is a package manager for Apple Mac providing access to thousands of open source packages. It allows you to easily install, upgrade or even uninstall software onto your Mac.

Installing Gramps using MacPorts

Gramps version available from MacPorts is: 5.1.6 ( https://ports.macports.org/port/gramps/ )

  1. Download and install the latest Xcode tools from https://developer.apple.com/xcode/
  2. Download and install Macports from http://www.macports.org/install.php
  3. Open Terminal.app from /Applications/Utilities and enter these commands:
sudo port selfupdate
sudo port install gramps

If you are running a recent version of macOS / OS X (Snow Leopard, or later, at this point), much of the support software is pre-compiled and will install as quickly as it is downloaded.

Running Gramps

Use Terminal to start gramps:

gramps

Graphviz

You may wish to install Graphviz to handle some of the graphical reports that Gramps can produce. MacPorts can provide you with either graphical or command-line based versions of either a 'stable' or 'development' release of Graphviz. 'graphviz-gui' is recommended unless you know that you have a need for the development version. Install with:

sudo port install graphviz-gui

Issues

Please don't hesitate to create a macports ticket if you find a problem that you believe is related to the MacPorts build process.