aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/mercurial.rb
blob: 90bf9a2bcf37a3c000c80edc8f24563db07167d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
require 'formula'

# No head build supported; if you need head builds of Mercurial, do so outside
# of Homebrew.
class Mercurial < Formula
  homepage 'http://mercurial.selenic.com/'
  url 'http://mercurial.selenic.com/release/mercurial-3.1.2.tar.gz'
  sha1 'ae7e16454cee505da895c2497f09711f35287459'

  bottle do
    cellar :any
    revision 1
    sha1 "94cb5a3811f44023b20442b94807b912a849f9ab" => :yosemite
    sha1 "a9e4bfe5e0aa0894173983e9de781e1a2c443c71" => :mavericks
    sha1 "694095ae79b80fdc761ae341b0c18fa941bdeeb9" => :mountain_lion
  end

  def install
    ENV.minimal_optimization if MacOS.version <= :snow_leopard

    system "make", "PREFIX=#{prefix}", "install-bin"
    # Install man pages, which come pre-built in source releases
    man1.install 'doc/hg.1'
    man5.install 'doc/hgignore.5', 'doc/hgrc.5'

    # install the completion scripts
    bash_completion.install 'contrib/bash_completion' => 'hg-completion.bash'
    zsh_completion.install 'contrib/zsh_completion' => '_hg'

    # install the merge tool default configs
    # http://mercurial.selenic.com/wiki/Packaging#Things_to_note
    (etc/"mercurial"/"hgrc.d").install "contrib/mergetools.hgrc" => "mergetools.rc"
  end

  test do
    system "#{bin}/hg", "init"
  end
end