git-annex/ install/ OSX/ MacPorts

This is not a recommended way to install git-annex. Use HomeBrew or the prebuilt app bundle instead.

But if you really want to use 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 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

comment 3

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

Comment by https://www.google.com/accounts/o8/id?id=AItOawlDDW-g2WLLsLpcnCm4LykAquFY_nwbIrU — Wed Oct 29 14:05:27 2025
Macports _iconv

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

Comment by https://www.google.com/accounts/o8/id?id=AItOawmJdzisfT6DhorwRz0kKJ_9-zQbccCopu4 — Wed Oct 29 14:05:27 2025
Comments on this page are closed.