diff options
Diffstat (limited to 'Library')
| l--------- | Library/Aliases/hg | 1 | ||||
| -rw-r--r-- | Library/Formula/mercurial.rb | 51 | ||||
| -rw-r--r-- | Library/Homebrew/blacklist.rb | 9 | ||||
| -rw-r--r-- | Library/Homebrew/download_strategy.rb | 2 |
4 files changed, 53 insertions, 10 deletions
diff --git a/Library/Aliases/hg b/Library/Aliases/hg new file mode 120000 index 000000000..b48e610ae --- /dev/null +++ b/Library/Aliases/hg @@ -0,0 +1 @@ +../Formula/mercurial.rb
\ No newline at end of file diff --git a/Library/Formula/mercurial.rb b/Library/Formula/mercurial.rb new file mode 100644 index 000000000..a418d5adf --- /dev/null +++ b/Library/Formula/mercurial.rb @@ -0,0 +1,51 @@ +require 'formula' + +class Mercurial < Formula + url 'http://mercurial.selenic.com/release/mercurial-1.9.3.tar.gz' + homepage 'http://mercurial.selenic.com/' + md5 'f309b084aaf58773e9f4f4d66c49622a' + + def install + # Don't add compiler specific flags so we can build against + # System-provided Python. + ENV.minimal_optimization + + # Force the binary install path to the Cellar + inreplace "Makefile", + "setup.py $(PURE) install", + "setup.py $(PURE) install --install-scripts=\"#{libexec}\"" + + # Make Mercurial into the Cellar. + # Skip making the docs; depends on 'docutils' module. + system "make", "PREFIX=#{prefix}", "build" + system "make", "PREFIX=#{prefix}", "install-bin" + # Now we have lib/python2.x/site-packages/ with Mercurial + # libs in them. We want to move these out of site-packages into + # a self-contained folder. Let's choose libexec. + bin.mkpath + libexec.mkpath + + libexec.install Dir["#{lib}/python*/site-packages/*"] + + # Move "hg" executable to libexec and symlink back to bin + # libexec.install bin+'hg' + ln_s libexec+'hg', bin+'hg' + + # Move the hg startup script into libexec too, and link it from bin + # bin.mkpath + # libexec.install HOMEBREW_PREFIX+'share/python/hg' + # ln_s libexec+'hg', bin+'hg' + + # Remove the hard-coded python invocation from hg + inreplace bin+'hg', %r[#!/.*/python], '#!/usr/bin/env python' + + # We now have a self-contained Mercurial install. + + # Install some contribs + bin.install 'contrib/hgk' + + # Install man pages + man1.install 'doc/hg.1' + man5.install ['doc/hgignore.5', 'doc/hgrc.5'] + end +end diff --git a/Library/Homebrew/blacklist.rb b/Library/Homebrew/blacklist.rb index 35f7354b6..e83211fa9 100644 --- a/Library/Homebrew/blacklist.rb +++ b/Library/Homebrew/blacklist.rb @@ -28,15 +28,6 @@ def blacklisted? name We recommend using a MacTeX distribution: http://www.tug.org/mactex/ EOS - when 'mercurial', 'hg' then <<-EOS.undent - Install Mercurial with pip: - - easy_install pip && pip install Mercurial - - Or easy_install: - - easy_install Mercurial - EOS when 'pip' then <<-EOS.undent Install pip with easy_install: diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb index 2dffccea5..a170459e6 100644 --- a/Library/Homebrew/download_strategy.rb +++ b/Library/Homebrew/download_strategy.rb @@ -442,7 +442,7 @@ class MercurialDownloadStrategy < AbstractDownloadStrategy def cached_location; @clone; end def fetch - raise "You must `easy_install mercurial'" unless system "/usr/bin/which hg" + raise "You must install Mercurial: brew install mercurial" unless system "/usr/bin/which hg" ohai "Cloning #{@url}" |
