2009-10-30 10:47:33 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-05-05 19:54:57 +00:00
|
|
|
# NOTE TO MAINTAINERS:
|
|
|
|
#
|
|
|
|
# Unless Riverbank policy changes in the future or the Mercurial archive
|
|
|
|
# becomes unavailable, *do not use* the SIP download URL from the Riverbank
|
|
|
|
# website. This URL will break as soon as a new version of SIP is released
|
|
|
|
# which causes panic and terror to flood the Homebrew issue tracker.
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Sip < Formula
|
2012-02-12 23:02:05 +00:00
|
|
|
url 'http://www.riverbankcomputing.co.uk/hg/sip/archive/4.13.2.tar.gz'
|
|
|
|
sha1 'd6c0835738438f8ccff012164a6c6192abc52792'
|
2010-09-21 00:46:08 +00:00
|
|
|
head 'http://www.riverbankcomputing.co.uk/hg/sip', :using => :hg
|
2009-10-30 10:47:33 +00:00
|
|
|
homepage 'http://www.riverbankcomputing.co.uk/software/sip'
|
|
|
|
|
2011-05-05 19:54:57 +00:00
|
|
|
def patches
|
|
|
|
DATA
|
2010-10-10 17:04:30 +00:00
|
|
|
end
|
|
|
|
|
2009-10-30 10:47:33 +00:00
|
|
|
def install
|
2011-05-05 19:54:57 +00:00
|
|
|
if ARGV.build_head?
|
|
|
|
# Set fallback version to the same value it would have without the patch
|
|
|
|
# and link the Mercurial repository into the download directory so
|
|
|
|
# buid.py can use it to figure out a version number.
|
|
|
|
sip_version = "0.1.0"
|
|
|
|
ln_s downloader.cached_location + '.hg', '.hg'
|
|
|
|
else
|
|
|
|
sip_version = version
|
|
|
|
end
|
|
|
|
inreplace 'build.py', /@SIP_VERSION@/, (sip_version.gsub '.', ',')
|
|
|
|
|
|
|
|
system "python", "build.py", "prepare"
|
2012-02-08 18:42:19 +00:00
|
|
|
# Set --destdir such that the python modules will be in the HOMEBREWPREFIX/lib/pythonX.Y/site-packages
|
2010-10-25 12:19:39 +00:00
|
|
|
system "python", "configure.py",
|
2012-02-08 18:42:19 +00:00
|
|
|
"--destdir=#{lib}/#{which_python}/site-packages",
|
2010-06-16 21:06:54 +00:00
|
|
|
"--bindir=#{bin}",
|
|
|
|
"--incdir=#{include}"
|
2009-10-30 10:47:33 +00:00
|
|
|
system "make install"
|
|
|
|
end
|
2009-11-05 18:13:00 +00:00
|
|
|
|
2010-09-21 00:46:08 +00:00
|
|
|
def caveats; <<-EOS.undent
|
2012-02-08 18:42:19 +00:00
|
|
|
For non-homebrew Python, you need to amend your PYTHONPATH like so:
|
|
|
|
export PYTHONPATH=#{HOMEBREW_PREFIX}/lib/#{which_python}/site-packages:$PYTHONPATH
|
2010-09-21 00:46:08 +00:00
|
|
|
EOS
|
2009-11-05 18:13:00 +00:00
|
|
|
end
|
2012-02-08 18:42:19 +00:00
|
|
|
|
|
|
|
def which_python
|
|
|
|
"python" + `python -c 'import sys;print(sys.version[:3])'`.strip
|
|
|
|
end
|
2009-10-30 10:47:33 +00:00
|
|
|
end
|
2010-12-28 20:21:34 +00:00
|
|
|
|
|
|
|
|
2010-10-10 17:04:30 +00:00
|
|
|
__END__
|
2011-05-05 19:54:57 +00:00
|
|
|
Patch to allow the SIP build.py script to generate a reasonable version number
|
|
|
|
for installing from a Mercurial snapshot without the .hg directory from the
|
|
|
|
Mercurial repository. The install code hooks on to the @SIP_VERSION@ tag and
|
|
|
|
inserts a real version tuple
|
|
|
|
|
|
|
|
diff --git a/build.py b/build.py
|
|
|
|
index 927d7f1..fdf13a3 100755
|
|
|
|
--- a/build.py
|
|
|
|
+++ b/build.py
|
|
|
|
@@ -179,7 +179,7 @@ def _get_release():
|
|
|
|
changelog = None
|
|
|
|
name = os.path.basename(_RootDir)
|
|
|
|
|
|
|
|
- release_suffix = "-unknown"
|
|
|
|
+ release_suffix = ""
|
|
|
|
version = None
|
|
|
|
|
|
|
|
parts = name.split('-')
|
|
|
|
@@ -192,7 +192,7 @@ def _get_release():
|
|
|
|
|
|
|
|
# Format the results.
|
|
|
|
if version is None:
|
|
|
|
- version = (0, 1, 0)
|
|
|
|
+ version = (@SIP_VERSION@)
|
|
|
|
|
|
|
|
major, minor, micro = version
|
|
|
|
|
|
|
|
|
2011-05-03 20:01:36 +00:00
|
|
|
Patch to remove the seemingly unnecessary framework build requirement
|
2010-10-25 12:19:39 +00:00
|
|
|
diff --git a/siputils.py b/siputils.py
|
|
|
|
index 57e8911..1af6152 100644
|
|
|
|
--- a/siputils.py
|
|
|
|
+++ b/siputils.py
|
2011-05-03 20:01:36 +00:00
|
|
|
@@ -1434,8 +1434,8 @@ class ModuleMakefile(Makefile):
|
2010-10-25 12:19:39 +00:00
|
|
|
# 'real_prefix' exists if virtualenv is being used.
|
|
|
|
dl = getattr(sys, 'real_prefix', sys.exec_prefix).split(os.sep)
|
|
|
|
|
|
|
|
- if "Python.framework" not in dl:
|
|
|
|
- error("SIP requires Python to be built as a framework")
|
|
|
|
+ # if "Python.framework" not in dl:
|
|
|
|
+ # error("SIP requires Python to be built as a framework")
|
|
|
|
|
|
|
|
self.LFLAGS.append("-undefined dynamic_lookup")
|
|
|
|
|