Mercurial > cpython-lru_cache-weakref
diff Mac/BuildScript/build-installer.py @ 85560:985384cd6365
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.
| author | Ned Deily <nad@acm.org> |
|---|---|
| date | Fri, 06 Sep 2013 01:18:36 -0700 |
| parents | 6b28bfff9204 |
| children | 286a0e47bdb8 |
line wrap: on
line diff
--- a/Mac/BuildScript/build-installer.py Fri Sep 06 01:07:05 2013 -0700 +++ b/Mac/BuildScript/build-installer.py Fri Sep 06 01:18:36 2013 -0700 @@ -192,6 +192,44 @@ 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 @@ % 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 @@ 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 @@ 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)))
