Install Haskel Platform from http://hackage.haskell.org/platform/mac.html. The version provided by Macports is too old to work with current versions of git-annex. Then execute

sudo port install git-core ossp-uuid md5sha1sum coreutils pcre

sudo ln -s /opt/local/include/pcre.h  /usr/include/pcre.h # This is hack that allows pcre-light to find pcre

# optional: this will enable the gnu tools, (to give sha224sum etc..., it does not override the BSD userland)
export PATH=$PATH:/opt/local/libexec/gnubin

sudo cabal update
cabal install git-annex --bindir=$HOME/bin

Originally posted by Jon at https://gist.github.com/671785 --Joey, modified by kristianrumberg

See also:

You can also use Homebrew instead of MacPorts. Homebrew's haskell-platform is up-to-date, too:

brew install haskell-platform git ossp-uuid md5sha1sum coreutils pcre
ln -s /usr/local/include/pcre.h /usr/include/pcre.h

As of this writing, however, Homebrew's md5sha1sum has a broken mirror. I wound up getting that from MacPorts anyway.

Comment by http://www.schleptet.net/~cfm/ Tue Aug 30 14:31:36 2011

The Haskell Platform installer for OSX uses GHC 7.0.4, which doesn't seem able to support the current version of git-annex.

Cabal throws a very cryptic error about not being able to use the proper base package.

I was able to install it by

  1. cloning the repo
  2. merging the ghc7.0 branch
  3. resolving merge conflicts in git-annex.cabal
  4. cabal install git-annex.cabal

(Note I also tried this with homebrew and had similar results)

You did the right thing, although just checking out the ghc-7.0 branch will avoid merge conflicts. I am trying to keep it fairly close to up-to-date.
Comment by http://joey.kitenet.net/ Wed Mar 28 19:18:58 2012

I got the following error message trying to install git-annex:

cabal: cannot configure git-annex-3.20120418. It requires base >=4.5 && <5
For the dependency on base >=4.5 && <5 there are these packages: base-4.5.0.0.
However none of them are available.
base-4.5.0.0 was excluded because of the top level dependency base -any

These are the steps I performed to make it work

  1. Download Ghc 7.4.
  2. Run sudo cabal install git-annex --bindir=$HOME/bin.
  3. Compilation of the Crypto-4.2.4 dependency failed since it's not updated to work with Ghc 7.4. You need to patch SHA2.hs (steps below).
  4. Run sudo cabal install git-annex --bindir=$HOME/bin a second time.

The steps I did to patch the SHA2.hs file in Crypto-4.2.4:

  1. cabal unpack crypto-4.2.4
  2. cd Crypto-4.2.4
  3. patch -p1 < crypto-4.2.4-ghc-7.4.patch
  4. sudo cabal install.

PS: I used this patchfile. Then I did the last step a third time.

Comments on this page are closed.