aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMike McQuaid2014-03-07 18:07:58 +0000
committerMike McQuaid2014-03-12 13:56:56 +0000
commit0c0e1ef0ec9d03afd38f3f39e2cb3ac28e49c039 (patch)
tree7e0233c32013a017b5aff77c9242186b87148469 /Library
parent66e56a1c619f68dee0b1480e797401635aa8ea4d (diff)
downloadhomebrew-0c0e1ef0ec9d03afd38f3f39e2cb3ac28e49c039.tar.bz2
pyqt5: use Language::Python.
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/pyqt5.rb24
1 files changed, 4 insertions, 20 deletions
diff --git a/Library/Formula/pyqt5.rb b/Library/Formula/pyqt5.rb
index 89a420c78..427fb49e6 100644
--- a/Library/Formula/pyqt5.rb
+++ b/Library/Formula/pyqt5.rb
@@ -10,13 +10,7 @@ class Pyqt5 < Formula
depends_on :python3 => :recommended
depends_on :python => :optional
- if !Formula["python"].installed? && build.with?("python") &&
- build.with?("python3")
- odie <<-EOS.undent
- pyqt5: 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 "pyqt5: --with-python3 must be specified when using --without-python"
end
@@ -28,18 +22,8 @@ class Pyqt5 < 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 install
- pythons.each do |python, version|
+ Language::Python.each_python(build) do |python, version|
args = [ "--confirm-license",
"--bindir=#{bin}",
"--destdir=#{lib}/python#{version}/site-packages",
@@ -57,14 +41,14 @@ class Pyqt5 < Formula
system python, "configure.py", *args
system "make"
system "make", "install"
- system "make", "clean" if pythons.length > 1
+ system "make", "clean"
end
end
test do
system "pyuic5", "--version"
system "pylupdate5", "-version"
- pythons.each do |python, version|
+ Language::Python.each_python(build) do |python, version|
system python, "-c", "import PyQt5"
end
end