Skip to content

Instantly share code, notes, and snippets.

@eblot
Created August 14, 2019 16:06
Show Gist options
  • Save eblot/32a30be8df405b0832be68bd925199e6 to your computer and use it in GitHub Desktop.
Save eblot/32a30be8df405b0832be68bd925199e6 to your computer and use it in GitHub Desktop.
Build Homebrew's Python3 intepreter with debug symbols
diff --git a/Formula/python.rb b/Formula/python.rb
index 0d799476..6b1b2ad0 100644
--- a/Formula/python.rb
+++ b/Formula/python.rb
@@ -113,10 +113,13 @@ class Python < Formula
system "./configure", *args
system "make"
+ system "xcrun dsymutil Python.framework/Versions/#{xy}/Python"
ENV.deparallelize do
# Tell Python not to install into /Applications (default for framework builds)
system "make", "install", "PYTHONAPPSDIR=#{prefix}"
+ # There's likely a better way to copy a subdirectory tree with Homebrew, but I'm tired of Ruby syntax
+ system "tar cf - Python.framework/Versions/#{xy}/Python.dSYM | tar xvf - -C #{frameworks}"
system "make", "frameworkinstallextras", "PYTHONAPPSDIR=#{pkgshare}"
end
@eblot
Copy link
Author

eblot commented Aug 14, 2019

Note: Patching Homebrew's cc file is also required to prevent brew from stripping out -g

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment