git-annex: 5.20140421

installing git-annex with cabal-install is quite long and requires to install
some heavy packages. It also has several external lib dependencies and needs a
few configuration flags to build so it is quite difficult to install too.
This formula should make it easy and quick to install with a bottle.

The huge number of haskell dependencies is built within the formula and statically
linked to git-annex. The haskell libraries built are discarded - cabal-install
should be used instead of this package in order to keep them.
This commit is contained in:
Gaëtan Lehmann 2014-03-28 01:59:50 +01:00 committed by Mike McQuaid
parent 9b4d37fbd8
commit 63603a8d20

53
Formula/git-annex.rb Normal file
View file

@ -0,0 +1,53 @@
require "formula"
require "language/haskell"
class GitAnnex < Formula
include Language::Haskell::Cabal
homepage "https://git-annex.branchable.com/"
url "http://hackage.haskell.org/package/git-annex-5.20140421/git-annex-5.20140421.tar.gz"
sha1 "f818164eaddf2887a15c0c4c745a1cb8174152dc"
depends_on "gcc" => :build
depends_on "ghc" => :build
depends_on "cabal-install" => :build
depends_on "pkg-config" => :build
depends_on "gsasl"
depends_on "libidn"
depends_on "gnutls"
depends_on "gmp"
def install
cabal_sandbox do
cabal_install_tools "alex", "happy", "c2hs"
# gcc required to build gnuidn
cabal_install "--with-gcc=#{Formula["gcc"].bin}/gcc-4.8", "--only-dependencies"
cabal_install "--prefix=#{prefix}"
end
system "make", "git-annex.1", "git-annex-shell.1"
man1.install "git-annex.1", "git-annex-shell.1"
end
test do
# make sure git can find git-annex
ENV.prepend_path 'PATH', bin
# create a first git repository with an annex
mkdir "my_annex" do
system "git", "init"
system "git", "annex", "init", "my_annex"
cp bin/"git-annex", "bigfile"
system "git", "annex", "add", "bigfile"
system "git", "commit", "-am", "big file added"
assert File.symlink? "bigfile"
end
# and propagate its content to another
system "git", "clone", "my_annex", "my_annex_clone"
Dir.chdir "my_annex_clone" do
assert (not File.file? "bigfile")
system "git", "annex", "get", "bigfile"
assert File.file? "bigfile"
end
# make test files writable so homebrew can drop them
chmod_R 0777, testpath
end
end