From 3ff958e1abd1520c143422676fce0cacbcd1e402 Mon Sep 17 00:00:00 2001 From: Anthony Shaw Date: Mon, 30 Dec 2019 21:43:36 +1100 Subject: [PATCH 1/3] Store the joined path in another variable, so that when the path is tested for existence, it's then later added to the include --- setup.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/setup.py b/setup.py index 02f523c42d355f..f4721818b708f5 100644 --- a/setup.py +++ b/setup.py @@ -1769,16 +1769,15 @@ def detect_tkinter_darwin(self): for F in framework_dirs: # both Tcl.framework and Tk.framework should be present - for fw in 'Tcl', 'Tk': if is_macosx_sdk_path(F): - if not exists(join(sysroot, F[1:], fw + '.framework')): - break + framework_path = join(sysroot, F[1:], fw + '.framework') else: - if not exists(join(F, fw + '.framework')): - break + framework_path = join(F, fw + '.framework') + if not exists(framework_path): + break else: - # ok, F is now directory with both frameworks. Continure + # ok, framework_path is now directory with both frameworks. Continue # building break else: @@ -1791,7 +1790,7 @@ def detect_tkinter_darwin(self): # the -F option to gcc, which specifies a framework lookup path. # include_dirs = [ - join(F, fw + '.framework', H) + join(framework_path, fw + '.framework', H) for fw in ('Tcl', 'Tk') for H in ('Headers', 'Versions/Current/PrivateHeaders') ] From 7483576177d19d361dcd4d28feb5dbdc9739b11c Mon Sep 17 00:00:00 2001 From: Anthony Shaw Date: Mon, 30 Dec 2019 21:49:31 +1100 Subject: [PATCH 2/3] Stop the path from repeating itself twice --- setup.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index f4721818b708f5..216defe51f2959 100644 --- a/setup.py +++ b/setup.py @@ -1771,10 +1771,10 @@ def detect_tkinter_darwin(self): for fw in 'Tcl', 'Tk': if is_macosx_sdk_path(F): - framework_path = join(sysroot, F[1:], fw + '.framework') + framework_path = join(sysroot, F[1:]) else: - framework_path = join(F, fw + '.framework') - if not exists(framework_path): + framework_path = F + if not exists(join(framework_path, fw + '.framework')): break else: # ok, framework_path is now directory with both frameworks. Continue @@ -1794,7 +1794,6 @@ def detect_tkinter_darwin(self): for fw in ('Tcl', 'Tk') for H in ('Headers', 'Versions/Current/PrivateHeaders') ] - # For 8.4a2, the X11 headers are not included. Rather than include a # complicated search, this is a hard-coded path. It could bail out # if X11 libs are not found... From eaca3cf88cfe520de3b01cf72cf56c3facf4a001 Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" <43283697+blurb-it[bot]@users.noreply.github.com> Date: Mon, 30 Dec 2019 10:54:53 +0000 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20blu?= =?UTF-8?q?rb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Misc/NEWS.d/next/Build/2019-12-30-10-54-49.bpo-39162.go2bIN.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Build/2019-12-30-10-54-49.bpo-39162.go2bIN.rst diff --git a/Misc/NEWS.d/next/Build/2019-12-30-10-54-49.bpo-39162.go2bIN.rst b/Misc/NEWS.d/next/Build/2019-12-30-10-54-49.bpo-39162.go2bIN.rst new file mode 100644 index 00000000000000..3521dd3005486b --- /dev/null +++ b/Misc/NEWS.d/next/Build/2019-12-30-10-54-49.bpo-39162.go2bIN.rst @@ -0,0 +1 @@ +Fixed an issue where the macOS SDK path wouldn't be discovered by setup.py, meaning _tkinter failed to build on macOS 10.15. \ No newline at end of file