aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim D. Smith2014-12-12 21:23:31 -0800
committerTim D. Smith2014-12-13 11:49:21 -0800
commit8a6fece25e954f368cd3f4a7130531a7eeddfb71 (patch)
treecdbbf2581d26ae805a36a0331c95cf5c8efbb7dd
parent2b190c0c74d5e37d875ed08091cd425d2dcc52f0 (diff)
downloadhomebrew-8a6fece25e954f368cd3f4a7130531a7eeddfb71.tar.bz2
bottle pyside and shiboken against system Python
pyside and shiboken can be built against system Python and imported with Homebrew's Python; use `option "without-python"` instead of `depends_on :python` in order to bottle against system Python so we don't install Homebrew's python unnecessarily. Closes #34945.
-rw-r--r--Library/Formula/pyside.rb4
-rw-r--r--Library/Formula/shiboken.rb14
2 files changed, 9 insertions, 9 deletions
diff --git a/Library/Formula/pyside.rb b/Library/Formula/pyside.rb
index f971287c1..dc2d08ee2 100644
--- a/Library/Formula/pyside.rb
+++ b/Library/Formula/pyside.rb
@@ -8,7 +8,9 @@ class Pyside < Formula
head 'git://gitorious.org/pyside/pyside.git'
- depends_on :python => :recommended
+ # don't use depends_on :python because then bottles install Homebrew's python
+ option "without-python", "Build without python 2 support"
+ depends_on :python => :recommended if MacOS.version <= :snow_leopard
depends_on :python3 => :optional
option "without-docs", "Skip building documentation"
diff --git a/Library/Formula/shiboken.rb b/Library/Formula/shiboken.rb
index 9575b7588..37f95ec00 100644
--- a/Library/Formula/shiboken.rb
+++ b/Library/Formula/shiboken.rb
@@ -18,7 +18,9 @@ class Shiboken < Formula
depends_on 'cmake' => :build
depends_on 'qt'
- depends_on :python => :recommended
+ # don't use depends_on :python because then bottles install Homebrew's python
+ option "without-python", "Build without python 2 support"
+ depends_on :python => :recommended if MacOS.version <= :snow_leopard
depends_on :python3 => :optional
def install
@@ -29,16 +31,12 @@ class Shiboken < Formula
args = std_cmake_args
# Building the tests also runs them.
args << "-DBUILD_TESTS=ON"
- # if not System Python
- python_framework = "#{Formula[python].opt_prefix}/Frameworks/Python.framework/Versions/#{version}"
- if version.to_s[0,1] == "2" && Formula["python"].installed?
- args << "-DPYTHON_INCLUDE_DIR:PATH=#{python_framework}/Headers"
- args << "-DPYTHON_LIBRARY:FILEPATH=#{python_framework}/lib/libpython#{version}.dylib"
- elsif version.to_s[0,1] == "3" && Formula["python3"].installed?
+ if python == "python3" && Formula["python3"].installed?
+ python_framework = (Formula["python3"].opt_prefix)/"Frameworks/Python.framework/Versions/#{version}"
args << "-DPYTHON3_INCLUDE_DIR:PATH=#{python_framework}/Headers"
args << "-DPYTHON3_LIBRARY:FILEPATH=#{python_framework}/lib/libpython#{version}.dylib"
- args << "-DUSE_PYTHON3:BOOL=ON"
end
+ args << "-DUSE_PYTHON3:BOOL=ON" if python == "python3"
args << ".."
system "cmake", *args
system "make", "install"