-
-
Notifications
You must be signed in to change notification settings - Fork 12.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[email protected]: use our own tcl-tk
Closes #70249. Signed-off-by: Carlo Cabrera <[email protected]>
- Loading branch information
Showing
1 changed file
with
8 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ class PythonAT38 < Formula | |
url "https://www.python.org/ftp/python/3.8.7/Python-3.8.7.tar.xz" | ||
sha256 "ddcc1df16bb5b87aa42ec5d20a5b902f2d088caa269b28e01590f97a798ec50a" | ||
license "Python-2.0" | ||
revision 1 | ||
revision 2 | ||
|
||
livecheck do | ||
url "https://www.python.org/ftp/python/" | ||
|
@@ -36,6 +36,7 @@ class PythonAT38 < Formula | |
depends_on "[email protected]" | ||
depends_on "readline" | ||
depends_on "sqlite" | ||
depends_on "tcl-tk" | ||
depends_on "xz" | ||
|
||
uses_from_macos "bzip2" | ||
|
@@ -117,14 +118,13 @@ def install | |
# The setup.py looks at "-isysroot" to get the sysroot (and not at --sysroot) | ||
cflags << "-isysroot #{MacOS.sdk_path}" | ||
ldflags << "-isysroot #{MacOS.sdk_path}" | ||
# For the Xlib.h, Python needs this header dir with the system Tk | ||
# Yep, this needs the absolute path where zlib needed a path relative | ||
# to the SDK. | ||
cflags << "-isystem #{MacOS.sdk_path}/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers" | ||
end | ||
# Avoid linking to libgcc https://mail.python.org/pipermail/python-dev/2012-February/116205.html | ||
args << "MACOSX_DEPLOYMENT_TARGET=#{MacOS.version}" | ||
|
||
args << "--with-tcltk-includes=-I#{Formula["tcl-tk"].opt_include}" | ||
args << "--with-tcltk-libs=-L#{Formula["tcl-tk"].opt_lib} -ltcl8.6 -ltk8.6" | ||
|
||
# We want our readline! This is just to outsmart the detection code, | ||
# superenv makes cc always find includes/libs! | ||
inreplace "setup.py", | ||
|
@@ -259,9 +259,9 @@ def post_install | |
|
||
# Help distutils find brewed stuff when building extensions | ||
include_dirs = [HOMEBREW_PREFIX/"include", Formula["[email protected]"].opt_include, | ||
Formula["sqlite"].opt_include] | ||
Formula["sqlite"].opt_include], Formula["tcl-tk"].opt_include | ||
library_dirs = [HOMEBREW_PREFIX/"lib", Formula["[email protected]"].opt_lib, | ||
Formula["sqlite"].opt_lib] | ||
Formula["sqlite"].opt_lib], Formula["tcl-tk"].opt_lib | ||
|
||
cfg = prefix/"Frameworks/Python.framework/Versions/#{xy}/lib/python#{xy}/distutils/distutils.cfg" | ||
|
||
|
@@ -343,10 +343,7 @@ def caveats | |
# Check if some other modules import. Then the linked libs are working. | ||
system "#{bin}/python#{xy}", "-c", "import _gdbm" | ||
system "#{bin}/python#{xy}", "-c", "import zlib" | ||
|
||
# Temporary failure on macOS 11.1 due to https://bugs.python.org/issue42480 | ||
# Reenable unconditionnaly once Apple fixes the Tcl/Tk issue | ||
system "#{bin}/python#{xy}", "-c", "import tkinter; root = tkinter.Tk()" if MacOS.full_version < "11.1" | ||
system "#{bin}/python#{xy}", "-c", "import tkinter; root = tkinter.Tk()" | ||
|
||
system bin/"pip3", "list", "--format=columns" | ||
end | ||
|