|
1 | 1 | class PythonAT38 < Formula
|
2 | 2 | desc "Interpreted, interactive, object-oriented programming language"
|
3 | 3 | homepage "https://www.python.org/"
|
4 |
| - url "https://www.python.org/ftp/python/3.8.6/Python-3.8.6.tar.xz" |
5 |
| - sha256 "a9e0b79d27aa056eb9cce8d63a427b5f9bab1465dee3f942dcfdb25a82f4ab8a" |
| 4 | + url "https://www.python.org/ftp/python/3.8.7/Python-3.8.7.tar.xz" |
| 5 | + sha256 "ddcc1df16bb5b87aa42ec5d20a5b902f2d088caa269b28e01590f97a798ec50a" |
6 | 6 | license "Python-2.0"
|
7 | 7 |
|
8 | 8 | livecheck do
|
@@ -85,9 +85,9 @@ def install
|
85 | 85 | --with-openssl=#{Formula["openssl@1.1"].opt_prefix}
|
86 | 86 | ]
|
87 | 87 |
|
88 |
| - cflags = [] |
89 |
| - ldflags = [] |
90 |
| - cppflags = [] |
| 88 | + cflags = ["-I#{HOMEBREW_PREFIX}/include"] |
| 89 | + ldflags = ["-L#{HOMEBREW_PREFIX}/lib"] |
| 90 | + cppflags = ["-I#{HOMEBREW_PREFIX}/include"] |
91 | 91 |
|
92 | 92 | if MacOS.sdk_path_if_needed
|
93 | 93 | # Help Python's build system (setuptools/pip) to build things on SDK-based systems
|
@@ -118,7 +118,8 @@ def install
|
118 | 118 | # even if homebrew is not a /usr/local/lib. Try this with:
|
119 | 119 | # `brew install enchant && pip install pyenchant`
|
120 | 120 | inreplace "./Lib/ctypes/macholib/dyld.py" do |f|
|
121 |
| - f.gsub! "DEFAULT_LIBRARY_FALLBACK = [", "DEFAULT_LIBRARY_FALLBACK = [ '#{HOMEBREW_PREFIX}/lib'," |
| 121 | + f.gsub! "DEFAULT_LIBRARY_FALLBACK = [", |
| 122 | + "DEFAULT_LIBRARY_FALLBACK = [ '#{HOMEBREW_PREFIX}/lib', '#{Formula["openssl@1.1"].opt_lib}'," |
122 | 123 | f.gsub! "DEFAULT_FRAMEWORK_FALLBACK = [", "DEFAULT_FRAMEWORK_FALLBACK = [ '#{HOMEBREW_PREFIX}/Frameworks',"
|
123 | 124 | end
|
124 | 125 |
|
@@ -234,11 +235,6 @@ def post_install
|
234 | 235 | (libexec/"bin").install_symlink (bin/versioned_name).realpath => unversioned_name
|
235 | 236 | end
|
236 | 237 |
|
237 |
| - # post_install happens after link |
238 |
| - %W[pip#{xy} easy_install-#{xy}].each do |e| |
239 |
| - (HOMEBREW_PREFIX/"bin").install_symlink bin/e |
240 |
| - end |
241 |
| - |
242 | 238 | # Help distutils find brewed stuff when building extensions
|
243 | 239 | include_dirs = [HOMEBREW_PREFIX/"include", Formula["openssl@1.1"].opt_include,
|
244 | 240 | Formula["sqlite"].opt_include]
|
@@ -287,9 +283,9 @@ def sitecustomize
|
287 | 283 | # site_packages; prefer the shorter paths
|
288 | 284 | long_prefix = re.compile(r'#{rack}/[0-9\._abrc]+/Frameworks/Python\.framework/Versions/#{xy}/lib/python#{xy}/site-packages')
|
289 | 285 | sys.path = [long_prefix.sub('#{HOMEBREW_PREFIX/"lib/python#{xy}/site-packages"}', p) for p in sys.path]
|
290 |
| - # Set the sys.executable to use the opt_prefix, unless explicitly set |
291 |
| - # with PYTHONEXECUTABLE: |
292 |
| - if 'PYTHONEXECUTABLE' not in os.environ: |
| 286 | + # Set the sys.executable to use the opt_prefix. Only do this if PYTHONEXECUTABLE is not |
| 287 | + # explicitly set and we are not in a virtualenv: |
| 288 | + if 'PYTHONEXECUTABLE' not in os.environ and sys.prefix == sys.base_prefix: |
293 | 289 | sys.executable = '#{opt_bin}/python#{xy}'
|
294 | 290 | EOS
|
295 | 291 | end
|
@@ -319,7 +315,11 @@ def caveats
|
319 | 315 | # and it can occur that building sqlite silently fails if OSX's sqlite is used.
|
320 | 316 | system "#{bin}/python#{xy}", "-c", "import sqlite3"
|
321 | 317 | # Check if some other modules import. Then the linked libs are working.
|
322 |
| - system "#{bin}/python#{xy}", "-c", "import tkinter; root = tkinter.Tk()" |
| 318 | + |
| 319 | + # Temporary failure on macOS 11.1 due to https://bugs.python.org/issue42480 |
| 320 | + # Reenable unconditionnaly once Apple fixes the Tcl/Tk issue |
| 321 | + system "#{bin}/python#{xy}", "-c", "import tkinter; root = tkinter.Tk()" if MacOS.full_version < "11.1" |
| 322 | + |
323 | 323 | system "#{bin}/python#{xy}", "-c", "import _gdbm"
|
324 | 324 | system "#{bin}/python#{xy}", "-c", "import zlib"
|
325 | 325 | system "#{bin}/python#{xy}", "-c", "import ssl"
|
|
0 commit comments