As a haskell package, git-annex can be installed using cabal.
Start by installing the Haskell Platform. In Debian, this is as simple as:
sudo apt-get install haskell-platform
minimal build
This builds git-annex without some features that require C libraries, that can be harder to get installed. This is plenty to get started using it, although it does not include the assistant or webapp.
cabal update
PATH=$HOME/bin:$PATH
cabal install git-annex --bindir=$HOME/bin -f"-assistant -webapp -webdav -pairing -xmpp -dns"
full build
To build with all features enabled, including the assistant and webapp, you will need to install several C libraries and their headers, including libgnutls, libgsasl, libxml2, and zlib. Then run:
cabal update
PATH=$HOME/bin:$PATH
cabal install c2hs --bindir=$HOME/bin
cabal install git-annex --bindir=$HOME/bin
building from git checkout
But maybe you want something newer (or older). Then download the version you want, and use cabal as follows inside its source tree:
cabal update
PATH=$HOME/bin:$PATH
cabal install c2hs --bindir=$HOME/bin
cabal install --only-dependencies
cabal configure
cabal build
cabal install --bindir=$HOME/bin
After finishing the installation the cabal way, here are the packages I installed. It is possible that there are other packages I installed previously as dependency for other packages.
I get an error from the command as above: $ sudo apt-get install cabal-install libgnutls28-dev libgsasl7-dev c2hs libghc libxml-sax-dev zlib1g-dev libghc-zlib-dev
$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 12.04.2 LTS Release: 12.04 Codename: precise
If you're installing git-annex with cabal, there is no need to install any haskell library packages with apt-get. That includes libghc-libxml-sax-dev and libghc-zlib-dev. Without those, the apt-get line may work to install the C libraries needed for cabal to install the haskell libraries.
However, see the the Ubuntu page for much easier ways to get git-annex installed.
@Joey Many thanks. I am new to Haskell (vaguely looked at it with DARCS) and git-annex. After installing with apt-get on Ubuntu 12.04 LTS I found webapp was missing, hence have come here. I am going through the correct steps now, it should be awesome when done.
This seems to be a long build process (still going on my old laptop, much longer than apt-get). Ubuntu git-annex packages from 13.10 Saucy I think are updated to include webapp.
I'm having problems installing from cabal, and it seems related to yesod. I found an older discussion on something similar, where a constraint to require a newer version of yesod had been added, but I haven't figured out what was done to solve it.
The problem seems to be that git-annex requires yesod < 1.2, but cabal is unable to install an older version.
From what I can tell, the problem is fixed in github master since yesod >= 1.2 is supported again.
I had - maybe the same problem as Nigel - with ExitFailure 1 libxml-sax-0.7.4 .
I could fix this by forcing the link of libxml2 package with "brew link libxml2 --force". Maybe you should update your guide. I had this problem on 2 different machines running both the current versions of OS X.
After this the build finished successfull. Maybe this helps.
I tried various ways to install git-annex on my TonidoPlug.
System Info:
apt-get
didn't work.The Linux standalone installation results in an error message like this, when calling
git-annex
(orgit annex
)(git-annex.linux/bin/git-annex is a binary file and works fine on other distros)
When installing with cabal, I get the error message (tried as root and gitolite user)
Any help is appreciated. Thanks for providing git-annex. I started cleaning up my backups with it yesterday and really like it.
The Linux standalone builds for i386 and amd64 will not work on Arm systems.
There are builds of git-annex for arm in eg, Debian. You should be able to use one of those if this system is running Debian. You may need to upgrade to eg, Debian stable, which includes git-annex.
It looks like you have an old and/or broken GHC compiler too. You could upgrade that to a newer version (eg from Debian stable) and build it that way, but it seems like the long way around if you have a Debian system there.