Skip to content

Commit

Permalink
sip: use Language::Python.
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeMcQuaid committed Mar 12, 2014
1 parent 0c0e1ef commit eae8842
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions Library/Formula/sip.rb
Expand Up @@ -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
Expand All @@ -33,7 +23,7 @@ def install
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}",
Expand All @@ -43,7 +33,7 @@ def install
"--sipdir=#{HOMEBREW_PREFIX}/share/sip"
system "make"
system "make", "install"
system "make", "clean" if pythons.length > 1
system "make", "clean"
end
end

Expand Down

0 comments on commit eae8842

Please sign in to comment.