MacPorts

Note: In November 2013, it was determined that wxWindows 2.9 is close to enabling a non-MacPorts, Mac-native GNUmed. This is being tested on MacNativeGNUmed.

MacPorts is used by at least one GNUmed user to download and manage software dependencies under Mac OS. MacPorts thereby enables

the bootstrapping and updating, on the Mac, of a GNUmed database and

to run development code and POSIX releases independently of pre-packaged (all-in-one) binary Mac installers.

Installing the GNUmed dependency psycopg2 will also install a version of the postgres database server.

If you already know all about Apple's Xcode Tools and MacPorts, you can skip down to Installing.

Caveat emptor

Apple's Macintosh computers have been making a transition between

PowerPC and x86 Intel chips

32-bit and 64-bit capable processors

32-bit (Tiger, Leopard) and 64-bit (Snow Leopard) operating systems.

and so in the case of a particular machine, its processor (32 or 64-bit capable) combined with the version of Mac OS X determines whether and how GNUmed can run under one of Apple's own APIs or (only) the more generic X11 windowing system. When last attempted in 2010, wxWidgets could only run on Mac OS under

X11

Carbon/Quartz (up to Mac OS 10.5 Leopard)

but not Cocoa

A 64-bit capable processor, running Snow Leopard, defaults to 64-bit. Any softwares desiring to use Carbon can only be built 32-bit (i.e. cannot be universal). While it is easy enough to uninstall all ports and set macports.conf build_arch to i386 to more reliably build multiple ports as 32-bit, and while this would still allow to build universal variants for ports that do not use Carbon (provided, as usual, that any port installed "universal" has all its dependencies built universal as well), python26 unfortunately does not enforce build_arch. Until this is addressed, and/or wxWidgets would in future compile 64-bit with Cocoa support, it seems that on Snow Leopard the options to run GNUmed are to run it under X11, or to run GNUmed pre-packaged as an all-in-one binary.

What are MacPorts and Pallet?

The MacPorts project is an open-source community initiative to design an easy-to-use system for compiling, installing, and upgrading either command-line, X11 or Aqua based open-source software on the Mac OS X operating system. The result: ready to build, open-source software packages modified to compile and run on Mac OS X. The MacPorts project provides a TCL command line tool to manage installation, update and activation of the port packages. Formerly "Darwin Ports", MacPorts is contrasted with an alternative project ("Fink") here. Open source tools like wget can could alternatively be installed using homebrew.

What are Apple's Xcode Tools?

These are Apple's free proprietary tools which allow various special or advanced features to be performed on the Macintosh. Ordinary Mac users seldom need these Xcode Tools whereas people who would develop or use special software on their Mac will need to do this extra installation.

While Apple's Xcode Tools do not need to be in place for every aspect of MacPorts, Xcode's tools are depended on at any point where MacPorts would, upon selfupdating need to compile a new base version of itself, or would install any of numerous ports, including a non-Mac OS version of python. Lack of an installed Xcode Tools commonly underlies the MacPorts error messageerror: no acceptable C compiler found in $PATH.

The version of Apple's Xcode Tools required by MacPorts is given here. Most likely, Xcode Tools won't have been installed until someone took deliberate steps to do so. Check for them by

in Terminal, typing open -a Xcode. If it tells you "Unable to find application named 'Xcode'" then they're probably not installed.

alternatively, in the Finder, open your startup disk hard drive, and identify the presence of a folder Developer, within which there should be a sub-folder Applications (distinct from main /Applications). Within this, you should find Xcode, if it's installed.

To identify an installed Xcode's version, you can launch it, and look in Xcode > About Xcode. Before installing newer versions, you may like to use Apple's uninstaller to remove the existing tools, like so:
sudo /Developer/Library/uninstall-devtools --mode=all

Installing Apple's Xcode Tools

Obtain Xcode Tools (~ 800 Mb) from one of:

a recent Apple-supplied Mac OS X Install DVD –

open the folder "Optional Installs", subfolder Xcode Tools

the file "About Xcode Tools.pdf" should give the version number

within this same subfolder

it is only the package XcodeTools.mpkg which needs installing

the WebObjects.mpkg is needed only for webobjects related projects and Dashcode.mpkg for those who would make Dashboard applications.

Apple's web site

check the version requirement from MacPorts install page and follow the link to the Developer Connection Member Site

if you lack a free Apple developer account, it requires only a basic registration

Installing MacPorts

Go to the MacPorts site, either to their installer instructions page or directly to their distfiles directory listing. Unless you have a reason to do otherwise, download the disk image (.dmg) file that is most suitable for your current Mac OS. It may (or may not) still be MacPorts-1.9.1-10.5-Leopard.dmg or MacPorts-1.9.1-10.6-SnowLeopard.dmg.

The package will download automatically, and you will later be prompted to accept the installation with your user account password.

Budget adequate time

Depending on your network's bandwidth and reliability, and on your computer's processing power and state of heaviness of usage, quite a bit of time (many minutes, but less than an hour) may be required for a complete, first-time install, including compile time. If you desire to devote only one of two cores to this activity in order to better use your Mac for concurrent tasks, refer to the bottom of this section.

Problems?

If after installing MacPorts you encounter a log message "port: command not found", you may have installed MacPorts from source and suitable lines may have failed to be added to the user's home directory file .bash_profile, as should have been achieved by a postflight script. Additional notes of possible help, compiled from the MacPorts guide and the users' list, are here.

Installing the PostgreSQL server

See MacPortsPostgresbut be aware that for bootstrapping Mac OS one seems to need an extra password-passing for postgres, accordingly some of the bootstrapper update files, need to uncomment #password for postgres

Notes

In aiming for Mac-native GUI, wxWidgets presently supports only Carbon not Cocoa, and Carbon supports only 32-bit architectures.

py26-wxpython

has variants carbon, gtk, universal

but also depends on python26 and wxWidgets-python

and wxWidgets-python while having variants carbon debug gtk nonmonolithic, itself depends on

expat gtk2 jpeg libiconv libpng tiff zlib

where gtk2 has variants no_x11 quartz universal x11

and so when downstream dependencies had needed variants which would neither be installed by default, nor effectively called-for by the depending software, the downstream dependencies may need to be specifically called and installed before the upstream ones e.g.

setup for GNUmed using the optional Porticus

Note: these instructions are obsoleted and require updating. Porticus is undeveloped past MacPorts 1.9 and Snow Leopard 10.6. Possibly a variation of the following will work with Pallet but this remains speculative.

Applicable to Mac OS 10.5.x Leopard. Needs fixing if running Snow Leopard. Need to check if python-select is installed as a dependency and also the resulting default version of python.

Download v 1.8.1 of Porticus (GUI to MacPorts) drop it into your main /Applications folder. On opening it, let its Preference "At startup" to "Update everything" (do a MacPorts selfupdate).

Select "All Ports" from the Porticus directory, within which to search (and install), in order:

py26-psycopg2 (Version 2.0.13_0 used) (--> 2.2.1.0)

select variants postgresql84 also universal (else without universal get an error)

Note: with each selection, Porticus will open and present a combination pending Command display and Variants selection window. Porticus suffers a small bug in which – even in the absence of Variants – the progress spinner can spin endlessly. After a few seconds, you can ignore this, and click 'Install".

It is not yet possible to fully avoid using Apple's Terminal application within your /Applications/Utilities folder. Provided you are logged into your Mac in an account of type "Admin", launch Terminal, and do (copy, paste) sudo ln -s /opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6 python

In response to having issued the sudo command, the prompt "Password:" will be for the account from which you are logged-in, not any root password.

Note there is some dependency on mesa missing from wxWidgets which will prevent completion of the py26-wxpython. Accordingly if that happens one should do : sudo port clean --all wxWidgets-python and then sudo port -d install py26-wxpython