homebrew-core/Formula/sip.rb

44 lines
1.4 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 "https://downloads.sf.net/project/pyqt/sip/sip-4.16.1/sip-4.16.1.tar.gz"
sha1 "e3eb1ebe9b380ed4a7abcf7e0db02f9a2ddf95fc"
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
if build.without?("python3") && build.without?("python")
odie "sip: --with-python3 must be specified when using --without-python"
end
def install
if build.head?
# Link the Mercurial repository into the download directory so
# build.py can use it to figure out a version number.
ln_s cached_download + ".hg", ".hg"
# build.py doesn't run with python3
system "python", "build.py", "prepare"
end
2014-03-07 18:08:09 +00:00
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}",
"--destdir=#{lib}/python#{version}/site-packages",
"--bindir=#{bin}",
"--incdir=#{include}",
"--sipdir=#{HOMEBREW_PREFIX}/share/sip"
system "make"
system "make", "install"
2014-03-07 18:08:09 +00:00
system "make", "clean"
end
end
def caveats
"The sip-dir for Python is #{HOMEBREW_PREFIX}/share/sip."
end
end