Skip to content
This repository has been archived by the owner on Jan 16, 2025. It is now read-only.
/ legacy-homebrew Public archive

Fix PYTHONFRAMEWORKDIR for Xcode with CLT #17144

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix PYTHONFRAMEWORKDIR for Xcode with CLT
PYTHONFRAMEWORKDIR is now replaced even if CLT is installed.
tomyun committed Jan 17, 2013
commit 5f89fa9a490abadb4e880a24f98f889ed63d1af6
9 changes: 5 additions & 4 deletions Library/Formula/python.rb
Original file line number Diff line number Diff line change
@@ -164,15 +164,16 @@ def install
install-lib=#{site_packages}
EOF

unless MacOS::CLT.installed?
makefile = prefix/'Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/Makefile'
inreplace makefile do |s|
makefile = prefix/'Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/Makefile'
inreplace makefile do |s|
unless MacOS::CLT.installed?
s.gsub!(/^CC=.*$/, "CC=xcrun clang")
s.gsub!(/^CXX=.*$/, "CXX=xcrun clang++")
s.gsub!(/^AR=.*$/, "AR=xcrun ar")
s.gsub!(/^RANLIB=.*$/, "RANLIB=xcrun ranlib")
s.gsub!(/^PYTHONFRAMEWORKDIR=\tPython\.framework/, "PYTHONFRAMEWORKDIR= #{opt_prefix}/Frameworks/Python.framework")
end
# Should be fixed regardless of CLT (for `python-config --ldflags`)
s.gsub!(/^PYTHONFRAMEWORKDIR=\tPython\.framework/, "PYTHONFRAMEWORKDIR= #{opt_prefix}/Frameworks/Python.framework")
end

end