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'
|
2013-06-24 19:07:53 +00:00
|
|
|
url 'http://download.sf.net/project/pyqt/sip/sip-4.14.7/sip-4.14.7.tar.gz'
|
|
|
|
sha1 'ee048f6db7257d1eae2d9d2e407c1657c8888023'
|
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
|
|
|
|
2013-01-21 09:33:56 +00:00
|
|
|
depends_on :python => :recommended
|
|
|
|
depends_on :python3 => :optional
|
2010-10-10 17:04:30 +00:00
|
|
|
|
2009-10-30 10:47:33 +00:00
|
|
|
def install
|
2012-08-23 04:29:50 +00:00
|
|
|
if build.head?
|
2013-01-21 09:33:56 +00:00
|
|
|
# Link the Mercurial repository into the download directory so
|
2011-05-05 19:54:57 +00:00
|
|
|
# buid.py can use it to figure out a version number.
|
|
|
|
ln_s downloader.cached_location + '.hg', '.hg'
|
2013-01-21 09:33:56 +00:00
|
|
|
system python, "build.py", "prepare"
|
2011-05-05 19:54:57 +00:00
|
|
|
else
|
|
|
|
sip_version = version
|
|
|
|
end
|
|
|
|
|
2013-01-21 09:33:56 +00:00
|
|
|
# The python block is run once for each python (2.x and 3.x if requested)
|
|
|
|
python do
|
|
|
|
# To have sip (for 2.x) and sip3 for python3, we rename the sip binary:
|
|
|
|
inreplace "configure.py", 'os.path.join(opts.sipbindir, "sip")', "os.path.join(opts.sipbindir, 'sip3')" if python3
|
|
|
|
|
|
|
|
# Set --destdir such that the python modules will be in the HOMEBREWPREFIX/lib/pythonX.Y/site-packages
|
|
|
|
system python, "configure.py",
|
|
|
|
"--destdir=#{lib}/#{python.xy}/site-packages",
|
|
|
|
"--bindir=#{bin}",
|
|
|
|
"--incdir=#{include}",
|
|
|
|
"--sipdir=#{HOMEBREW_PREFIX}/share/sip#{python.if3then3}"
|
|
|
|
system "make"
|
|
|
|
if python3
|
|
|
|
bin.mkdir unless bin.exist?
|
|
|
|
bin.install 'sipgen/sip' => 'sip3'
|
|
|
|
end
|
|
|
|
system "make install"
|
|
|
|
system "make clean"
|
|
|
|
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
|
|
|
|
s = ''
|
|
|
|
s += python.standard_caveats if python
|
|
|
|
s += "The sip-dir for Python #{python.version.major}.x is #{HOMEBREW_PREFIX}/share/sip#{python.if3then3}."
|
|
|
|
s
|
2012-02-08 18:42:19 +00:00
|
|
|
end
|
2010-12-28 20:21:34 +00:00
|
|
|
|
2013-01-21 09:33:56 +00:00
|
|
|
end
|