blob: f92326f0f1d5e0ca1b83071ea76aabc46f95171d [file] [log] [blame]
Jack Jansend8d7bbe2002-11-20 14:07:57 +00001Building a MacPython-OSX on top of Jaguar's /usr/bin/python
2-----------------------------------------------------------
3
4One way of getting MacPython functionality is to use the Python that Apple
5supplies since MacOSX 10.2, and extend this with the missing bits.
6
7(Another way is building a framework python, see Mac/OSX/README for
8details on that).
9
10Preparation
11-----------
12
13First of all you have to fix two things in the python distributed
14by Apple. This paragraph is valid for 10.2 through 10.2.2, so if you
15have a later version of Jaguar your mileage may vary.
16
171. /usr/lib/python2.2/config/Makefile has an erronuous reference to
18 building for intel processors. Edit the file with sudo, and change
19 the line
20 LDFLAGS= -arch i386 -arch ppc
21 to
22 LDFLAGS= -arch ppc
232. /usr/lib/python2.2/site-packages is not writeable except by root.
24 Make it writeable by administrators by doing
25 sudo chgrp admin /usr/lib/python2.2/site-packages
26 sudo chmod g+w /usr/lib/python2.2/site-packages
27 Alternatively you can do the make's below as superuser, but I
28 would advise against this.
29
30Building
31--------
32
33Typing "make -f Makefile.jaguar" will build and install almost everything you need.
34If you also want the "pythonw" unix program, which allows you to run GUI scripts from
35a Terminal window, you should also do "sudo make -f Makefile.jaguar install_pythonw".
36
37What do you get
38---------------
39
40After the make you will have a folder /Applications/MacPython-OSX that contains the
41IDE and BuildApplet applications. Also, you will find a folder "python-additions" there
42that contains the MacPython-specific additions to your installed Python. The only thing
43that is installed outside the /Applications/MacPython-OSX folder is
44/usr/lib/python2.2/site-packages/MacPython.pth, which is the magic file that will make
45python find the new modules.
46
47Uninstalling
48------------
491. Remove /Applications/MacPython-OSX
502. Remove /usr/lib/python2.2/site-packages/MacPython.pth
51
52How does it work?
53-----------------
54
55Makefile.jaguar does most of the work by calling on Makefile (which is normally used
56to build the Mac extensions for a framework-based python) after setting various
57variables such that everything is built for /usr/bin/python. Some extension modules
58(that are included in framework python 2.3a0, but missing from static python 2.2)
59are built with setup.py. And some Carbon modules are built to replace their 2.2
60versions, which lack required functionality. The stubs in Mac/Lib/Carbon know about
61this overriding.
62