[PATCH] Makefile: add install-mac for framework-based Python installations (issue1412)

Brodie Rao dackze at gmail.com
Mon Jan 5 02:08:10 CST 2009

On Jan 5, 2009, at 12:45 AM, Matt Mackall wrote:

> On Sun, 2009-01-04 at 19:16 -0500, Brodie Rao wrote:
>> # HG changeset patch
>> # User Brodie Rao <me+hg at dackz.net>
>> # Date 1231029019 18000
>> # Node ID 08023510ff113657ef96eb0ef32b86f661062899
>> # Parent  49355875c8054259ffcf4bc913a8d97ff89330b1
>> Makefile: add install-mac for framework-based Python installations  
>> (issue1412)
>> Apple's distributions and python.org's binary distributions of  
>> Python are
>> installed as self-contained frameworks. In this case site-packages  
>> doesn't
>> live under /usr/local, and --prefix is already properly configured  
>> by the
>> Python installation.
> If you think site-packages normally live under /usr/local/ on, say,
> Linux, you have incompletely understood the problem. There's nothing
> special about OS X here.
> The point here is to *not* install packages by default into filesystem
> spaces controlled and owned by the system software, package managers  
> or
> installers so as to not interfere with those tools. This lets people
> have a clear separation between "managed" (automatically installed and
> upgraded) and "unmanaged" (hand-installed and upgraded).
> The bottom line is if you're installing a package from source, you're
> expected to know where things belong on your particular operating
> system.
> -- 
> Mathematics is the supreme nostalgia of our time.

If --prefix is removed for installation on OS X, scripts correctly go  
into /usr/local/bin and packages into /Library/Python/2.5/site- 
packages, which is the designated place for site-specific packages  
under OS X. This is the designated place for unmanaged packages, as  
opposed to /System/Library/Frameworks/Python.framework/Versions/2.5/ 
lib/python2.5/site-packages for system-managed packages.

If --prefix is left in, Mercurial is installed into /usr/local/ 
python2.5/site-packages. Running hg results in an ImportError because  
this folder isn't used by Apple's distribution of Python, effectively  
leaving hg in an unusable state.

The point is that --prefix must be omitted for OS X, as it's already  
properly configured to install into the unmanaged package area, and  
inserting it makes it impossible to install Mercurial correctly using  
the Makefile.

More information about the Mercurial-devel mailing list