Skip to content

Commit

Permalink
pyqt5: use Language::Python.
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeMcQuaid committed Mar 12, 2014
1 parent 66e56a1 commit 0c0e1ef
Showing 1 changed file with 4 additions and 20 deletions.
24 changes: 4 additions & 20 deletions Library/Formula/pyqt5.rb
Expand Up @@ -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

Expand All @@ -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",
Expand All @@ -57,14 +41,14 @@ def install
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
Expand Down

0 comments on commit 0c0e1ef

Please sign in to comment.