aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXu Cheng2015-01-27 13:05:49 +0800
committerMike McQuaid2015-01-27 12:42:25 +0000
commitb642ad2f610fc8af9a01fec0720bd93b995fda5f (patch)
tree7f8ce6c73e028a96196be2be46c3921c38d71058
parent83095d7311eabec074dab58f5bd81dc7a59cb633 (diff)
downloadhomebrew-b642ad2f610fc8af9a01fec0720bd93b995fda5f.tar.bz2
llvm: fix python binding
This commit fixes three things: * Python 2.7 is required, so using brew python for old Mac OS X. * Install python bindings no matter which python we build aginst system or brew * Clarify `with-python` option Closes #36229. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
-rw-r--r--Library/Formula/llvm.rb17
1 files changed, 8 insertions, 9 deletions
diff --git a/Library/Formula/llvm.rb b/Library/Formula/llvm.rb
index 1872a2fd2..5f5802450 100644
--- a/Library/Formula/llvm.rb
+++ b/Library/Formula/llvm.rb
@@ -70,6 +70,7 @@ class Llvm < Formula
option "with-lldb", "Build LLDB debugger"
option "with-rtti", "Build with C++ RTTI"
option "with-all-targets", "Build all target backends"
+ option "with-python", "Build Python bindings against Homebrew Python"
option "without-shared", "Don't build LLVM as a shared library"
option "without-assertions", "Speeds up LLVM, but provides less debug information"
@@ -78,7 +79,11 @@ class Llvm < Formula
deprecated_option "disable-shared" => "without-shared"
deprecated_option "disable-assertions" => "without-assertions"
- depends_on :python => :optional
+ if MacOS.version <= :snow_leopard
+ depends_on :python
+ else
+ depends_on :python => :optional
+ end
depends_on "swig" if build.with? "lldb"
keg_only :provided_by_osx
@@ -91,10 +96,6 @@ class Llvm < Formula
# Apple's libstdc++ is too old to build LLVM
ENV.libcxx if ENV.compiler == :clang
- if build.with?("python") && build.without?("shared")
- fail "The Python bindings need the shared library."
- end
-
if build.with?("lldb") && build.without?("clang")
fail "Building LLDB needs Clang support library."
end
@@ -148,10 +149,8 @@ class Llvm < Formula
end
# install llvm python bindings
- if build.with? "python"
- (lib+"python2.7/site-packages").install buildpath/"bindings/python/llvm"
- (lib+"python2.7/site-packages").install buildpath/"tools/clang/bindings/python/clang" if build.with? "clang"
- end
+ (lib+"python2.7/site-packages").install buildpath/"bindings/python/llvm"
+ (lib+"python2.7/site-packages").install buildpath/"tools/clang/bindings/python/clang" if build.with? "clang"
end
test do