2009-10-30 10:47:33 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Sip < Formula
|
2009-10-30 10:47:33 +00:00
|
|
|
homepage 'http://www.riverbankcomputing.co.uk/software/sip'
|
2014-01-08 08:01:47 +00:00
|
|
|
url 'http://download.sf.net/project/pyqt/sip/sip-4.15.4/sip-4.15.4.tar.gz'
|
|
|
|
sha1 'a5f6342dbb3cdc1fb61440ee8acb805f5fec3c41'
|
2012-06-23 07:38:07 +00:00
|
|
|
|
|
|
|
head 'http://www.riverbankcomputing.co.uk/hg/sip', :using => :hg
|
2009-10-30 10:47:33 +00:00
|
|
|
|
2014-02-05 12:07:37 +00:00
|
|
|
depends_on :python => :recommended
|
|
|
|
depends_on :python3 => :optional
|
|
|
|
|
|
|
|
if build.without?("python3") && build.without?("python")
|
|
|
|
odie "sip: --with-python3 must be specified when using --without-python"
|
|
|
|
end
|
|
|
|
|
|
|
|
def pythons
|
2014-02-07 23:00:48 +00:00
|
|
|
pythons = []
|
2014-02-05 12:07:37 +00:00
|
|
|
["python", "python3"].each do |python|
|
|
|
|
next if build.without? python
|
2014-02-07 23:00:48 +00:00
|
|
|
version = /\d\.\d/.match `#{python} --version 2>&1`
|
|
|
|
pythons << [python, version]
|
2011-05-05 19:54:57 +00:00
|
|
|
end
|
2014-02-05 12:07:37 +00:00
|
|
|
pythons
|
|
|
|
end
|
2011-05-05 19:54:57 +00:00
|
|
|
|
2014-02-05 12:07:37 +00:00
|
|
|
def install
|
2014-02-06 14:40:42 +00:00
|
|
|
if build.head?
|
|
|
|
# Link the Mercurial repository into the download directory so
|
|
|
|
# build.py can use it to figure out a version number.
|
2014-02-21 05:41:07 +00:00
|
|
|
ln_s cached_download + ".hg", ".hg"
|
2014-02-06 14:40:42 +00:00
|
|
|
# build.py doesn't run with python3
|
|
|
|
system "python", "build.py", "prepare"
|
|
|
|
end
|
|
|
|
|
2014-02-05 12:07:37 +00:00
|
|
|
pythons.each 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}",
|
|
|
|
"--destdir=#{lib}/python#{version}/site-packages",
|
|
|
|
"--bindir=#{bin}",
|
|
|
|
"--incdir=#{include}",
|
|
|
|
"--sipdir=#{HOMEBREW_PREFIX}/share/sip"
|
|
|
|
system "make"
|
|
|
|
system "make", "install"
|
|
|
|
system "make", "clean" if pythons.length > 1
|
|
|
|
end
|
2009-11-05 18:13:00 +00:00
|
|
|
end
|
2012-02-08 18:42:19 +00:00
|
|
|
|
2013-01-21 09:33:56 +00:00
|
|
|
def caveats
|
2014-02-05 12:07:37 +00:00
|
|
|
"The sip-dir for Python is #{HOMEBREW_PREFIX}/share/sip."
|
2012-02-08 18:42:19 +00:00
|
|
|
end
|
2013-01-21 09:33:56 +00:00
|
|
|
end
|