[Python-checkins] cpython: OS X installer cleanups:

ned.deily python-checkins at python.org
Mon Aug 6 15:42:43 CEST 2012


http://hg.python.org/cpython/rev/6280c13d907c
changeset:   78451:6280c13d907c
user:        Ned Deily <nad at acm.org>
date:        Mon Aug 06 06:34:00 2012 -0700
summary:
  OS X installer cleanups:
- Remove OS X installer and Mac/Makefile dependencies on /Developer which
  no longer exists with Xcode 4; the referenced tools have been installed
  into the usr/bin tool root since Xcode 3.
- Support adding the SDK usr/bin tool root to the installer's PATH via the
  SDK_TOOLS_BIN environment variable.

files:
  Mac/BuildScript/build-installer.py |  32 ++++++++++++++---
  Mac/Makefile.in                    |   2 +-
  2 files changed, 27 insertions(+), 7 deletions(-)


diff --git a/Mac/BuildScript/build-installer.py b/Mac/BuildScript/build-installer.py
--- a/Mac/BuildScript/build-installer.py
+++ b/Mac/BuildScript/build-installer.py
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 """
 This script is used to build "official" universal installers on Mac OS X.
-It requires at least Mac OS X 10.4, Xcode 2.2 and the 10.4u SDK for
+It requires at least Mac OS X 10.5, Xcode 3, and the 10.4u SDK for
 32-bit builds.  64-bit or four-way universal builds require at least
 OS X 10.5 and the 10.5 SDK.
 
@@ -10,6 +10,20 @@
 which is used to build the documentation, currently requires at least
 Python 2.4.
 
+In addition to what is supplied with OS X 10.5+ and Xcode 3+, the script
+requires an installed version of hg and a third-party version of
+Tcl/Tk 8.4 (for OS X 10.4 and 10.5 deployment targets) or Tcl/TK 8.5
+(for 10.6 or later) installed in /Library/Frameworks.  When installed,
+the Python built by this script will attempt to dynamically link first to
+Tcl and Tk frameworks in /Library/Frameworks if available otherwise fall
+back to the ones in /System/Library/Framework.  For the build, we recommend
+installing the most recent ActiveTcl 8.4 or 8.5 version.
+
+32-bit-only installer builds are still possible on OS X 10.4 with Xcode 2.5
+and the installation of additional components, such as a newer Python
+(2.5 is needed for Python parser updates), hg, and svn (for the documentation
+build).
+
 Usage: see USAGE variable in the script.
 """
 import platform, os, sys, getopt, textwrap, shutil, stat, time, pwd, grp
@@ -342,9 +356,7 @@
             source="/pydocs",
             readme="""\
                 This package installs the python documentation at a location
-                that is useable for pydoc and IDLE. If you have installed Xcode
-                it will also install a link to the documentation in
-                /Developer/Documentation/Python
+                that is useable for pydoc and IDLE.
                 """,
             postflight="scripts/postflight.documentation",
             required=False,
@@ -511,7 +523,15 @@
                                                     ev, os.environ[ev]))
                 del os.environ[ev]
 
-    os.environ['PATH'] = '/bin:/sbin:/usr/bin:/usr/sbin'
+    base_path = '/bin:/sbin:/usr/bin:/usr/sbin'
+    if 'SDK_TOOLS_BIN' in os.environ:
+        base_path = os.environ['SDK_TOOLS_BIN'] + ':' + base_path
+    # Xcode 2.5 on OS X 10.4 does not include SetFile in its usr/bin;
+    # add its fixed location here if it exists
+    OLD_DEVELOPER_TOOLS = '/Developer/Tools'
+    if os.path.isdir(OLD_DEVELOPER_TOOLS):
+        base_path = base_path + ':' + OLD_DEVELOPER_TOOLS
+    os.environ['PATH'] = base_path
     print("Setting default PATH: %s"%(os.environ['PATH']))
 
 
@@ -1204,7 +1224,7 @@
     # Custom icon for the DMG, shown when the DMG is mounted.
     shutil.copy("../Icons/Disk Image.icns",
             os.path.join(WORKDIR, "mnt", volname, ".VolumeIcon.icns"))
-    runCommand("/Developer/Tools/SetFile -a C %s/"%(
+    runCommand("SetFile -a C %s/"%(
             shellQuote(os.path.join(WORKDIR, "mnt", volname)),))
 
     runCommand("hdiutil detach %s"%(shellQuote(os.path.join(WORKDIR, "mnt", volname))))
diff --git a/Mac/Makefile.in b/Mac/Makefile.in
--- a/Mac/Makefile.in
+++ b/Mac/Makefile.in
@@ -40,7 +40,7 @@
 INSTALL_DATA=@INSTALL_DATA@
 LN=@LN@
 STRIPFLAG=-s
-CPMAC=/Developer/Tools/CpMac
+CPMAC=CpMac
 
 APPTEMPLATE=$(srcdir)/Resources/app
 APPSUBDIRS=MacOS Resources

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list