2009-11-19 03:49:34 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Bazaar <Formula
|
2010-12-04 05:05:10 +00:00
|
|
|
url 'http://launchpadlibrarian.net/59616932/bzr-2.2.2.tar.gz'
|
|
|
|
md5 'd1bfa2fd1aad282c423c78d62ebacb21'
|
2009-11-19 03:49:34 +00:00
|
|
|
homepage 'http://bazaar-vcs.org/'
|
2010-08-02 00:43:47 +00:00
|
|
|
|
2010-08-01 22:16:52 +00:00
|
|
|
def options
|
|
|
|
[["--system", "Install using the OS X system Python."]]
|
|
|
|
end
|
|
|
|
|
2009-11-19 03:49:34 +00:00
|
|
|
def install
|
2011-01-21 04:38:53 +00:00
|
|
|
ENV.j1 # Builds aren't parallel-safe
|
|
|
|
|
|
|
|
# Make and install man page first
|
|
|
|
system "make man1/bzr.1"
|
|
|
|
man1.install "man1/bzr.1"
|
|
|
|
|
2010-08-02 00:43:47 +00:00
|
|
|
if ARGV.include? "--system"
|
|
|
|
ENV.prepend "PATH", "/System/Library/Frameworks/Python.framework/Versions/Current/bin", ":"
|
|
|
|
else
|
|
|
|
python_version = `python -c "import sys;print sys.version"`
|
|
|
|
if python_version[0,4] == "2.7."
|
|
|
|
opoo <<-EOS
|
|
|
|
Bazaar might not yet work with Python 2.7.
|
|
|
|
You can force an installation using the system Python by doing:
|
|
|
|
brew install bazaar --system
|
|
|
|
EOS
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2010-04-16 16:41:25 +00:00
|
|
|
# Find the archs of the Python we are building against.
|
|
|
|
# If the python includes PPC support, then don't use Intel-
|
|
|
|
# specific compiler flags
|
|
|
|
archs = archs_for_command("python")
|
|
|
|
ENV.minimal_optimization if archs.include? :ppc64 or archs.include? :ppc7400
|
|
|
|
|
2010-04-02 00:57:38 +00:00
|
|
|
system "make"
|
2010-08-02 00:43:47 +00:00
|
|
|
inreplace "bzr", "#! /usr/bin/env python", "#!/usr/bin/python" if ARGV.include? "--system"
|
2010-04-02 00:57:38 +00:00
|
|
|
libexec.install ['bzr', 'bzrlib']
|
2010-01-19 14:41:25 +00:00
|
|
|
|
2010-04-02 00:57:38 +00:00
|
|
|
bin.mkpath
|
|
|
|
ln_s libexec+'bzr', bin+'bzr'
|
|
|
|
end
|
2010-01-19 14:41:25 +00:00
|
|
|
|
2010-04-02 00:57:38 +00:00
|
|
|
def caveats
|
|
|
|
<<-EOS.undent
|
|
|
|
We've built a "standalone" version of bazaar and installed its libraries to:
|
|
|
|
#{libexec}
|
2010-01-19 14:41:25 +00:00
|
|
|
|
2010-04-02 00:57:38 +00:00
|
|
|
We've specifically kept it out of your Python's "site-packages" folder.
|
2010-01-19 14:41:25 +00:00
|
|
|
EOS
|
|
|
|
end
|
2009-11-19 03:49:34 +00:00
|
|
|
end
|