From b642ad2f610fc8af9a01fec0720bd93b995fda5f Mon Sep 17 00:00:00 2001 From: Xu Cheng Date: Tue, 27 Jan 2015 13:05:49 +0800 Subject: 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 --- Library/Formula/llvm.rb | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'Library') 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 -- cgit v1.2.3