Issue #11054: Allow Mac OS X installer builds to again work on 10.5 with · pythoncapi/cpython@e59e4c5 · GitHub
Skip to content

Commit e59e4c5

Browse files
committed
Issue python#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

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

0 commit comments

Comments
 (0)