Overview

The GNUmed client is envisioned to be made available to Mac users in two forms:

  1. for demonstration and examination purposes, a binary package within a downloadable, mountable disk image (.dmg file) is believed suitable.
  2. for production purposes, it is believed wiser for the Macs to be reconfigured with all GNUmed-native dependencies satisfied, thus enabling client code to run more flexibly.

The remainder of this topic is divided into the following sections:

  • Python on the Mac
  • temporary: Modifying the 0.2.8.3 disk image for Tiger (OS X 10.4)
  • How to create a Mac OS X dmg package

Python on the Mac

Python comes pre-installed on Mac OS X but, due to Apple's release cycle, it's often one or even two years old. Apple's python may have been further customized and might be required for the system to even function properly, and must therefore never be removed. Instead, Apple makes it possible to install additional Frameworks alongside any native ones. Apple-shipped frameworks reside mostly in /System/Library, with third-party frameworks (like HP's) living typically in /Library.

To identify the version(s) of python, open the application /Applications/Utilities/Terminal, thus opening up a command line, and issue the commands:

  • ls /System/Library/Frameworks/Python.framework/Versions/ which, on OS X 10.5.x (Leopard), should yield
    2.3 2.5 Current
  • ls /Library/Frameworks/Python.framework/Versions/ may show certain other (versions of) installed pythons, like MacPythons:
    2.4 Current
  • ls with the option -al will resolve and display the symlink nature (and target) of Current.

To identify more specifically the current default version of python, issue sudo python -v (or python after which exit with Control D or exit()). An unadulterated OS X 10.5.x (Leopard) should show Python 2.5.1 (r251:54863, Jun 17 2009, 20:37:34) …. Where more than one python "Current" exists, precedence is governed in the system environmental variable PATH (echo $PATH).

More about Python on the Mac is at MacPython where you can also find referenced other python distributions for the Mac. It may be helpful to know that the porting project Fink typically installs in /sw whereas MacPorts (formerly Darwin Ports) installs in /opt.

Modifying the 0.2.8.3 disk image for Tiger (OS X 10.4)

  • Tiger ships python 2.3 by default. That needs to be upgraded to python 2.4. Package can be gotten from here
  • Egenix mxtools are needed from here
  • Xcode 2.4.1 for Tiger can be gotten from Apple
  • for Leopard you can use Xcode 3.0.1 and higher
  • PostgreSQL 8.3.7 for Mac from EnterpriseDB can be gotten here
  • Psycopg2 2.0.12 can be gotten from here

  1. Download and install python2.4
  2. Download and install egenix mxtools
  3. Download and install Xcode 2.4.1 (not any 3.x version)
  4. Download and install PostgreSQL
  5. Download and unzip Psycopg2 2.0.12
  6. find setup.cfg inside the unzipped psycopg2 folder (e.g. '/foo/bar/user/Desktop/psycopg2-2.0.12/'
  7. change line '#pg_config=' into 'pg_config=/Library/PostgreSQL/8.3/bin/pg_config'
  8. an alternative to the above two steps may be the approach laid out at this posting except we would be talking PostgreSQL not PostgresPlus , and a C compiler may need to be installed for this to work (per egenix notes); see also related devel post ~ Aug 29 2009 re Please test GNUmed on Mac
  9. open a shell , change into the folder which contains setup.cfg (e.g. '/foo/bar/user/Desktop/psycopg2-2.0.12/') and run 'python2.4 setup.py build'
  10. copy the folder '/foo/bar/user/Desktop/psycopg2-2.0.12/build/lib.macosx-10.3-fat-2.4/psycopg2' into the dmg

You are now ready to start the updated GNUmed client

How to create a Mac OS X dmg package

When trying to modify and update a GNUmed-client-as-Mac.app that had been copied from a disk image, it can help to know that Mac "bundles" can support and reference any among multiple versions of a framework (e.g. Python). This can allow older applications to continue running, even as the framework-shared library continues to evolve, and can also explain newer components, if simply added, may get ignored.

On an interim basis, the GNUmed 0.2.8.3 disk image has been hacked to supply GNUmed 0.5.0.

Going forward, the plan is to

  1. bundle the client into a double-clickable GNUmed.app
    … likely to be produced as an Xcode Tools "Core Data Application" project folder
  2. prepare a new disk image (modeled after the 0.2.8.3 image)
    … likely using Apple's PackageMaker (man page))
  3. package the server part
    … likely using one-click installers from enterprisedb, however as theirs is incompatible with PG 8.4 for silent mode installation, PG 8.3 remains the better pick for the 0.5 cycle of clients: enterprisedb (noninteractive).

References:

Within a package's Contents/Info.plist (which can be shown using the Mac control-click contextual menu "Show Package Contents") is the key CFBundleExecutable by which one specifies the code which is to be executed (the "executable") when the user launches the application, and is in this same Info.plist file is maintained the license and other information (Apple "Bundles" document referenced above, page 23). (Screenshot appended).

Helpful info about "Structure of a Mac OS Application Bundle" (page 21), together with Framework Bundles information (page 26) suggests that:

  • the hierarchy inside the 0.2.8.3 app may need to be refactored, for example moving Frameworks into the root "Contents" directory
  • this absent Contents/Frameworks/ is evidently supposed to have its own Resources subdirectory (also currently absent) in which an Info.plist file is supposed to provide the system with the intended configuration of the framework.

For reconsideration will be whether the Mac client would best be maintained as an Xcode tools project rather than something that would require the maintainer(s) to run make (page 12: "Creating a Bundle"):

When you create a new Xcode project (or add a target to an existing project), Xcode automatically creates the required bundle structure when 
needed. For example, the application, framework, and loadable bundle targets all have associated bundle 
structures. When you build any of these targets, Xcode automatically creates the corresponding bundle for 
you.

Note:  Some Xcode targets(such as shell tools and static libraries) do not result in the creation of a bundle 
or package. This is normal and there is no need to create bundles specifically for these target types. The 
resulting binaries generated for those targets are intended to be used as is. 

If you use make files (instead of Xcode) to build your projects, there is no magic to creating a bundle. A 
bundle is just a directory in the file system with a well-defined structure and a specific filename extension 
added to the end of the bundle directory name. As long as you create the top-level bundle directory and 
structure the contents of your bundle appropriately, you can access those contents using the programmatic 
support for accessing bundles. For more information on how to structure your bundle directory, see “Bundle 
Structures” (page 15).


Options for what we can be provided for Mac (page 11):

  1. a GNUmed "App" bundle, as a Mac package
  2. an optionally-separate framework bundle which would could be updated less often as the client App, in which case the client app could just be the client with suitable linkage to the framework.
  3. if future usage would require, a Mac PreferencePane plug-in - define custom preferences that you want to integrate into the System
Preferences application
  1. Loadable bundles. Maybe stuff like Osirix could be optionally dropped-in... later if at all.

If you are developing software for Mac OS X, you can create your own custom frameworks and use them 
privately or make them available for other applications to use. You can create a new framework using a 
separate Xcode project or by adding a framework target to an existing project. (page 27)

  • Screenshot of the contents of the Mac 0.2.8.3 client bundle file Info.plist:
    Info.plist_0.2.8.3.png
Topic attachments
I Attachment Action Size Date Who Comment
pngpng Info.plist_0.2.8.3.png manage 203.5 K 21 Aug 2009 - 01:03 JamesBusser Screenshot of the contents of the Mac 0.2.8.3 client bundle file Info.plist
Topic revision: r13 - 29 Aug 2009 - 15:24:33 - JamesBusser
Gnumed.MacPackages moved from Gnumed.GNUmedDMG on 19 Aug 2009 - 19:24 by JamesBusser - put it back
 

TWIKI.NET
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback