Fix PYTHONFRAMEWORKDIR for Xcode with CLT

PYTHONFRAMEWORKDIR is now replaced even if CLT is installed.

Closes Homebrew/homebrew#17144.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
This commit is contained in:
Kyungdahm Yun 2013-01-18 00:01:37 +09:00 committed by Adam Vandenberg
parent 7b08ae35d7
commit b52748dc13

View file

@ -164,15 +164,16 @@ class Python < Formula
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