|
13 | 13 | Python 2.6. |
14 | 14 |
|
15 | 15 | In addition to what is supplied with OS X 10.5+ and Xcode 3+, the script |
16 | | -requires an installed version of hg and a third-party version of |
| 16 | +requires an installed third-party version of |
17 | 17 | Tcl/Tk 8.4 (for OS X 10.4 and 10.5 deployment targets) or Tcl/TK 8.5 |
18 | 18 | (for 10.6 or later) installed in /Library/Frameworks. When installed, |
19 | 19 | the Python built by this script will attempt to dynamically link first to |
|
23 | 23 |
|
24 | 24 | 32-bit-only installer builds are still possible on OS X 10.4 with Xcode 2.5 |
25 | 25 | and the installation of additional components, such as a newer Python |
26 | | -(2.5 is needed for Python parser updates), hg, and for the documentation |
| 26 | +(2.5 is needed for Python parser updates) and for the documentation |
27 | 27 | build either svn (pre-3.4.1) or sphinx-build (3.4.1 and later). |
28 | 28 |
|
29 | 29 | Usage: see USAGE variable in the script. |
@@ -577,7 +577,7 @@ def getTclTkVersion(configfile, versionline): |
577 | 577 | """ |
578 | 578 | try: |
579 | 579 | f = open(configfile, "r") |
580 | | - except: |
| 580 | + except OSError: |
581 | 581 | fatal("Framework configuration file not found: %s" % configfile) |
582 | 582 |
|
583 | 583 | for l in f: |
@@ -663,9 +663,8 @@ def checkEnvironment(): |
663 | 663 | base_path = base_path + ':' + OLD_DEVELOPER_TOOLS |
664 | 664 | os.environ['PATH'] = base_path |
665 | 665 | print("Setting default PATH: %s"%(os.environ['PATH'])) |
666 | | - # Ensure ws have access to hg and to sphinx-build. |
667 | | - # You may have to create links in /usr/bin for them. |
668 | | - runCommand('hg --version') |
| 666 | + # Ensure we have access to sphinx-build. |
| 667 | + # You may have to create a link in /usr/bin for it. |
669 | 668 | runCommand('sphinx-build --version') |
670 | 669 |
|
671 | 670 | def parseOptions(args=None): |
@@ -819,7 +818,7 @@ def downloadURL(url, fname): |
819 | 818 | except: |
820 | 819 | try: |
821 | 820 | os.unlink(fname) |
822 | | - except: |
| 821 | + except OSError: |
823 | 822 | pass |
824 | 823 |
|
825 | 824 | def verifyThirdPartyFile(url, checksum, fname): |
@@ -1115,7 +1114,6 @@ def buildPythonDocs(): |
1115 | 1114 | docdir = os.path.join(rootDir, 'pydocs') |
1116 | 1115 | curDir = os.getcwd() |
1117 | 1116 | os.chdir(buildDir) |
1118 | | - # The Doc build changed for 3.4 (technically, for 3.4.1) and for 2.7.9 |
1119 | 1117 | runCommand('make clean') |
1120 | 1118 | # Assume sphinx-build is on our PATH, checked in checkEnvironment |
1121 | 1119 | runCommand('make html') |
@@ -1168,8 +1166,25 @@ def buildPython(): |
1168 | 1166 | shellQuote(WORKDIR)[1:-1], |
1169 | 1167 | shellQuote(WORKDIR)[1:-1])) |
1170 | 1168 |
|
1171 | | - print("Running make") |
1172 | | - runCommand("make") |
| 1169 | + # Look for environment value BUILDINSTALLER_BUILDPYTHON_MAKE_EXTRAS |
| 1170 | + # and, if defined, append its value to the make command. This allows |
| 1171 | + # us to pass in version control tags, like GITTAG, to a build from a |
| 1172 | + # tarball rather than from a vcs checkout, thus eliminating the need |
| 1173 | + # to have a working copy of the vcs program on the build machine. |
| 1174 | + # |
| 1175 | + # A typical use might be: |
| 1176 | + # export BUILDINSTALLER_BUILDPYTHON_MAKE_EXTRAS=" \ |
| 1177 | + # GITVERSION='echo 123456789a' \ |
| 1178 | + # GITTAG='echo v3.6.0' \ |
| 1179 | + # GITBRANCH='echo 3.6'" |
| 1180 | + |
| 1181 | + make_extras = os.getenv("BUILDINSTALLER_BUILDPYTHON_MAKE_EXTRAS") |
| 1182 | + if make_extras: |
| 1183 | + make_cmd = "make " + make_extras |
| 1184 | + else: |
| 1185 | + make_cmd = "make" |
| 1186 | + print("Running " + make_cmd) |
| 1187 | + runCommand(make_cmd) |
1173 | 1188 |
|
1174 | 1189 | print("Running make install") |
1175 | 1190 | runCommand("make install DESTDIR=%s"%( |
|
0 commit comments