homebrew-core/Formula/bazaar.rb

53 lines
1.5 KiB
Ruby
Raw Normal View History

require 'formula'
class Bazaar <Formula
2010-04-01 11:06:57 +00:00
url 'http://launchpadlibrarian.net/41811693/bzr-2.1.1.tar.gz'
md5 'ab6b5e0cc449b27abac2b4d717afe09d'
homepage 'http://bazaar-vcs.org/'
2010-08-01 22:16:52 +00:00
def options
[["--system", "Install using the OS X system Python."]]
end
def install
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
# 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
# Make the manual before we install (mv) bzrlib
system "make man1/bzr.1"
man1.install gzip('man1/bzr.1')
system "make"
inreplace "bzr", "#! /usr/bin/env python", "#!/usr/bin/python" if ARGV.include? "--system"
libexec.install ['bzr', 'bzrlib']
bin.mkpath
ln_s libexec+'bzr', bin+'bzr'
end
def caveats
<<-EOS.undent
We've built a "standalone" version of bazaar and installed its libraries to:
#{libexec}
We've specifically kept it out of your Python's "site-packages" folder.
EOS
end
end