Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

Commit

Permalink
Fix PYTHONFRAMEWORKDIR for Xcode with CLT
Browse files Browse the repository at this point in the history
PYTHONFRAMEWORKDIR is now replaced even if CLT is installed.

Closes #17144.

Signed-off-by: Adam Vandenberg <[email protected]>
  • Loading branch information
tomyun authored and adamv committed Jan 17, 2013
1 parent fbf91ba commit 902d222
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Library/Formula/python.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 902d222

Please sign in to comment.