homebrew-core/Formula/sip.rb

47 lines
1.6 KiB
Ruby
Raw Normal View History

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'
url 'http://download.sf.net/project/pyqt/sip/sip-4.14.7/sip-4.14.7.tar.gz'
sha1 'ee048f6db7257d1eae2d9d2e407c1657c8888023'
head 'http://www.riverbankcomputing.co.uk/hg/sip', :using => :hg
2009-10-30 10:47:33 +00:00
depends_on :python => :recommended
depends_on :python3 => :optional
2009-10-30 10:47:33 +00:00
def install
2012-08-23 04:29:50 +00:00
if build.head?
# Link the Mercurial repository into the download directory so
# buid.py can use it to figure out a version number.
ln_s downloader.cached_location + '.hg', '.hg'
system python, "build.py", "prepare"
end
# 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"
2013-07-23 03:34:56 +00:00
bin.install 'sipgen/sip' => 'sip3' if python3
system "make install"
system "make clean"
end
end
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
end
end