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

Skip to content

Commit 981b693

Browse files
committed
Issue #15663: Tcl/Tk 8.5.14 is now included with the OS X 10.6+
64-bit/32-bit installer for 10.6+. It is no longer necessary to install a third-party version of Tcl/Tk 8.5 to work around the problems in the Apple-supplied Tcl/Tk 8.5 shipped in OS X 10.6 and later releases.
1 parent d819b93 commit 981b693

5 files changed

Lines changed: 155 additions & 27 deletions

File tree

Mac/BuildScript/README.txt

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,42 @@ for each release.
5757

5858
* NCurses 5.9 (http://bugs.python.org/issue15037)
5959
* SQLite 3.7.13
60+
* Tcl 8.5.14
61+
* Tk 8.5.14
6062
* XZ 5.0.3
6163

6264
- uses system-supplied versions of third-party libraries
6365

6466
* readline module links with Apple BSD editline (libedit)
6567

66-
- requires ActiveState Tcl/Tk 8.5.9 (or later) to be installed for building
68+
- requires ActiveState Tcl/Tk 8.5.14 (or later) to be installed for building
69+
70+
* Beginning with Python 3.4 alpha2, this installer now includes its own
71+
private copy of Tcl and Tk 8.5.14 libraries and thus is no longer
72+
dependent on the buggy releases of Aqua Cocoa Tk 8.5 shipped with
73+
OS X 10.6 or on installing a newer third-party version of Tcl/Tk
74+
in /Library/Frameworks, such as from ActiveState. Because this
75+
is a new feature, it should be considered somewhat experimental and
76+
subject to change prior to the final release of Python 3.4. If it
77+
is necessary to fallback to using a third-party Tcl/Tk because of
78+
a problem with the private Tcl/Tk, there is a backup version of
79+
the _tkinter extension included which will dynamically link to
80+
Tcl and Tk frameworks in /Library/Frameworks as in previous releases.
81+
To enable (for all users of this Python 3.4)::
82+
83+
sudo bash
84+
cd /Library/Frameworks/Python.framework/Versions/3.4
85+
cd ./lib/python3.4/lib-dynload
86+
cp -p _tkinter.so.framework _tkinter.so
87+
exit
88+
89+
To restore using Python's private versions of Tcl and Tk::
90+
91+
sudo bash
92+
cd /Library/Frameworks/Python.framework/Versions/3.4
93+
cd ./lib/python3.4/lib-dynload
94+
cp -p _tkinter.so.private _tkinter.so
95+
exit
6796

6897
- recommended build environment:
6998

@@ -82,7 +111,7 @@ for each release.
82111
considered a migration aid by Apple and is not likely to be fixed,
83112
its use should be avoided. The other compiler, ``clang``, has been
84113
undergoing rapid development. While it appears to have become
85-
production-ready in the most recent Xcode 4 releases (Xcode 4.4.1
114+
production-ready in the most recent Xcode 4 releases (Xcode 4.6.3
86115
as of this writing), there are still some open issues when
87116
building Python and there has not yet been the level of exposure in
88117
production environments that the Xcode 3 gcc-4.2 compiler has had.

Mac/BuildScript/build-installer.py

Lines changed: 76 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,44 @@ def library_recipes():
192192

193193
LT_10_5 = bool(DEPTARGET < '10.5')
194194

195+
if DEPTARGET > '10.5':
196+
result.extend([
197+
dict(
198+
name="Tcl 8.5.14",
199+
url="ftp://ftp.tcl.tk/pub/tcl//tcl8_5/tcl8.5.14-src.tar.gz",
200+
checksum='44b50e58ab45dd272f6714dce2129123',
201+
buildDir="unix",
202+
configure_pre=[
203+
'--enable-shared',
204+
'--enable-threads',
205+
'--libdir=/Library/Frameworks/Python.framework/Versions/%s/lib'%(getVersion(),),
206+
],
207+
useLDFlags=False,
208+
install='make TCL_LIBRARY=%(TCL_LIBRARY)s && make install TCL_LIBRARY=%(TCL_LIBRARY)s DESTDIR=%(DESTDIR)s'%{
209+
"DESTDIR": shellQuote(os.path.join(WORKDIR, 'libraries')),
210+
"TCL_LIBRARY": shellQuote('/Library/Frameworks/Python.framework/Versions/%s/lib/tcl8.5'%(getVersion())),
211+
},
212+
),
213+
dict(
214+
name="Tk 8.5.14",
215+
url="ftp://ftp.tcl.tk/pub/tcl//tcl8_5/tk8.5.14-src.tar.gz",
216+
checksum='a9c48921b3688020470cd3a6dd4e867d',
217+
buildDir="unix",
218+
configure_pre=[
219+
'--enable-aqua',
220+
'--enable-shared',
221+
'--enable-threads',
222+
'--libdir=/Library/Frameworks/Python.framework/Versions/%s/lib'%(getVersion(),),
223+
],
224+
useLDFlags=False,
225+
install='make TCL_LIBRARY=%(TCL_LIBRARY)s TK_LIBRARY=%(TK_LIBRARY)s && make install TCL_LIBRARY=%(TCL_LIBRARY)s TK_LIBRARY=%(TK_LIBRARY)s DESTDIR=%(DESTDIR)s'%{
226+
"DESTDIR": shellQuote(os.path.join(WORKDIR, 'libraries')),
227+
"TCL_LIBRARY": shellQuote('/Library/Frameworks/Python.framework/Versions/%s/lib/tcl8.5'%(getVersion())),
228+
"TK_LIBRARY": shellQuote('/Library/Frameworks/Python.framework/Versions/%s/lib/tk8.5'%(getVersion())),
229+
},
230+
),
231+
])
232+
195233
if getVersionTuple() >= (3, 3):
196234
result.extend([
197235
dict(
@@ -525,6 +563,20 @@ def checkEnvironment():
525563
% frameworks['Tk'],
526564
]
527565

566+
# For 10.6+ builds, we build two versions of _tkinter:
567+
# - the traditional version (renamed to _tkinter.so.framework) linked
568+
# with /Library/Frameworks/{Tcl,Tk}.framework
569+
# - the default version linked with our private copies of Tcl and Tk
570+
if DEPTARGET > '10.5':
571+
EXPECTED_SHARED_LIBS['_tkinter.so.framework'] = \
572+
EXPECTED_SHARED_LIBS['_tkinter.so']
573+
EXPECTED_SHARED_LIBS['_tkinter.so'] = [
574+
"/Library/Frameworks/Python.framework/Versions/%s/lib/libtcl%s.dylib"
575+
% (getVersion(), frameworks['Tcl']),
576+
"/Library/Frameworks/Python.framework/Versions/%s/lib/libtk%s.dylib"
577+
% (getVersion(), frameworks['Tk']),
578+
]
579+
528580
# Remove inherited environment variables which might influence build
529581
environ_var_prefixes = ['CPATH', 'C_INCLUDE_', 'DYLD_', 'LANG', 'LC_',
530582
'LD_', 'LIBRARY_', 'PATH', 'PYTHON']
@@ -633,13 +685,19 @@ def extractArchive(builddir, archiveName):
633685
634686
XXX: This function assumes that archives contain a toplevel directory
635687
that is has the same name as the basename of the archive. This is
636-
save enough for anything we use.
688+
safe enough for almost anything we use. Unfortunately, it does not
689+
work for current Tcl and Tk source releases where the basename of
690+
the archive ends with "-src" but the uncompressed directory does not.
691+
For now, just special case Tcl and Tk tar.gz downloads.
637692
"""
638693
curdir = os.getcwd()
639694
try:
640695
os.chdir(builddir)
641696
if archiveName.endswith('.tar.gz'):
642697
retval = os.path.basename(archiveName[:-7])
698+
if ((retval.startswith('tcl') or retval.startswith('tk'))
699+
and retval.endswith('-src')):
700+
retval = retval[:-4]
643701
if os.path.exists(retval):
644702
shutil.rmtree(retval)
645703
fp = os.popen("tar zxf %s 2>&1"%(shellQuote(archiveName),), 'r')
@@ -903,6 +961,23 @@ def buildPython():
903961
print("Running make")
904962
runCommand("make")
905963

964+
# For deployment targets of 10.6 and higher, we build our own version
965+
# of Tcl and Cocoa Aqua Tk libs because the Apple-supplied Tk 8.5 is
966+
# out-of-date and has critical bugs. Save the _tkinter.so that was
967+
# linked with /Library/Frameworks/{Tck,Tk}.framework and build
968+
# another _tkinter.so linked with our private Tcl and Tk libs.
969+
if DEPTARGET > '10.5':
970+
runCommand("find build -name '_tkinter.so' "
971+
" -execdir mv '{}' '{}'.framework \;")
972+
print("Running make to rebuild _tkinter")
973+
runCommand("make TCLTK_INCLUDES='-I%s/libraries/usr/local/include' "
974+
"TCLTK_LIBS='-L%s/libraries/usr/local/lib -ltcl8.5 -ltk8.5'"%(
975+
shellQuote(WORKDIR)[1:-1],
976+
shellQuote(WORKDIR)[1:-1]))
977+
# make a backup copy, just in case
978+
runCommand("find build -name '_tkinter.so' "
979+
" -execdir cp -p '{}' '{}'.private \;")
980+
906981
print("Running make install")
907982
runCommand("make install DESTDIR=%s"%(
908983
shellQuote(rootDir)))

Mac/BuildScript/resources/ReadMe.txt

Lines changed: 37 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ This package will install Python $FULL_VERSION for Mac OS X
22
$MACOSX_DEPLOYMENT_TARGET for the following architecture(s):
33
$ARCHITECTURES.
44

5-
Installation requires approximately $INSTALL_SIZE MB of disk space,
6-
ignore the message that it will take zero bytes.
5+
**** IMPORTANT ****
6+
7+
Installing on OS X 10.8 (Mountain Lion) or later systems
8+
========================================================
79

8-
If you are attempting to install on an OS X 10.8 system, you may
10+
If you are attempting to install on an OS X 10.8+ system, you may
911
see a message that Python can't be installed because it is from an
1012
unidentified developer. This is because this Python installer
1113
package is not yet compatible with the Gatekeeper security feature
@@ -15,22 +17,40 @@ instead of double-clicking, control-click or right click the "Python"
1517
installer package icon. Then select "Open using ... Installer" from
1618
the contextual menu that appears.
1719

20+
**** IMPORTANT changes if you use IDLE and Tkinter ****
21+
22+
Installing a third-party version of Tcl/Tk is no longer required
23+
================================================================
24+
25+
Beginning with Python 3.4 alpha2, the 10.6+ 64-bit installer now
26+
comes with its own private copy of Tcl and Tk 8.5 libraries. For
27+
this version of Python, it is no longer necessary to install
28+
a third-party version of Tcl/Tk 8.5, such as those from ActiveState,
29+
to work around the problematic versions of Tcl/Tk 8.5 shipped by
30+
Apple in OS X 10.6 and later. (This does not change the requirements
31+
for older versions of Python installed from python.org.) By default,
32+
this version of Python will always use its own private version,
33+
regardless of whether a third-party Tcl/Tk is installed.
34+
The 10.5+ 32-bit-only installer continues to use Tcl/Tk 8.4,
35+
either a third-party or system-supplied version.
36+
Since this is a new feature, it should be considered somewhat
37+
experimental and subject to change prior to the final release of
38+
Python 3.4. Please report any problems found to the Python bug
39+
tracker at http://bugs.python.org.
40+
41+
Visit http://www.python.org/download/mac/tcltk/
42+
for current information about supported and recommended versions of
43+
Tcl/Tk for this version of Python and of Mac OS X.
44+
45+
Using this version of Python on OS X
46+
====================================
47+
1848
Python consists of the Python programming language interpreter, plus
1949
a set of programs to allow easy access to it for Mac users including
2050
an integrated development environment, IDLE, plus a set of pre-built
2151
extension modules that open up specific Macintosh technologies to
2252
Python programs.
2353

24-
**** IMPORTANT ****
25-
26-
To use IDLE or other programs that use the tkinter graphical user
27-
interface toolkit, you may need to install a third-party version of
28-
the Tcl/Tk frameworks. Visit http://www.python.org/download/mac/tcltk/
29-
for current information about supported and recommended versions of
30-
Tcl/Tk for this version of Python and of Mac OS X.
31-
32-
*******************
33-
3454
The installer puts applications, an "Update Shell Profile" command,
3555
and a link to the optionally installed Python Documentation into the
3656
"Python $VERSION" subfolder of the system Applications folder,
@@ -41,12 +61,15 @@ well. Double-click on the "Update Shell Profile" command to add the
4161
"bin" directory inside the framework to your shell's search path.
4262

4363
You must install onto your current boot disk, even though the
44-
installer does not enforce this, otherwise things will not work.
64+
installer may not enforce this, otherwise things will not work.
4565

4666
You can verify the integrity of the disk image file containing the
4767
installer package and this ReadMe file by comparing its md5 checksum
4868
and size with the values published on the release page linked at
4969
http://www.python.org/download/
5070

71+
Installation requires approximately $INSTALL_SIZE MB of disk space,
72+
ignore the message that it will take zero bytes.
73+
5174
More information on Python in general can be found at
5275
http://www.python.org.

Mac/BuildScript/resources/Welcome.rtf

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
2-
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
1+
{\rtf1\ansi\ansicpg1252\cocoartf1187\cocoasubrtf390
2+
\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
33
{\colortbl;\red255\green255\blue255;}
4-
\paperw11904\paperh16836\margl1440\margr1440\vieww9640\viewh10620\viewkind0
4+
\paperw11905\paperh16837\margl1440\margr1440\vieww9640\viewh10620\viewkind0
55
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640
66

77
\f0\fs24 \cf0 This package will install
@@ -25,11 +25,7 @@ See the ReadMe file and the Python documentation for more information.\
2525
\b0 at any time to make $FULL_VERSION the default Python 3 version. This version can co-exist with other installed versions of Python 3 and Python 2.\
2626
\
2727

28-
\b IMPORTANT:
29-
\b0
30-
\b IDLE
31-
\b0 and other programs using the
32-
\b tkinter
33-
\b0 graphical user interface toolkit require specific versions of the
28+
\b IMPORTANT for users of IDLE and tkinter:
29+
\b0 Beginning with Python 3.4 alpha 2, it is no longer necessary to install third-party versions of the
3430
\b Tcl/Tk
35-
\b0 platform independent windowing toolkit. Visit {\field{\*\fldinst{HYPERLINK "http://www.python.org/download/mac/tcltk/"}}{\fldrslt http://www.python.org/download/mac/tcltk/}} for current information on supported and recommended versions of Tcl/Tk for this version of Python and Mac OS X.}
31+
\b0 platform independent windowing toolkit. Please read the ReadMe file and visit {\field{\*\fldinst{HYPERLINK "http://www.python.org/download/mac/tcltk/"}}{\fldrslt http://www.python.org/download/mac/tcltk/}} for more information on supported and recommended versions of Tcl/Tk for this version of Python and Mac OS X.}

Misc/NEWS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,11 @@ Build
225225
- Issue #1584: Provide configure options to override default search paths for
226226
Tcl and Tk when building _tkinter.
227227

228+
- Issue #15663: Tcl/Tk 8.5.14 is now included with the OS X 10.6+ 64-/32-bit
229+
installer. It is no longer necessary to install a third-party version of
230+
Tcl/Tk 8.5 to work around the problems in the Apple-supplied Tcl/Tk 8.5
231+
shipped in OS X 10.6 and later releases.
232+
228233
Tools/Demos
229234
-----------
230235

0 commit comments

Comments
 (0)