cpython: b599584ff1e3 (original) (raw)
--- a/Mac/BuildScript/README.txt +++ b/Mac/BuildScript/README.txt @@ -68,30 +68,30 @@ 2. 64-bit / 32-bit, x86_64 and i386 uni - requires ActiveState Tcl/Tk 8.5.15 (or later) to be installed for building * Beginning with Python 3.4 alpha2, this installer now includes its own
private copy of Tcl and Tk 8.5.15 libraries and thus is no longer[](#l1.7)
builtin copy of Tcl and Tk 8.5.15 libraries and thus is no longer[](#l1.8) dependent on the buggy releases of Aqua Cocoa Tk 8.5 shipped with[](#l1.9) OS X 10.6 or on installing a newer third-party version of Tcl/Tk[](#l1.10) in /Library/Frameworks, such as from ActiveState. Because this[](#l1.11) is a new feature, it should be considered somewhat experimental and[](#l1.12) subject to change prior to the final release of Python 3.4. If it[](#l1.13) is necessary to fallback to using a third-party Tcl/Tk because of[](#l1.14)
a problem with the private Tcl/Tk, there is a backup version of[](#l1.15)
a problem with the builtin Tcl/Tk, there is a backup version of[](#l1.16) the _tkinter extension included which will dynamically link to[](#l1.17) Tcl and Tk frameworks in /Library/Frameworks as in previous releases.[](#l1.18) To enable (for all users of this Python 3.4)::[](#l1.19)
sudo bash cd /Library/Frameworks/Python.framework/Versions/3.4
cd ./lib/python3.4/lib-dynload[](#l1.23)
cp -p _tkinter.so.framework _tkinter.so[](#l1.24)
cd ./lib/python3.4[](#l1.25)
cp -p ./lib-tkinter/library/_tkinter.so ./lib-dynload[](#l1.26) exit[](#l1.27)
To restore using Python's private versions of Tcl and Tk::[](#l1.29)
To restore using Python's builtin versions of Tcl and Tk::[](#l1.30)
sudo bash cd /Library/Frameworks/Python.framework/Versions/3.4
cd ./lib/python3.4/lib-dynload[](#l1.34)
cp -p _tkinter.so.private _tkinter.so[](#l1.35)
cd ./lib/python3.4[](#l1.36)
cp -p ./lib-tkinter/builtin/_tkinter.so ./lib-dynload[](#l1.37) exit[](#l1.38)
- recommended build environment:
--- a/Mac/BuildScript/build-installer.py +++ b/Mac/BuildScript/build-installer.py @@ -565,11 +565,11 @@ def checkEnvironment(): ] # For 10.6+ builds, we build two versions of _tkinter:
- the traditional version (renamed to _tkinter_library.so) linked
with /Library/Frameworks/{Tcl,Tk}.framework
EXPECTED_SHARED_LIBS['_tkinter.so.framework'] = \[](#l2.13)
EXPECTED_SHARED_LIBS['_tkinter_library.so'] = \[](#l2.14) EXPECTED_SHARED_LIBS['_tkinter.so'][](#l2.15) EXPECTED_SHARED_LIBS['_tkinter.so'] = [[](#l2.16) "/Library/Frameworks/Python.framework/Versions/%s/lib/libtcl%s.dylib"[](#l2.17)
@@ -966,18 +966,18 @@ def buildPython(): # of Tcl and Cocoa Aqua Tk libs because the Apple-supplied Tk 8.5 is # out-of-date and has critical bugs. Save the _tkinter.so that was # linked with /Library/Frameworks/{Tck,Tk}.framework and build
if DEPTARGET > '10.5': another _tkinter.so linked with our builtin Tcl and Tk libs. runCommand("find build -name '_tkinter.so' "
" -execdir mv '{}' '{}'.framework \;")[](#l2.26)
print("Running make to rebuild _tkinter")[](#l2.27)
" -execdir mv '{}' _tkinter_library.so \;")[](#l2.28)
print("Running make to build builtin _tkinter")[](#l2.29) runCommand("make TCLTK_INCLUDES='-I%s/libraries/usr/local/include' "[](#l2.30) "TCLTK_LIBS='-L%s/libraries/usr/local/lib -ltcl8.5 -ltk8.5'"%([](#l2.31) shellQuote(WORKDIR)[1:-1],[](#l2.32) shellQuote(WORKDIR)[1:-1]))[](#l2.33)
# make a backup copy, just in case[](#l2.34)
# make a copy which will be moved to lib-tkinter later[](#l2.35) runCommand("find build -name '_tkinter.so' "[](#l2.36)
" -execdir cp -p '{}' '{}'.private \;")[](#l2.37)
" -execdir cp -p '{}' _tkinter_builtin.so \;")[](#l2.38)
print("Running make install") runCommand("make install DESTDIR=%s"%( @@ -999,11 +999,31 @@ def buildPython(): 'Python.framework', 'Versions', getVersion(), 'lib'))))
- path_to_lib = os.path.join(rootDir, 'Library', 'Frameworks',
'Python.framework', 'Versions',[](#l2.47)
version, 'lib', 'python%s'%(version,))[](#l2.48)
If we made multiple versions of _tkinter, move them to
their own directories under python lib. This allows
users to select which to import by manipulating sys.path
directly or with PYTHONPATH.
- if DEPTARGET > '10.5':
TKINTERS = ['builtin', 'library'][](#l2.56)
tkinter_moves = [('_tkinter_' + tkn + '.so',[](#l2.57)
os.path.join(path_to_lib, 'lib-tkinter', tkn))[](#l2.58)
for tkn in TKINTERS][](#l2.59)
# Create the destination directories under lib-tkinter.[](#l2.60)
# The permissions and uid/gid will be fixed up next.[](#l2.61)
for tkm in tkinter_moves:[](#l2.62)
os.makedirs(tkm[1])[](#l2.63)
+ print("Fix file modes") frmDir = os.path.join(rootDir, 'Library', 'Frameworks', 'Python.framework') gid = grp.getgrnam('admin').gr_gid shared_lib_error = False
- moves_list = [] for dirpath, dirnames, filenames in os.walk(frmDir): for dn in dirnames: os.chmod(os.path.join(dirpath, dn), STAT_0o775)
@@ -1029,9 +1049,25 @@ def buildPython(): % (sl, p)) shared_lib_error = True
# If this is a _tkinter variant, move it to its own directory[](#l2.78)
# now that we have fixed its permissions and checked that it[](#l2.79)
# was linked properly. The directory was created earlier.[](#l2.80)
# The files are moved after the entire tree has been walked[](#l2.81)
# since the shared library checking depends on the files[](#l2.82)
# having unique names.[](#l2.83)
if DEPTARGET > '10.5':[](#l2.84)
for tkm in tkinter_moves:[](#l2.85)
if fn == tkm[0]:[](#l2.86)
moves_list.append([](#l2.87)
(p, os.path.join(tkm[1], '_tkinter.so')))[](#l2.88)
+ if shared_lib_error: fatal("Unexpected shared library errors.")
+ if PYTHON_3: LDVERSION=None VERSION=None @@ -1061,10 +1097,6 @@ def buildPython(): include_path = '-I%s/libraries/usr/local/include' % (WORKDIR,) lib_path = '-L%s/libraries/usr/local/lib' % (WORKDIR,)
- path_to_lib = os.path.join(rootDir, 'Library', 'Frameworks',
'Python.framework', 'Versions',[](#l2.105)
version, 'lib', 'python%s'%(version,))[](#l2.106)
- # fix Makefile path = os.path.join(path_to_lib, 'config' + config_suffix, 'Makefile') fp = open(path, 'r')