summaryrefslogtreecommitdiffstats
path: root/Mac
diff options
context:
space:
mode:
authorNed Deily <nad@acm.org>2013-09-06 08:18:36 (GMT)
committerNed Deily <nad@acm.org>2013-09-06 08:18:36 (GMT)
commit981b69318dac330eb14cb78aeb6b337f42cd9d22 (patch)
treeb430b9fc8bde45d1ff1b20ce96e66fc5ef8937a1 /Mac
parentd819b931f35852e1399f73ea19b74920ffde2651 (diff)
downloadcpython-981b69318dac330eb14cb78aeb6b337f42cd9d22.zip
cpython-981b69318dac330eb14cb78aeb6b337f42cd9d22.tar.gz
cpython-981b69318dac330eb14cb78aeb6b337f42cd9d22.tar.bz2
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.
Diffstat (limited to 'Mac')
-rw-r--r--Mac/BuildScript/README.txt33
-rwxr-xr-xMac/BuildScript/build-installer.py77
-rw-r--r--Mac/BuildScript/resources/ReadMe.txt51
-rw-r--r--Mac/BuildScript/resources/Welcome.rtf16
4 files changed, 150 insertions, 27 deletions
diff --git a/Mac/BuildScript/README.txt b/Mac/BuildScript/README.txt
index fa04b97..6c08dbe 100644
--- a/Mac/BuildScript/README.txt
+++ b/Mac/BuildScript/README.txt
@@ -57,13 +57,42 @@ for each release.
* NCurses 5.9 (http://bugs.python.org/issue15037)
* SQLite 3.7.13
+ * Tcl 8.5.14
+ * Tk 8.5.14
* XZ 5.0.3
- uses system-supplied versions of third-party libraries
* readline module links with Apple BSD editline (libedit)
- - requires ActiveState Tcl/Tk 8.5.9 (or later) to be installed for building
+ - requires ActiveState Tcl/Tk 8.5.14 (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.14 libraries and thus is no longer
+ dependent on the buggy releases of Aqua Cocoa Tk 8.5 shipped with
+ OS X 10.6 or on installing a newer third-party version of Tcl/Tk
+ in /Library/Frameworks, such as from ActiveState. Because this
+ is a new feature, it should be considered somewhat experimental and
+ subject to change prior to the final release of Python 3.4. If it
+ is necessary to fallback to using a third-party Tcl/Tk because of
+ a problem with the private Tcl/Tk, there is a backup version of
+ the _tkinter extension included which will dynamically link to
+ Tcl and Tk frameworks in /Library/Frameworks as in previous releases.
+ To enable (for all users of this Python 3.4)::
+
+ sudo bash
+ cd /Library/Frameworks/Python.framework/Versions/3.4
+ cd ./lib/python3.4/lib-dynload
+ cp -p _tkinter.so.framework _tkinter.so
+ exit
+
+ To restore using Python's private versions of Tcl and Tk::
+
+ sudo bash
+ cd /Library/Frameworks/Python.framework/Versions/3.4
+ cd ./lib/python3.4/lib-dynload
+ cp -p _tkinter.so.private _tkinter.so
+ exit
- recommended build environment:
@@ -82,7 +111,7 @@ for each release.
considered a migration aid by Apple and is not likely to be fixed,
its use should be avoided. The other compiler, ``clang``, has been
undergoing rapid development. While it appears to have become
- production-ready in the most recent Xcode 4 releases (Xcode 4.4.1
+ production-ready in the most recent Xcode 4 releases (Xcode 4.6.3
as of this writing), there are still some open issues when
building Python and there has not yet been the level of exposure in
production environments that the Xcode 3 gcc-4.2 compiler has had.
diff --git a/Mac/BuildScript/build-installer.py b/Mac/BuildScript/build-installer.py
index 41af0d3..19ed8e8 100755
--- a/Mac/BuildScript/build-installer.py
+++ b/Mac/BuildScript/build-installer.py
@@ -192,6 +192,44 @@ def library_recipes():
LT_10_5 = bool(DEPTARGET < '10.5')
+ if DEPTARGET > '10.5':
+ result.extend([
+ dict(
+ name="Tcl 8.5.14",
+ url="ftp://ftp.tcl.tk/pub/tcl//tcl8_5/tcl8.5.14-src.tar.gz",
+ checksum='44b50e58ab45dd272f6714dce2129123',
+ buildDir="unix",
+ configure_pre=[
+ '--enable-shared',
+ '--enable-threads',
+ '--libdir=/Library/Frameworks/Python.framework/Versions/%s/lib'%(getVersion(),),
+ ],
+ useLDFlags=False,
+ install='make TCL_LIBRARY=%(TCL_LIBRARY)s && make install TCL_LIBRARY=%(TCL_LIBRARY)s DESTDIR=%(DESTDIR)s'%{
+ "DESTDIR": shellQuote(os.path.join(WORKDIR, 'libraries')),
+ "TCL_LIBRARY": shellQuote('/Library/Frameworks/Python.framework/Versions/%s/lib/tcl8.5'%(getVersion())),
+ },
+ ),
+ dict(
+ name="Tk 8.5.14",
+ url="ftp://ftp.tcl.tk/pub/tcl//tcl8_5/tk8.5.14-src.tar.gz",
+ checksum='a9c48921b3688020470cd3a6dd4e867d',
+ buildDir="unix",
+ configure_pre=[
+ '--enable-aqua',
+ '--enable-shared',
+ '--enable-threads',
+ '--libdir=/Library/Frameworks/Python.framework/Versions/%s/lib'%(getVersion(),),
+ ],
+ useLDFlags=False,
+ 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'%{
+ "DESTDIR": shellQuote(os.path.join(WORKDIR, 'libraries')),
+ "TCL_LIBRARY": shellQuote('/Library/Frameworks/Python.framework/Versions/%s/lib/tcl8.5'%(getVersion())),
+ "TK_LIBRARY": shellQuote('/Library/Frameworks/Python.framework/Versions/%s/lib/tk8.5'%(getVersion())),
+ },
+ ),
+ ])
+
if getVersionTuple() >= (3, 3):
result.extend([
dict(
@@ -525,6 +563,20 @@ def checkEnvironment():
% frameworks['Tk'],
]
+ # For 10.6+ builds, we build two versions of _tkinter:
+ # - the traditional version (renamed to _tkinter.so.framework) linked
+ # with /Library/Frameworks/{Tcl,Tk}.framework
+ # - the default version linked with our private copies of Tcl and Tk
+ if DEPTARGET > '10.5':
+ EXPECTED_SHARED_LIBS['_tkinter.so.framework'] = \
+ EXPECTED_SHARED_LIBS['_tkinter.so']
+ EXPECTED_SHARED_LIBS['_tkinter.so'] = [
+ "/Library/Frameworks/Python.framework/Versions/%s/lib/libtcl%s.dylib"
+ % (getVersion(), frameworks['Tcl']),
+ "/Library/Frameworks/Python.framework/Versions/%s/lib/libtk%s.dylib"
+ % (getVersion(), frameworks['Tk']),
+ ]
+
# Remove inherited environment variables which might influence build
environ_var_prefixes = ['CPATH', 'C_INCLUDE_', 'DYLD_', 'LANG', 'LC_',
'LD_', 'LIBRARY_', 'PATH', 'PYTHON']
@@ -633,13 +685,19 @@ def extractArchive(builddir, archiveName):
XXX: This function assumes that archives contain a toplevel directory
that is has the same name as the basename of the archive. This is
- save enough for anything we use.
+ safe enough for almost anything we use. Unfortunately, it does not
+ work for current Tcl and Tk source releases where the basename of
+ the archive ends with "-src" but the uncompressed directory does not.
+ For now, just special case Tcl and Tk tar.gz downloads.
"""
curdir = os.getcwd()
try:
os.chdir(builddir)
if archiveName.endswith('.tar.gz'):
retval = os.path.basename(archiveName[:-7])
+ if ((retval.startswith('tcl') or retval.startswith('tk'))
+ and retval.endswith('-src')):
+ retval = retval[:-4]
if os.path.exists(retval):
shutil.rmtree(retval)
fp = os.popen("tar zxf %s 2>&1"%(shellQuote(archiveName),), 'r')
@@ -903,6 +961,23 @@ def buildPython():
print("Running make")
runCommand("make")
+ # For deployment targets of 10.6 and higher, we build our own version
+ # 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
+ # another _tkinter.so linked with our private Tcl and Tk libs.
+ if DEPTARGET > '10.5':
+ runCommand("find build -name '_tkinter.so' "
+ " -execdir mv '{}' '{}'.framework \;")
+ print("Running make to rebuild _tkinter")
+ runCommand("make TCLTK_INCLUDES='-I%s/libraries/usr/local/include' "
+ "TCLTK_LIBS='-L%s/libraries/usr/local/lib -ltcl8.5 -ltk8.5'"%(
+ shellQuote(WORKDIR)[1:-1],
+ shellQuote(WORKDIR)[1:-1]))
+ # make a backup copy, just in case
+ runCommand("find build -name '_tkinter.so' "
+ " -execdir cp -p '{}' '{}'.private \;")
+
print("Running make install")
runCommand("make install DESTDIR=%s"%(
shellQuote(rootDir)))
diff --git a/Mac/BuildScript/resources/ReadMe.txt b/Mac/BuildScript/resources/ReadMe.txt
index 9ac52d0..4b3be91 100644
--- a/Mac/BuildScript/resources/ReadMe.txt
+++ b/Mac/BuildScript/resources/ReadMe.txt
@@ -2,10 +2,12 @@ This package will install Python $FULL_VERSION for Mac OS X
$MACOSX_DEPLOYMENT_TARGET for the following architecture(s):
$ARCHITECTURES.
-Installation requires approximately $INSTALL_SIZE MB of disk space,
-ignore the message that it will take zero bytes.
+ **** IMPORTANT ****
+
+Installing on OS X 10.8 (Mountain Lion) or later systems
+========================================================
-If you are attempting to install on an OS X 10.8 system, you may
+If you are attempting to install on an OS X 10.8+ system, you may
see a message that Python can't be installed because it is from an
unidentified developer. This is because this Python installer
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"
installer package icon. Then select "Open using ... Installer" from
the contextual menu that appears.
+ **** IMPORTANT changes if you use IDLE and Tkinter ****
+
+Installing a third-party version of Tcl/Tk is no longer required
+================================================================
+
+Beginning with Python 3.4 alpha2, the 10.6+ 64-bit installer now
+comes with its own private copy of Tcl and Tk 8.5 libraries. For
+this version of Python, it is no longer necessary to install
+a third-party version of Tcl/Tk 8.5, such as those from ActiveState,
+to work around the problematic versions of Tcl/Tk 8.5 shipped by
+Apple in OS X 10.6 and later. (This does not change the requirements
+for older versions of Python installed from python.org.) By default,
+this version of Python will always use its own private version,
+regardless of whether a third-party Tcl/Tk is installed.
+The 10.5+ 32-bit-only installer continues to use Tcl/Tk 8.4,
+either a third-party or system-supplied version.
+Since this is a new feature, it should be considered somewhat
+experimental and subject to change prior to the final release of
+Python 3.4. Please report any problems found to the Python bug
+tracker at http://bugs.python.org.
+
+Visit http://www.python.org/download/mac/tcltk/
+for current information about supported and recommended versions of
+Tcl/Tk for this version of Python and of Mac OS X.
+
+Using this version of Python on OS X
+====================================
+
Python consists of the Python programming language interpreter, plus
a set of programs to allow easy access to it for Mac users including
an integrated development environment, IDLE, plus a set of pre-built
extension modules that open up specific Macintosh technologies to
Python programs.
- **** IMPORTANT ****
-
-To use IDLE or other programs that use the tkinter graphical user
-interface toolkit, you may need to install a third-party version of
-the Tcl/Tk frameworks. Visit http://www.python.org/download/mac/tcltk/
-for current information about supported and recommended versions of
-Tcl/Tk for this version of Python and of Mac OS X.
-
- *******************
-
The installer puts applications, an "Update Shell Profile" command,
and a link to the optionally installed Python Documentation into the
"Python $VERSION" subfolder of the system Applications folder,
@@ -41,12 +61,15 @@ well. Double-click on the "Update Shell Profile" command to add the
"bin" directory inside the framework to your shell's search path.
You must install onto your current boot disk, even though the
-installer does not enforce this, otherwise things will not work.
+installer may not enforce this, otherwise things will not work.
You can verify the integrity of the disk image file containing the
installer package and this ReadMe file by comparing its md5 checksum
and size with the values published on the release page linked at
http://www.python.org/download/
+Installation requires approximately $INSTALL_SIZE MB of disk space,
+ignore the message that it will take zero bytes.
+
More information on Python in general can be found at
http://www.python.org.
diff --git a/Mac/BuildScript/resources/Welcome.rtf b/Mac/BuildScript/resources/Welcome.rtf
index 86fbf63..6c64f6f 100644
--- a/Mac/BuildScript/resources/Welcome.rtf
+++ b/Mac/BuildScript/resources/Welcome.rtf
@@ -1,7 +1,7 @@
-{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
-{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
+{\rtf1\ansi\ansicpg1252\cocoartf1187\cocoasubrtf390
+\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
-\paperw11904\paperh16836\margl1440\margr1440\vieww9640\viewh10620\viewkind0
+\paperw11905\paperh16837\margl1440\margr1440\vieww9640\viewh10620\viewkind0
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640
\f0\fs24 \cf0 This package will install
@@ -25,11 +25,7 @@ See the ReadMe file and the Python documentation for more information.\
\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.\
\
-\b IMPORTANT:
-\b0
-\b IDLE
-\b0 and other programs using the
-\b tkinter
-\b0 graphical user interface toolkit require specific versions of the
+\b IMPORTANT for users of IDLE and tkinter:
+\b0 Beginning with Python 3.4 alpha 2, it is no longer necessary to install third-party versions of the
\b Tcl/Tk
-\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.} \ No newline at end of file
+\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.} \ No newline at end of file