diff options
| author | Mike McQuaid | 2014-03-07 18:07:47 +0000 |
|---|---|---|
| committer | Mike McQuaid | 2014-03-12 13:56:41 +0000 |
| commit | 66e56a1c619f68dee0b1480e797401635aa8ea4d (patch) | |
| tree | cabcfb52467de54104a14c0c029fad0340169f83 /Library/Formula/pyqt.rb | |
| parent | d6d3375ae5366877d24661c32acff24d192eddfd (diff) | |
| download | homebrew-66e56a1c619f68dee0b1480e797401635aa8ea4d.tar.bz2 | |
pyqt: use Language::Python.
Diffstat (limited to 'Library/Formula/pyqt.rb')
| -rw-r--r-- | Library/Formula/pyqt.rb | 29 |
1 files changed, 5 insertions, 24 deletions
diff --git a/Library/Formula/pyqt.rb b/Library/Formula/pyqt.rb index 30a794e2b..8e7021997 100644 --- a/Library/Formula/pyqt.rb +++ b/Library/Formula/pyqt.rb @@ -8,13 +8,7 @@ class Pyqt < Formula depends_on :python => :recommended depends_on :python3 => :optional - if !Formula["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") + if build.without?("python3") && build.without?("python") odie "pyqt: --with-python3 must be specified when using --without-python" end @@ -26,16 +20,6 @@ class Pyqt < Formula depends_on "sip" end - def pythons - pythons = [] - ["python", "python3"].each do |python| - next if build.without? python - version = /\d\.\d/.match `#{python} --version 2>&1` - pythons << [python, version] - end - pythons - end - def patches # On Mavericks we want to target libc++, but this requires a user specified # qmake makespec. Unfortunately user specified makespecs are broken in the @@ -52,8 +36,8 @@ class Pyqt < Formula ENV.append "QMAKESPEC", "unsupported/macx-clang-libc++" end - pythons.each do |python, version| - ENV["PYTHONPATH"] = HOMEBREW_PREFIX/"opt/sip/lib/python#{version}/site-packages" + Language::Python.each_python(build) do |python, version| + ENV.append_path 'PYTHONPATH', HOMEBREW_PREFIX/"opt/sip/lib/python#{version}/site-packages" args = ["--confirm-license", "--bindir=#{bin}", @@ -79,7 +63,7 @@ class Pyqt < Formula system python, "./configure-ng.py", *args system "make" system "make", "install" - system "make", "clean" if pythons.length > 1 + system "make", "clean" end end @@ -107,10 +91,7 @@ class Pyqt < Formula sys.exit(app.exec_()) EOS - pythons.each do |python, version| - unless Formula[python].installed? - ENV["PYTHONPATH"] = HOMEBREW_PREFIX/"lib/python#{version}/site-packages" - end + Language::Python.each_python(build) do |python, version| system python, "test.py" end end |
