OS-specific instructions
- OSX
- Debian
- Ubuntu
- Fedora
- FreeBSD
- openSUSE
- ArchLinux
- NixOS
- Gentoo
- Windows: sorry, not possible yet
- ScientificLinux5 - This should cover RHEL5 clones such as CentOS5 and so on
Using cabal
As a haskell package, git-annex can be installed using cabal. For example:
cabal install git-annex --bindir=$HOME/bin
The above downloads the latest release. Alternatively, you can download it yourself and manually build with cabal.
Installation by hand
To build and use git-annex, you will need:
- Haskell stuff
- The Haskell Platform
- MissingH
- pcre-light
- utf8-string
- SHA
- dataenc
- TestPack
- QuickCheck 2
- HTTP
- json
- IfElse
- bloomfilter
- edit-distance
- hS3 (optional)
- stm (optional; version 2.3 or newer)
- hinotify (optional; Linux only)
- Shell commands
Then just download git-annex and run: make; make install
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
(Note I also tried this with homebrew and had similar results)
I got the following error message trying to install git-annex:
These are the steps I performed to make it work
sudo cabal install git-annex --bindir=$HOME/bin
.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:
cabal unpack crypto-4.2.4
cd Crypto-4.2.4
patch -p1 < crypto-4.2.4-ghc-7.4.patch
sudo cabal install
.PS: I used this patchfile. Then I did the last step a third time.
If you're missing the
sha256sum
command with Homebrew, it's provided bycoreutils
. You have to change your$PATH
before runningcabal install git-annex.cabal
:$(brew --prefix) should, in most cases, be /usr/local. That's the recommended install location for homebrew.
I already had git installed and homebrew as my package manager - my install steps were as follows:
I try installing with brew because I already had brew setup in my machine, but all run ok but when I try to run cabal install git-annex I got an error with the hinotify-0.3.2 library complaining about a header file.
Full trace:
~~~ sudo cabal install git-annex Resolving dependencies... Configuring hinotify-0.3.2... Building hinotify-0.3.2... Preprocessing library hinotify-0.3.2... INotify.hsc:35:25: error: sys/inotify.h: No such file or directory INotify.hsc: In function ‘main’: INotify.hsc:259: error: invalid use of undefined type ‘struct inotify_event’ INotify.hsc:260: error: invalid use of undefined type ‘struct inotify_event’ INotify.hsc:261: error: invalid use of undefined type ‘struct inotify_event’ INotify.hsc:262: error: invalid use of undefined type ‘struct inotify_event’ INotify.hsc:265: error: invalid use of undefined type ‘struct inotify_event’ INotify.hsc:266: error: invalid application of ‘sizeof’ to incomplete type ‘struct inotify_event’ compiling dist/build/System/INotify_hsc_make.c failed (exit code 1) command was: /usr/bin/gcc -c dist/build/System/INotify_hsc_make.c -o dist/build/System/INotify_hsc_make.o -m64 -fno-stack-protector -m64 -D__GLASGOW_HASKELL__=704 -Ddarwin_BUILD_OS -Ddarwin_HOST_OS -Dx86_64_BUILD_ARCH -Dx86_64_HOST_ARCH -I/usr/local/Cellar/ghc/7.4.1/lib/ghc-7.4.1/directory-1.1.0.2/include -Idist/build/autogen -include dist/build/autogen/cabal_macros.h -I/usr/local/Cellar/ghc/7.4.1/lib/ghc-7.4.1/unix-2.5.1.0/include -Idist/build/autogen -include dist/build/autogen/cabal_macros.h -I/usr/local/Cellar/ghc/7.4.1/lib/ghc-7.4.1/old-time-1.1.0.0/include -Idist/build/autogen -include dist/build/autogen/cabal_macros.h -Idist/build/autogen -include dist/build/autogen/cabal_macros.h -Idist/build/autogen -include dist/build/autogen/cabal_macros.h -Idist/build/autogen -include dist/build/autogen/cabal_macros.h -Idist/build/autogen -include dist/build/autogen/cabal_macros.h -I/usr/local/Cellar/ghc/7.4.1/lib/ghc-7.4.1/bytestring-0.9.2.1/include -Idist/build/autogen -include dist/build/autogen/cabal_macros.h -Idist/build/autogen -include dist/build/autogen/cabal_macros.h -I/usr/local/Cellar/ghc/7.4.1/lib/ghc-7.4.1/base-4.5.0.0/include -Idist/build/autogen -include dist/build/autogen/cabal_macros.h -Idist/build/autogen -include dist/build/autogen/cabal_macros.h -Idist/build/autogen -include dist/build/autogen/cabal_macros.h -I/usr/local/Cellar/ghc/7.4.1/lib/ghc-7.4.1/include -Idist/build/autogen -include dist/build/autogen/cabal_macros.h -I/usr/local/Cellar/ghc/7.4.1/lib/ghc-7.4.1/include/ cabal: Error: some packages failed to install: git-annex-3.20120624 depends on hinotify-0.3.2 which failed to install. hinotify-0.3.2 failed during the building phase. The exception was: ExitFailure 1 ~~~
Anyone has an idea how can I solve this.
Thanks for the time!
Agustin
Hi Joey! I just comment that I could not install it but the issue is with the last version (the one you just release today, so no problem!! man on sunday?? you're awesome!!!) so I installed the previous one and no problem at all
Thanks for all the efford and if you need me to try os whatever, feel free to ask!
Thanks again
Agustin
@Agustin you should be able to work around that with: cabal install git-annex --flags=-Inotify
I've fixed it properly for the next release, it should only be using that library on Linux.
Hi @joey! Perfect!... I'll do that then!
Thanks for your time man!
Is there going to be an update of git-annex in debian squeeze-backports to a version that supports repository version 3? Thx
You can also use Homebrew instead of MacPorts. Homebrew's
haskell-platform
is up-to-date, too:As of this writing, however, Homebrew's
md5sha1sum
has a broken mirror. I wound up getting that from MacPorts anyway.