sip: use Language::Python.

This commit is contained in:
Mike McQuaid 2014-03-07 18:08:09 +00:00
parent 0b1238e3d1
commit 63a879f0b2

View file

@ -14,16 +14,6 @@ class Sip < Formula
odie "sip: --with-python3 must be specified when using --without-python"
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
if build.head?
# Link the Mercurial repository into the download directory so
@ -33,7 +23,7 @@ class Sip < Formula
system "python", "build.py", "prepare"
end
pythons.each do |python, version|
Language::Python.each_python(build) do |python, version|
# Note the binary `sip` is the same for python 2.x and 3.x
system python, "configure.py",
"--deployment-target=#{MacOS.version}",
@ -43,7 +33,7 @@ class Sip < Formula
"--sipdir=#{HOMEBREW_PREFIX}/share/sip"
system "make"
system "make", "install"
system "make", "clean" if pythons.length > 1
system "make", "clean"
end
end