git-annex/ install/ OSX/ Homebrew

Homebrew has a formula for git-annex.

Warning: Homebew enables telemetry by default, which is not a good practice. If you are surprised by it doing this, see here and you may want to run `brew analytics off`.

Homebrew users can simply run `brew install git-annex` to install git-annex.

## buiding git-annex from sources

This is the old recipe for building git-annex from source, using packages from homebrew. Useful if you want a newer version than the version in homebrew.

    brew install haskell-platform git ossp-uuid md5sha1sum coreutils gnutls libidn gsasl pkg-config libxml2
    brew link libxml2 --force
    cabal update
    mkdir $HOME/bin
    PATH=$HOME/bin:$PATH
    PATH=$HOME/.cabal/bin:$PATH
    cabal install c2hs --bindir=$HOME/bin
    cabal install gnuidn
    cabal install git-annex --bindir=$HOME/bin

How to install man pages for git-annex?

Did anyone figure out how to get man pages to show for git-annex on mac with homebrew? I have installed on several macs via `brew install git-annex`. I don't seem to have any man pages for git-annex on my system.

Thanks

Comment by liam — Wed Oct 29 14:05:27 2025
Remote Helper?

Homebrew doesn't seem to install the remote helper (`git remote-annex` is not a known command).

Building from source doesn't work because brew installs base>4.20 which is incompatible with filepath-bytestring. Since homebrew is against backward compatibility I presume changing base version by installing a different ghc is out of the question.

Maybe there's a way to do this with sandboxes? I'm not familiar with haskell, can anyone update the build recipe on how to build git-annex on MacOS (Apple silicon)? As I understand it one would need:

1. `brew install ghc cabal-install haskell-stack` instead of `haskell-platform`
2. option `--bindir -> --installdir`
3. To specify `extra-lib-dirs` and `extra-include-dirs` to `/opt/homebrew/(lib|include)` respectively in cabal config or as additional options
4. `base` version `< 4.20` must be installed when installing `ghc`

This is where I got stuck because I can't reinstall `base` without understanding sandboxes or installing a different GHC version (I think? This is effectively my first exposure to haskell)

Comment by Spencer — Wed Oct 29 14:05:27 2025
Man pages not included when installing via homebrew

It seems that for me at least, OSX installations performed with `brew install git-annex` do not include man pages, e.g., if I subsequently run `man git-annex` I get the error `No manual entry for git-annex`. This isn't an enormous bother as I can instead browse documentation as needed on the website, but it's a headache when I'm working offline and even when not it can be irksome to have to leave the terminal.

Below I've pasted the relevant lines that govern how homebrew performs the installation (or in practice, how the "bottle" is built as part of a CI process, and which bottle is typically "poured" by end users rather than compiling locally).

      def install
        system "cabal", "v2-update"
        system "cabal", "v2-install", *std_cabal_v2_args,
                        "--flags=+S3"
        bin.install_symlink "git-annex" => "git-annex-shell"
      end

Notably, it uses `cabal` to do the installation, but it doesn't quite follow any of the cabal-related patterns currently outlined on the "installing from source" documentation. I inspected the bottle that homebrew downloads, and indeed it contains just a handful of files that do not include the man pages, i.e.:

    .
    ├── CHANGELOG
    ├── COPYRIGHT
    ├── NEWS
    ├── README
    ├── bin
    │   ├── git-annex
    │   └── git-annex-shell -> git-annex
    ├── homebrew.git-annex.service
    └── homebrew.mxcl.git-annex.plist

    1 directory, 8 files

Is there an easy tweak to the cabal-based installation that homebrew currently uses to do its bottling that would include man pages, or would it be a potentially significant undertaking that would require an appreciably different build approach?

Comment by Dan — Wed Oct 29 14:05:27 2025
Cannot install c2hs

When I run the following command: cabal install c2hs --bindir=$HOME/bin

I get the following error:

Error: some packages failed to install: c2hs-0.28.1 depends on language-c-0.5.0 which failed to install. language-c-0.5.0 failed during the configure step. The exception was: ExitFailure 1

Comment by IgorGanapolsky — Wed Oct 29 14:05:27 2025
Comments on this page are closed.