Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dfca8c9

Browse files
committed
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.
1 parent 222d473 commit dfca8c9

2 files changed

Lines changed: 27 additions & 7 deletions

File tree

Mac/BuildScript/build-installer.py

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python
22
"""
33
This script is used to build "official" universal installers on Mac OS X.
4-
It requires at least Mac OS X 10.4, Xcode 2.2 and the 10.4u SDK for
4+
It requires at least Mac OS X 10.5, Xcode 3, and the 10.4u SDK for
55
32-bit builds. 64-bit or four-way universal builds require at least
66
OS X 10.5 and the 10.5 SDK.
77
@@ -10,6 +10,20 @@
1010
which is used to build the documentation, currently requires at least
1111
Python 2.4.
1212
13+
In addition to what is supplied with OS X 10.5+ and Xcode 3+, the script
14+
requires an installed version of hg and a third-party version of
15+
Tcl/Tk 8.4 (for OS X 10.4 and 10.5 deployment targets) or Tcl/TK 8.5
16+
(for 10.6 or later) installed in /Library/Frameworks. When installed,
17+
the Python built by this script will attempt to dynamically link first to
18+
Tcl and Tk frameworks in /Library/Frameworks if available otherwise fall
19+
back to the ones in /System/Library/Framework. For the build, we recommend
20+
installing the most recent ActiveTcl 8.4 or 8.5 version.
21+
22+
32-bit-only installer builds are still possible on OS X 10.4 with Xcode 2.5
23+
and the installation of additional components, such as a newer Python
24+
(2.5 is needed for Python parser updates), hg, and svn (for the documentation
25+
build).
26+
1327
Usage: see USAGE variable in the script.
1428
"""
1529
import platform, os, sys, getopt, textwrap, shutil, stat, time, pwd, grp
@@ -342,9 +356,7 @@ def pkg_recipes():
342356
source="/pydocs",
343357
readme="""\
344358
This package installs the python documentation at a location
345-
that is useable for pydoc and IDLE. If you have installed Xcode
346-
it will also install a link to the documentation in
347-
/Developer/Documentation/Python
359+
that is useable for pydoc and IDLE.
348360
""",
349361
postflight="scripts/postflight.documentation",
350362
required=False,
@@ -511,7 +523,15 @@ def checkEnvironment():
511523
ev, os.environ[ev]))
512524
del os.environ[ev]
513525

514-
os.environ['PATH'] = '/bin:/sbin:/usr/bin:/usr/sbin'
526+
base_path = '/bin:/sbin:/usr/bin:/usr/sbin'
527+
if 'SDK_TOOLS_BIN' in os.environ:
528+
base_path = os.environ['SDK_TOOLS_BIN'] + ':' + base_path
529+
# Xcode 2.5 on OS X 10.4 does not include SetFile in its usr/bin;
530+
# add its fixed location here if it exists
531+
OLD_DEVELOPER_TOOLS = '/Developer/Tools'
532+
if os.path.isdir(OLD_DEVELOPER_TOOLS):
533+
base_path = base_path + ':' + OLD_DEVELOPER_TOOLS
534+
os.environ['PATH'] = base_path
515535
print("Setting default PATH: %s"%(os.environ['PATH']))
516536

517537

@@ -1204,7 +1224,7 @@ def buildDMG():
12041224
# Custom icon for the DMG, shown when the DMG is mounted.
12051225
shutil.copy("../Icons/Disk Image.icns",
12061226
os.path.join(WORKDIR, "mnt", volname, ".VolumeIcon.icns"))
1207-
runCommand("/Developer/Tools/SetFile -a C %s/"%(
1227+
runCommand("SetFile -a C %s/"%(
12081228
shellQuote(os.path.join(WORKDIR, "mnt", volname)),))
12091229

12101230
runCommand("hdiutil detach %s"%(shellQuote(os.path.join(WORKDIR, "mnt", volname))))

Mac/Makefile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ INSTALL_SCRIPT= @INSTALL_SCRIPT@
4040
INSTALL_DATA=@INSTALL_DATA@
4141
LN=@LN@
4242
STRIPFLAG=-s
43-
CPMAC=/Developer/Tools/CpMac
43+
CPMAC=CpMac
4444

4545
APPTEMPLATE=$(srcdir)/Resources/app
4646
APPSUBDIRS=MacOS Resources

0 commit comments

Comments
 (0)