[Pythonmac-SIG] Yet another problem with two Pythons on Panther

Stuart Bishop stuart at stuartbishop.net
Mon Dec 15 19:13:00 EST 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 08/12/2003, at 11:48 AM, Stuart Bishop wrote:

>>>> This could probably be fixed by adding a 
>>>> -F/System/Library/Frameworks to the builds, but I don't think we 
>>>> can do this for the existing 10.3/2.3 distribution. Or can someone 
>>>> think of a workaround?

If 'monkey patching' distutils is still an option (I haven't seen any
other ideas on how to stop an installation of Python in 
/Library/Frameworks
breaking the shipped installation in /System/Library/Frameworks), the
adding the following three files into /Library/Python appears to work,
and is about as clean as I can see this dubious-yet-supported mechanism
getting.

distutils_patch.py::

import sys
if sys.version_info[:3] == (2, 3, 0):
    	 # Monkey patch distutils. Python 2.3.0 as shipped with OSX 10.3
     # doesn't specify path of the Framework, causing packages with C
     # extensions to fail to build if othher versions of Python have been
     # installed in /Library/Frameworks
     import distutils.sysconfig, os.path
     def get_makefile_filename():
         if distutils.sysconfig.python_build:
             return os.path.join(os.path.dirname(sys.executable), 
"Makefile")
         return "/Library/Python/2.3/Makefile-2.3.0.patched"
     distutils.sysconfig.get_makefile_filename = get_makefile_filename


distutils_patch.pth::

import distutils_patch

Makefile-2.3.0.patched::

	A duplicate of /System/Library/[...]/config/Makefile, with
	'-F/System/Library/Frameworks' added to the start of the LDFLAGS= 
option.
	This should probably be generated by the MacPython installer to avoid
	any licensing issues with the Apple config/Makefile.

- --  
Stuart Bishop <stuart at stuartbishop.net>
http://www.stuartbishop.net/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (Darwin)

iD4DBQE/3k4TAfqZj7rGN0oRAjzoAJdtKKsrt5IuIjo6DSpf44PgACCLAJ4qN0O/
ILUeF7IFWW4LhVkqui0i5Q==
=kmGc
-----END PGP SIGNATURE-----




More information about the Pythonmac-SIG mailing list