git-annex.app

For easy installation, use the prebuilt app bundle.

To run the git-annex assistant, just install the app, look for the icon, and start it up.

To use git-annex at the command line, you can add git-annex.app/Contents/MacOS to your PATH

Alternatively, from the command line you can run git-annex.app/Contents/MacOS/runshell, which makes your shell use all the programs bundled inside the app, including not just git-annex, but git, and several more. Handy if you don't otherwise have git installed.

autobuilds

Joey autobuilds the app for Mavericks.

using Homebrew

git-annex is now available in Homebrew!

using MacPorts

Install the Haskell 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 gnutls libxml2 libgsasl pkgconfig
sudo cabal update
PATH=$HOME/bin:$PATH
cabal install c2hs git-annex --bindir=$HOME/bin

PATH setup

Do not forget to add to your PATH variable your ~/bin folder. In your .bashrc, for example:

PATH=$HOME/bin:$PATH

See also:

  • OSX's haskell-platform statically links things
  • OSX's default sshd behaviour has limited paths set

I've moved some outdated comments about installing on OSX to old comments. And also moved away some comments that helped build the instructions above.

Comment by http://joeyh.name/ Tue Jul 24 15:09:29 2012
For those that care, I've updated my autobuilder to the latest version of haskell-platform 2012.4.0.0 and it appears to be building correctly.

Installing via the MacPorts method. I ran into this error.

"_locale_charset", referenced from: _localeEncoding in libHSbase-4.5.1.0.a(PrelIOUtils.o) 
ld: symbol(s) not found for architecture x86_64

I was able to solve and get git-annex to build buy providing the --extra-lib-dirs parameter

cabal install c2hs git-annex --bindir=$HOME/bin --extra-lib-dirs=/usr/lib

Cheers, Daniel Wozniak

Hi,

Are there plans to provide a git-annex.app that works on Snow Leopard?

Currently there are only installers for the Lions.

http://downloads.kitenet.net/git-annex/OSX/current/

Thanks :-)

What we need to provide a Snow Leopard or other version build, is access to a box running that version of OSX, or someone with a box that doesn't mind compiling stuff and setting up the autobuilder (not very hard).
Comment by http://joeyh.name/ Fri Jan 18 17:25:36 2013
If the process is very automatic I might contribute. I mean, if you tell me, install this and that package and run this script once a week, I might be able to help. I have a MacBook from 2007 with Snow Leopard. I also have macports installed, but I'm not a programmer.
If you can get it to build using the instructions for Brew (or MacPorts) on this page, it's easy to get from there to a distributable app.
Comment by http://joeyh.name/ Fri Jan 18 20:16:52 2013

Bad news, it looks like I'm not able to install git-annex to my machine: When I run

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

I get the following error:

cabal: Error: some packages failed to install:
DAV-0.3 failed during the building phase. The exception was:
ExitFailure 11
git-annex-3.20130114 depends on yesod-core-1.1.7.1 which failed to install.
yesod-1.1.7.2 depends on yesod-core-1.1.7.1 which failed to install.
yesod-auth-1.1.3 depends on yesod-core-1.1.7.1 which failed to install.
yesod-core-1.1.7.1 failed during the building phase. The exception was:
ExitFailure 11
yesod-default-1.1.3 depends on yesod-core-1.1.7.1 which failed to install.
yesod-form-1.2.0.2 depends on yesod-core-1.1.7.1 which failed to install.
yesod-json-1.1.2 depends on yesod-core-1.1.7.1 which failed to install.
yesod-persistent-1.1.0.1 depends on yesod-core-1.1.7.1 which failed to
install.
yesod-static-1.1.1.2 depends on yesod-core-1.1.7.1 which failed to install.

What does ExitFailure 11 mean?

sig11 is a Segmentation Fault, probably from a C library used by DAV for HTTP in this case.
Comment by http://joeyh.name/ Sat Jan 19 16:02:35 2013
I guess my adventure ends here. :'(
What is the appropriate way to update to the latest build of git-annex using cabal?
Is there any way I can try to solve or by-pass the Segmentation Fault I commeted before?
@eric cabal update && cabal upgrade git-annex
Comment by http://joeyh.name/ Tue Feb 5 19:46:29 2013

i had macports installed. then i installed brew, instaled haskell via brew. i needed to set PATH=$HOME/bin:/usr/local/bin:$PATH

I'm having the same issue as @Pere, with a newer version of DAV :(

cabal: Error: some packages failed to install: DAV-0.3.1 failed during the building phase. The exception was: ExitFailure 11 git-annex-4.20130323 depends on shakespeare-css-1.0.3 which failed to install. persistent-1.1.5.1 failed during the building phase. The exception was: ExitFailure 11 persistent-template-1.1.3.1 depends on persistent-1.1.5.1 which failed to install. shakespeare-css-1.0.3 failed during the building phase. The exception was: ExitFailure 11 yesod-1.1.9.2 depends on shakespeare-css-1.0.3 which failed to install. yesod-auth-1.1.5.3 depends on shakespeare-css-1.0.3 which failed to install. yesod-core-1.1.8.2 depends on shakespeare-css-1.0.3 which failed to install. yesod-default-1.1.3.2 depends on shakespeare-css-1.0.3 which failed to install. yesod-form-1.2.1.3 depends on shakespeare-css-1.0.3 which failed to install. yesod-json-1.1.2.2 depends on shakespeare-css-1.0.3 which failed to install. yesod-persistent-1.1.0.1 depends on shakespeare-css-1.0.3 which failed to install. yesod-static-1.1.2.2 depends on shakespeare-css-1.0.3 which failed to install.

Any ideas?

Comment by https://launchpad.net/~wincus Tue Mar 26 16:02:54 2013

I was able to build snow leopard completely for the first time over last night (it took a very long time to build all the tools and dependancies). Woohoo!

The way I was able to fully build on a 32-bit 10.6 machine was this

  1. Delete ~/.ghc and ~/.cabal. They were full of random things and were causing problems.
  2. brew uninstall ghc and haskell-platform
  3. brew update
  4. brew install git ossp-uuid md5sha1sum coreutils libgsasl gnutls libidn libgsasl pkg-config libxml2
  5. brew upgrade git ossp-uuid md5sha1sum coreutils libgsasl gnutls libidn libgsasl pkg-config libxml2 (Some of these were already installed/up to date.
  6. brew link libxml2
  7. brew install haskell-platform (This takes a long, long time).
  8. cabal update (assuming you have added ~/.cabal/bin to your path
  9. cabal install cablal-install
  10. cabal install c2hs
  11. cabal install git-annex

It also appears to be running fairly smoothly than it had in the past on a 32-bit SL system. Thats also neat.

The problem is that it seems to not really work as git annex though, probably due to the error relating you get when you start up the webapp: Running git annex webapp The browser starts up, and I get 3 of these errors: Watcher crashed: Need at least OSX 10.7.0 for file-level FSEvents

Pairing with a local computer appears to work to systems running 10.7, but when you complete the process, they never show up in the repository list.

Also on a side note, when running git annex webapp it triggers the opening of an html file in whatever the default html file handler is. I edit a lot of html, so for me that is usually a text editor. I had to change the file handler to open html files with my web browser for the git annex webapp to actually work. Is there a way to change that so that git annex webapp uses the default web browser for the system rather than the default html file handler?

@Bret, the assistant relies on FSEvents pretty heavily. It seems to me your best bet is to upgrade OSX to a version that supports FSEvents.

You can certainly use the rest of git-annex on Snow Leopard without FSEvents.

Comment by http://joeyh.name/ Tue Apr 16 20:31:10 2013
The laptop is one of the first macbook pro's with a 32 bit chip, which apple dropped support for in 10.7, so the furthest it can update to is 10.6.x. :(
sounds like a prime candidate for a nice lightweight linux distro ;)
Comment by http://edheil.wordpress.com/ Thu Apr 18 02:05:34 2013
I'm using the annex assistant from the annex bundle for the convenience, but sometimes I use git-annex directly from the command line. I have /Applications/git-annex.app/Contents/MacOS/ in my path, but is there any way you could build the app bundle with the manpage in there so I could add it to my MANPATH?

If you get an error like undefined symbol _iconv for x86_64, you're most likely using libiconv installed by macports. You can fix this by running

cabal install c2hs git-annex --bindir=$HOME/bin --extra-lib-dirs=/usr/lib

Rather than specifying --bindir on the command line for cabal, I edited my ~/.cabal/config to add this line:

symlink-bindir: /usr/local/bin

This installs the binaries to ~/.cabal/bin but symlinks them into /usr/local/bin alongside the links that homebrew installs. Additionally, I symlinked /usr/local/bin/git-annex-shell to /usr/local/bin/git-annex which made things work great from remote hosts via ssh.

I get this error when I try to build git-annex using "cabal install git-annex"

[ 34 of 347] Compiling Utility.Misc     ( Utility/Misc.hs, dist/build/git-annex/git-annex-tmp/Utility/Misc.o )
[ 35 of 347] Compiling Utility.Process  ( Utility/Process.hs, dist/build/git-annex/git-annex-tmp/Utility/Process.o )
[ 36 of 347] Compiling Utility.Network  ( Utility/Network.hs, dist/build/git-annex/git-annex-tmp/Utility/Network.o )
[ 37 of 347] Compiling Utility.SRV      ( Utility/SRV.hs, dist/build/git-annex/git-annex-tmp/Utility/SRV.o )

Utility/SRV.hs:70:54:
    Couldn't match expected type `Maybe
                                    [(Int, Int, Integer, B8.ByteString)]'
                with actual type `Either
                                    dns-1.0.0:Network.DNS.Internal.DNSError
                                    [(Int, Int, Int, dns-1.0.0:Network.DNS.Internal.Domain)]'
    In the third argument of `maybe', namely `r'
    In the second argument of `($)', namely
      `maybe [] (orderHosts . map tohosts) r'
    In a stmt of a 'do' block:
      return $ maybe [] (orderHosts . map tohosts) r
Failed to install git-annex-4.20130909
cabal: Error: some packages failed to install:
git-annex-4.20130909 failed during the building phase. The exception was:
ExitFailure 1

@Kristian, a new version of the DNS library has caused this. A workaround is to pass -f-DNS to the cabal command.

I am in the process of adding support for the new DNS library version in git now.

By the way, please file a bug if you have a big ugly looking build failure like that, so as to not clutter up this page.

Comment by http://joeyh.name/ Tue Sep 17 15:56:17 2013

I have fiddled with the fresh (as of Oct 2nd) build of assistant on OS X 10.8.5, and there has been a lot of problems with bundled software

bundled git is an old 1.7.x version which keeps saying in the daemon logs it is too old to honor .gitignores etc at the same time I have git 1.8.4 installed through homebrew which works very nicely throughout my system

I also have homebrew-installed gpg2:

$ gpg2 --version gpg (GnuPG) 2.0.21 libgcrypt 1.5.3

(and have briefly experimented with using GPGSuite from gpgtools.org, which kept bailing with invalid autolocate directive in gpg.conf)

however there is some unidentifiable gpg binary bundled with the assistant, which cannot connect to gpg-agent from gpg2, and doesn't work with GPGSuite (see above)

is there a way to completely forgo usage of bundled software and have the webapp use whatever is already available on the system?

The FSevents framework itself has been around since leopard.

This fsevents wrapper project supports snow leopard and even leopard, maybe it will provide some clues on how it was done.

I'm guessing it would be worth it, snow leopard is still the most popular OSX as of April. From my own experience, snow leopard is a huge life extender for 2+ year old hardware. Lion just makes them sluggishly painful to use.

Maybe someone could volunteer an SL machine for remote development? Sorry, mine are tied down :(

The git-annex assistant uses file level FSevents to detect which files have been changed. Would it be possible to make it work with older versions that don't provide file-level events? Probably. The code for BSD kqueue deals with similar limitations in needing to scan the directory to find the files that actually changed. If someone cares about old versions of OSX and wants to do that work I'll happily support you.
Comment by http://joeyh.name/ Wed Oct 16 15:14:53 2013

Hello,

I just compiled git-annex using cabal on OS X, and I see there is no dbus support:

Assistant/Threads/NetWatcher.hs:26:0:
     warning: #warning Building without dbus support; will poll for network connection changes

Assistant/Threads/MountWatcher.hs:33:0:
     warning: #warning Building without dbus support; will use mtab polling

Is this problematic? I see I can install dbus using homebrew. If I do so, will I have dbus support (after recompiling git-annex)?

Comment by http://alan.petitepomme.net/ Fri Oct 18 08:24:11 2013
I think I dragged you out of dev mode for commenting unnecessarily, sorry about that. Apparently, Lion and Mountain Lion are fine on older hardware. For a while a daemon cause Lion slowdowns for a day after upgrade for a while, which was enough to cause a reputation.
@Alan you don't need to install dbus on OSX. The polling code will work. On the other hand if you'd like to experiment with installing dbus and report back, perhaps it's worth a try. It's nice when the git-annex assistant can instantly detect when drives are plugged in, and then the network connection changes and react to it. On Linux, dbus gives it that capability.
Comment by http://joeyh.name/ Sat Oct 19 15:31:45 2013

I'm trying to build git-annex with dbus support, and even though I installed dbus (through homebrew), at the end of compilation I get the warning about "building without dbus". Is there something special I need to do for git-annex to see I have installed dbus?

(Also, it tells me at the beginning that I don't have gcrypt, but libgcrypt is installed.)

Comment by http://alan.petitepomme.net/ Sun Oct 20 17:25:04 2013

You probably need to install libdbus dev stuff, and then the haskell dbus library. But it's certainly going to need code changes to make git-annex use dbus in any way on OSX, assuming there are even useful dbus events generated for network connections and drives being mounted on OSX.

It was saying "gcrypt" when it meant "git-remote-gcrypt".

Comment by http://joeyh.name/ Mon Oct 21 22:47:14 2013
I installed the haskell DBus library, but it's still not picking it up. Is there some additional option to pass to cabal, or is it supposed to find it automatically?
Comment by http://alan.petitepomme.net/ Wed Oct 23 11:39:51 2013

Following the Mac OS X brew instructions from the top of the board, I got the following error:

[5 of 5] Compiling Yesod ( Yesod.hs, dist/build/Yesod.o ) In-place registering yesod-1.2.5... Installing library in /Users/srinathv/.cabal/lib/yesod-1.2.5/ghc-7.6.3 Registering yesod-1.2.5... Installed yesod-1.2.5 cabal: Error: some packages failed to install: git-annex-5.20140210 depends on libxml-sax-0.7.4 which failed to install. libxml-sax-0.7.4 failed during the configure step. The exception was: ExitFailure 1 network-protocol-xmpp-0.4.5 depends on libxml-sax-0.7.4 which failed to install.

Then I perused the comments and did: $brew link libmxl2 --force $cabal install git-annex --bindir=$HOME/bin

with success.

Comments on this page are closed.