diff options
| author | Mike McQuaid | 2014-02-10 14:45:33 +0000 |
|---|---|---|
| committer | Mike McQuaid | 2014-02-10 18:49:26 +0000 |
| commit | 63293d8055bbb89a86d5a61ab7ea6636c9756ac8 (patch) | |
| tree | 554f9bf5ff133ab26dba5c219935667305a96fd3 /Library/Formula/pyqt.rb | |
| parent | f7deafa692a10177ac035e63af7ff78584507a50 (diff) | |
| download | homebrew-63293d8055bbb89a86d5a61ab7ea6636c9756ac8.tar.bz2 | |
pyqt: more python cleanup.
Diffstat (limited to 'Library/Formula/pyqt.rb')
| -rw-r--r-- | Library/Formula/pyqt.rb | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/Library/Formula/pyqt.rb b/Library/Formula/pyqt.rb index 76c6004b3..287a6073e 100644 --- a/Library/Formula/pyqt.rb +++ b/Library/Formula/pyqt.rb @@ -8,8 +8,14 @@ class Pyqt < Formula depends_on :python => :recommended depends_on :python3 => :optional - if (build.without? "python3") && (build.without? "python") - odie "pyqt: --with-python3 must be specified when using --without-python" + if !Formula.factory("python").installed? && build.with?("python") && + build.with?("python3") + odie <<-EOS.undent + pyqt: You cannot use system Python 2 and Homebrew's Python 3 simultaneously. + Either `brew install python` or use `--without-python3`. + EOS + elsif build.without?("python3") && build.without?("python") + odie "pyqt: --with-python3 must be specified when using --without-python" end depends_on 'qt' # From their site: PyQt currently supports Qt v4 and will build against Qt v5 @@ -46,9 +52,8 @@ class Pyqt < Formula ENV.append "QMAKESPEC", "unsupported/macx-clang-libc++" end - python_path = ENV["PYTHONPATH"] pythons.each do |python, version| - ENV.append_path "PYTHONPATH", HOMEBREW_PREFIX/"opt/sip/lib/python#{version}/site-packages" + ENV["PYTHONPATH"] = HOMEBREW_PREFIX/"opt/sip/lib/python#{version}/site-packages" args = ["--confirm-license", "--bindir=#{bin}", @@ -74,10 +79,7 @@ class Pyqt < Formula system python, "./configure-ng.py", *args system "make" system "make", "install" - if pythons.length > 1 - system "make", "clean" - ENV["PYTHONPATH"] = python_path - end + system "make", "clean" if pythons.length > 1 end end @@ -105,11 +107,11 @@ class Pyqt < Formula sys.exit(app.exec_()) EOS - python_path = ENV["PYTHONPATH"] pythons.each do |python, version| - ENV.append_path "PYTHONPATH", HOMEBREW_PREFIX/"lib/python#{version}/site-packages" + unless Formula.factory(python).installed? + ENV["PYTHONPATH"] = HOMEBREW_PREFIX/"lib/python#{version}/site-packages" + end system python, "test.py" - ENV["PYTHONPATH"] = python_path if pythons.length > 1 end end end |
