bpo-42361: Use Tcl/Tk 8.6.10 when building the installer on recent macOS (GH-23293)

Building on older versions, and in particular macOS 10.9 still use
Tk 8.6.8 because of build problems on that version of macOS.
This commit is contained in:
Ronald Oussoren 2020-11-22 03:05:34 +01:00 committed by GitHub
parent 0f20bd9042
commit 690a5fa3dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 32 additions and 9 deletions

View File

@ -153,6 +153,9 @@ DEPTARGET = '10.5'
def getDeptargetTuple(): def getDeptargetTuple():
return tuple([int(n) for n in DEPTARGET.split('.')[0:2]]) return tuple([int(n) for n in DEPTARGET.split('.')[0:2]])
def getBuildTuple():
return tuple([int(n) for n in platform.mac_ver()[0].split('.')[0:2]])
def getTargetCompilers(): def getTargetCompilers():
target_cc_map = { target_cc_map = {
'10.4': ('gcc-4.0', 'g++-4.0'), '10.4': ('gcc-4.0', 'g++-4.0'),
@ -192,6 +195,13 @@ EXPECTED_SHARED_LIBS = {}
def internalTk(): def internalTk():
return getDeptargetTuple() >= (10, 6) return getDeptargetTuple() >= (10, 6)
# Do we use 8.6.8 when building our own copy
# of Tcl/Tk or a modern version.
# We use the old version when buildin on
# old versions of macOS due to build issues.
def useOldTk():
return getBuildTuple() < (10, 15)
def tweak_tcl_build(basedir, archList): def tweak_tcl_build(basedir, archList):
with open("Makefile", "r") as fp: with open("Makefile", "r") as fp:
@ -245,11 +255,26 @@ def library_recipes():
]) ])
if internalTk(): if internalTk():
if useOldTk():
tcl_tk_ver='8.6.8'
tcl_checksum='81656d3367af032e0ae6157eff134f89'
tk_checksum='5e0faecba458ee1386078fb228d008ba'
tk_patches = ['tk868_on_10_8_10_9.patch']
else:
tcl_tk_ver='8.6.10'
tcl_checksum='97c55573f8520bcab74e21bfd8d0aadc'
tk_checksum='602a47ad9ecac7bf655ada729d140a94'
tk_patches = [ ]
result.extend([ result.extend([
dict( dict(
name="Tcl 8.6.8", name="Tcl %s"%(tcl_tk_ver,),
url="ftp://ftp.tcl.tk/pub/tcl//tcl8_6/tcl8.6.8-src.tar.gz", url="ftp://ftp.tcl.tk/pub/tcl//tcl8_6/tcl%s-src.tar.gz"%(tcl_tk_ver,),
checksum='81656d3367af032e0ae6157eff134f89', checksum=tcl_checksum,
buildDir="unix", buildDir="unix",
configure_pre=[ configure_pre=[
'--enable-shared', '--enable-shared',
@ -264,12 +289,10 @@ def library_recipes():
}, },
), ),
dict( dict(
name="Tk 8.6.8", name="Tk %s"%(tcl_tk_ver,),
url="ftp://ftp.tcl.tk/pub/tcl//tcl8_6/tk8.6.8-src.tar.gz", url="ftp://ftp.tcl.tk/pub/tcl//tcl8_6/tk%s-src.tar.gz"%(tcl_tk_ver,),
checksum='5e0faecba458ee1386078fb228d008ba', checksum=tk_checksum,
patches=[ patches=tk_patches,
"tk868_on_10_8_10_9.patch",
],
buildDir="unix", buildDir="unix",
configure_pre=[ configure_pre=[
'--enable-aqua', '--enable-aqua',