Skip to content

Commit d252f90

Browse files
committed
Python 3.8.7; sync to upstream
Closes #111. Signed-off-by: Aleks Bunin <868842+sashkab@users.noreply.github.com>
1 parent 9dc82a3 commit d252f90

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

Formula/python@3.8.rb

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
class PythonAT38 < Formula
22
desc "Interpreted, interactive, object-oriented programming language"
33
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"
66
license "Python-2.0"
77

88
livecheck do
@@ -85,9 +85,9 @@ def install
8585
--with-openssl=#{Formula["openssl@1.1"].opt_prefix}
8686
]
8787

88-
cflags = []
89-
ldflags = []
90-
cppflags = []
88+
cflags = ["-I#{HOMEBREW_PREFIX}/include"]
89+
ldflags = ["-L#{HOMEBREW_PREFIX}/lib"]
90+
cppflags = ["-I#{HOMEBREW_PREFIX}/include"]
9191

9292
if MacOS.sdk_path_if_needed
9393
# Help Python's build system (setuptools/pip) to build things on SDK-based systems
@@ -118,7 +118,8 @@ def install
118118
# even if homebrew is not a /usr/local/lib. Try this with:
119119
# `brew install enchant && pip install pyenchant`
120120
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}',"
122123
f.gsub! "DEFAULT_FRAMEWORK_FALLBACK = [", "DEFAULT_FRAMEWORK_FALLBACK = [ '#{HOMEBREW_PREFIX}/Frameworks',"
123124
end
124125

@@ -234,11 +235,6 @@ def post_install
234235
(libexec/"bin").install_symlink (bin/versioned_name).realpath => unversioned_name
235236
end
236237

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-
242238
# Help distutils find brewed stuff when building extensions
243239
include_dirs = [HOMEBREW_PREFIX/"include", Formula["openssl@1.1"].opt_include,
244240
Formula["sqlite"].opt_include]
@@ -287,9 +283,9 @@ def sitecustomize
287283
# site_packages; prefer the shorter paths
288284
long_prefix = re.compile(r'#{rack}/[0-9\._abrc]+/Frameworks/Python\.framework/Versions/#{xy}/lib/python#{xy}/site-packages')
289285
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:
293289
sys.executable = '#{opt_bin}/python#{xy}'
294290
EOS
295291
end
@@ -319,7 +315,11 @@ def caveats
319315
# and it can occur that building sqlite silently fails if OSX's sqlite is used.
320316
system "#{bin}/python#{xy}", "-c", "import sqlite3"
321317
# 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+
323323
system "#{bin}/python#{xy}", "-c", "import _gdbm"
324324
system "#{bin}/python#{xy}", "-c", "import zlib"
325325
system "#{bin}/python#{xy}", "-c", "import ssl"

0 commit comments

Comments
 (0)