Skip to content
Browse files

Mercurial 1.9.3

  • Loading branch information...
1 parent 935d2db commit a8582772cfcb146cd1089fab763b07c222dc1ca6 @adamv adamv committed
Showing with 53 additions and 10 deletions.
  1. +1 −0 Library/Aliases/hg
  2. +51 −0 Library/Formula/mercurial.rb
  3. +0 −9 Library/Homebrew/blacklist.rb
  4. +1 −1 Library/Homebrew/download_strategy.rb
View
1 Library/Aliases/hg
View
51 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
View
9 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:
View
2 Library/Homebrew/download_strategy.rb
@@ -442,7 +442,7 @@ def initialize url, name, version, specs
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}"

0 comments on commit a858277

Please sign in to comment.
Something went wrong with that request. Please try again.