54 lines
2 KiB
Ruby
54 lines
2 KiB
Ruby
# No head build supported; if you need head builds of Mercurial, do so outside
|
|
# of Homebrew.
|
|
class Mercurial < Formula
|
|
desc "Scalable distributed version control system"
|
|
homepage "https://mercurial-scm.org/"
|
|
url "https://mercurial-scm.org/release/mercurial-4.1.3.tar.gz"
|
|
sha256 "103d2ae187d5c94110c0e86ccc3b46f55fcd8e21c78d1c209bac7b59a73e86d8"
|
|
|
|
bottle do
|
|
sha256 "e49e2540768bbd66225f9723f579c27b1d028586eab078981c3b2ec7710ec18d" => :sierra
|
|
sha256 "9cc86c8ffc8a56b82f043ec2701ea96da9665f981905d7094864c01e33eca252" => :el_capitan
|
|
sha256 "f63a79bb2a423bc2d1ce0e39b513eb15a4d86b466f5a11a98a30887c4dca0a39" => :yosemite
|
|
end
|
|
|
|
option "with-custom-python", "Install against the python in PATH instead of Homebrew's python"
|
|
depends_on :python
|
|
|
|
def install
|
|
system "make", "PREFIX=#{prefix}", "install-bin"
|
|
|
|
# Install chg (see https://www.mercurial-scm.org/wiki/CHg)
|
|
cd "contrib/chg" do
|
|
system "make", "PREFIX=#{prefix}", "HGPATH=#{bin}/hg", \
|
|
"HG=#{bin}/hg"
|
|
bin.install "chg"
|
|
end
|
|
|
|
# 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"
|
|
end
|
|
|
|
def caveats
|
|
return unless (opt_bin/"hg").exist?
|
|
cacerts_configured = `#{opt_bin}/hg config web.cacerts`.strip
|
|
return if cacerts_configured.empty?
|
|
<<-EOS.undent
|
|
Homebrew has detected that Mercurial is configured to use a certificate
|
|
bundle file as its trust store for TLS connections instead of using the
|
|
default OpenSSL store. If you have trouble connecting to remote
|
|
repositories, consider unsetting the `web.cacerts` property. You can
|
|
determine where the property is being set by running:
|
|
hg config --debug web.cacerts
|
|
EOS
|
|
end
|
|
|
|
test do
|
|
system "#{bin}/hg", "init"
|
|
end
|
|
end
|