2011-11-15 17:03:12 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Mercurial < Formula
|
|
|
|
homepage 'http://mercurial.selenic.com/'
|
2013-01-06 19:01:44 +00:00
|
|
|
url 'http://mercurial.selenic.com/release/mercurial-2.4.2.tar.gz'
|
|
|
|
sha1 'ade387c4c907abff235e887a9b4678450363c756'
|
2012-02-29 23:53:16 +00:00
|
|
|
|
2011-11-19 14:49:55 +00:00
|
|
|
head 'http://selenic.com/repo/hg', :using => :hg
|
|
|
|
|
2012-08-12 18:06:36 +00:00
|
|
|
depends_on 'docutils' => :python if build.head? or build.include? 'doc'
|
2011-11-19 14:49:55 +00:00
|
|
|
|
2012-11-05 00:11:29 +00:00
|
|
|
option 'doc', "Build the documentation"
|
2012-02-18 17:29:34 +00:00
|
|
|
|
2011-11-15 17:03:12 +00:00
|
|
|
def install
|
|
|
|
# Don't add compiler specific flags so we can build against
|
|
|
|
# System-provided Python.
|
|
|
|
ENV.minimal_optimization
|
|
|
|
|
2012-02-27 05:48:00 +00:00
|
|
|
# install the completion script
|
2012-10-27 14:46:44 +00:00
|
|
|
(prefix/'etc/bash_completion.d').install 'contrib/bash_completion' => 'hg-completion.bash'
|
|
|
|
|
|
|
|
system "make doc" if build.head? or build.include? 'doc'
|
|
|
|
system "make local"
|
|
|
|
|
2012-11-05 00:11:29 +00:00
|
|
|
libexec.install 'hg', 'mercurial', 'hgext'
|
2011-11-15 17:06:08 +00:00
|
|
|
|
|
|
|
# Symlink the hg binary into bin
|
2012-10-27 14:45:59 +00:00
|
|
|
bin.install_symlink libexec/'hg'
|
2011-11-15 17:03:12 +00:00
|
|
|
|
|
|
|
# Remove the hard-coded python invocation from hg
|
2012-10-27 14:45:59 +00:00
|
|
|
inreplace bin/'hg', %r[^#!.*$], '#!/usr/bin/env python'
|
2011-11-15 17:03:12 +00:00
|
|
|
|
|
|
|
# Install some contribs
|
|
|
|
bin.install 'contrib/hgk'
|
|
|
|
|
|
|
|
# Install man pages
|
|
|
|
man1.install 'doc/hg.1'
|
2012-02-12 22:46:07 +00:00
|
|
|
man5.install 'doc/hgignore.5', 'doc/hgrc.5'
|
2011-11-15 17:03:12 +00:00
|
|
|
end
|
2011-11-19 14:49:55 +00:00
|
|
|
|
|
|
|
def caveats
|
2012-11-05 00:11:29 +00:00
|
|
|
s = ''
|
|
|
|
|
|
|
|
s += <<-EOS.undent
|
|
|
|
Extensions have been installed to:
|
|
|
|
#{libexec}/hgext
|
|
|
|
EOS
|
|
|
|
|
|
|
|
if build.head? then s += <<-EOS.undent
|
|
|
|
|
2012-02-29 23:53:16 +00:00
|
|
|
Mercurial is required to fetch its own repository, so there are now two
|
|
|
|
installations of mercurial on this machine. If the previous installation
|
|
|
|
was done via Homebrew, the old version may need to be cleaned up and new
|
|
|
|
version linked:
|
2011-11-19 14:49:55 +00:00
|
|
|
|
2012-11-05 00:11:29 +00:00
|
|
|
brew cleanup mercurial && brew link mercurial
|
2011-11-19 14:49:55 +00:00
|
|
|
EOS
|
|
|
|
end
|
2012-11-05 00:11:29 +00:00
|
|
|
|
|
|
|
return s
|
2011-11-19 14:49:55 +00:00
|
|
|
end
|
2012-05-02 23:44:06 +00:00
|
|
|
|
|
|
|
def test
|
|
|
|
system "#{bin}/hg", "debuginstall"
|
|
|
|
end
|
2011-11-15 17:03:12 +00:00
|
|
|
end
|