cpython: cd883160ad97 (original) (raw)
--- a/Mac/BuildScript/build-installer.py +++ b/Mac/BuildScript/build-installer.py @@ -900,19 +900,26 @@ def buildPython(): # We added some directories to the search path during the configure # phase. Remove those because those directories won't be there on
the end-users system.
- path =os.path.join(rootDir, 'Library', 'Frameworks', 'Python.framework',
'Versions', version, 'lib', 'python%s'%(version,),[](#l1.9)
'config' + config_suffix, 'Makefile')[](#l1.10)
- fp = open(path, 'r')
- data = fp.read()
- fp.close()
the end-users system. Also remove the directories from _sysconfigdata.py
(added in 3.3) if it exists.
- data = data.replace('-L%s/libraries/usr/local/lib'%(WORKDIR,), '')
- data = data.replace('-I%s/libraries/usr/local/include'%(WORKDIR,), '')
- fp = open(path, 'w')
- fp.write(data)
- fp.close()
- path_to_lib = os.path.join(rootDir, 'Library', 'Frameworks',
'Python.framework', 'Versions',[](#l1.23)
version, 'lib', 'python%s'%(version,))[](#l1.24)
- paths = [os.path.join(path_to_lib, 'config' + config_suffix, 'Makefile'),
os.path.join(path_to_lib, '_sysconfigdata.py')][](#l1.26)
- for path in paths:
if not os.path.exists(path):[](#l1.28)
continue[](#l1.29)
fp = open(path, 'r')[](#l1.30)
data = fp.read()[](#l1.31)
fp.close()[](#l1.32)
data = data.replace('-L%s/libraries/usr/local/lib'%(WORKDIR,), '')[](#l1.34)
data = data.replace('-I%s/libraries/usr/local/include'%(WORKDIR,), '')[](#l1.35)
fp = open(path, 'w')[](#l1.36)
fp.write(data)[](#l1.37)
fp.close()[](#l1.38)
# Add symlinks in /usr/local/bin, using relative links usr_local_bin = os.path.join(rootDir, 'usr', 'local', 'bin')