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

Skip to content

Commit e59e4c5

Browse files
committed
Issue #11054: Allow Mac OS X installer builds to again work on 10.5 with
the system-provided Python. Also, properly guard a new Python 3 only installer build step so that build-installer.py can stay compatible with the 2.7 version. (with release manager approval for 3.2rc2)
1 parent 806c944 commit e59e4c5

3 files changed

Lines changed: 34 additions & 18 deletions

File tree

Mac/BuildScript/README.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ for each release:
1414
1. 32-bit-only, i386 and PPC universal, capable on running on all machines
1515
supported by Mac OS X 10.3.9 through (at least) 10.6::
1616

17-
python2.6 build-installer.py \
17+
python build-installer.py \
1818
--sdk-path=/Developer/SDKs/MacOSX10.4u.sdk \
1919
--universal-archs=32-bit \
2020
--dep-target=10.3
@@ -38,7 +38,7 @@ for each release:
3838
* ``MacOSX10.4u`` SDK (later SDKs do not support PPC G3 processors)
3939
* ``MACOSX_DEPLOYMENT_TARGET=10.3``
4040
* Apple ``gcc-4.0``
41-
* Python 2.6 for documentation build with Sphinx
41+
* Python 2.n (n >= 4) for documentation build with Sphinx
4242

4343
- alternate build environments:
4444

@@ -48,7 +48,7 @@ for each release:
4848

4949
2. 64-bit / 32-bit, x86_64 and i386 universal, for OS X 10.6 (and later)::
5050

51-
python2.6 build-installer.py \
51+
python build-installer.py \
5252
--sdk-path=/Developer/SDKs/MacOSX10.6.sdk \
5353
--universal-archs=intel \
5454
--dep-target=10.6
@@ -67,7 +67,7 @@ for each release:
6767
* ``MacOSX10.6`` SDK
6868
* ``MACOSX_DEPLOYMENT_TARGET=10.6``
6969
* Apple ``gcc-4.2``
70-
* Python 2.6 for documentation build with Sphinx
70+
* Python 2.n (n >= 4) for documentation build with Sphinx
7171

7272
- alternate build environments:
7373

Mac/BuildScript/build-installer.py

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
#!/usr/bin/python
22
"""
3-
This script is used to build the "official unofficial" universal build on
4-
Mac OS X. It requires Mac OS X 10.4, Xcode 2.2 and the 10.4u SDK to do its
5-
work. 64-bit or four-way universal builds require at least OS X 10.5 and
6-
the 10.5 SDK.
3+
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
5+
32-bit builds. 64-bit or four-way universal builds require at least
6+
OS X 10.5 and the 10.5 SDK.
77
8-
Please ensure that this script keeps working with Python 2.3, to avoid
9-
bootstrap issues (/usr/bin/python is Python 2.3 on OSX 10.4)
8+
Please ensure that this script keeps working with Python 2.5, to avoid
9+
bootstrap issues (/usr/bin/python is Python 2.5 on OSX 10.5). Sphinx,
10+
which is used to build the documentation, currently requires at least
11+
Python 2.4.
1012
1113
Usage: see USAGE variable in the script.
1214
"""
@@ -405,6 +407,9 @@ def checkEnvironment():
405407
Check that we're running on a supported system.
406408
"""
407409

410+
if sys.version_info[0:2] < (2, 4):
411+
fatal("This script must be run with Python 2.4 or later")
412+
408413
if platform.system() != 'Darwin':
409414
fatal("This script should be run on a Mac OS X 10.4 (or later) system")
410415

@@ -835,29 +840,33 @@ def buildPython():
835840
os.chmod(p, stat.S_IMODE(st.st_mode) | stat.S_IWGRP)
836841
os.chown(p, -1, gid)
837842

838-
LDVERSION=None
839-
VERSION=None
840-
ABIFLAGS=None
843+
if PYTHON_3:
844+
LDVERSION=None
845+
VERSION=None
846+
ABIFLAGS=None
841847

842-
with open(os.path.join(buildDir, 'Makefile')) as fp:
848+
fp = open(os.path.join(buildDir, 'Makefile'), 'r')
843849
for ln in fp:
844850
if ln.startswith('VERSION='):
845851
VERSION=ln.split()[1]
846852
if ln.startswith('ABIFLAGS='):
847853
ABIFLAGS=ln.split()[1]
848-
849854
if ln.startswith('LDVERSION='):
850855
LDVERSION=ln.split()[1]
856+
fp.close()
851857

852-
LDVERSION = LDVERSION.replace('$(VERSION)', VERSION)
853-
LDVERSION = LDVERSION.replace('$(ABIFLAGS)', ABIFLAGS)
858+
LDVERSION = LDVERSION.replace('$(VERSION)', VERSION)
859+
LDVERSION = LDVERSION.replace('$(ABIFLAGS)', ABIFLAGS)
860+
config_suffix = '-' + LDVERSION
861+
else:
862+
config_suffix = '' # Python 2.x
854863

855864
# We added some directories to the search path during the configure
856865
# phase. Remove those because those directories won't be there on
857866
# the end-users system.
858867
path =os.path.join(rootDir, 'Library', 'Frameworks', 'Python.framework',
859868
'Versions', version, 'lib', 'python%s'%(version,),
860-
'config-' + LDVERSION, 'Makefile')
869+
'config' + config_suffix, 'Makefile')
861870
fp = open(path, 'r')
862871
data = fp.read()
863872
fp.close()

Misc/NEWS

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,13 @@ Library
7373
- Issue #9509: argparse now properly handles IOErrors raised by
7474
argparse.FileType.
7575

76+
Build
77+
-----
78+
79+
- Issue #11054: Allow Mac OS X installer builds to again work on 10.5 with
80+
the system-provided Python.
81+
82+
7683
What's New in Python 3.2 Release Candidate 1
7784
============================================
7885

0 commit comments

Comments
 (0)