2014-03-28 00:59:50 +00:00
|
|
|
require "formula"
|
|
|
|
require "language/haskell"
|
|
|
|
|
|
|
|
class GitAnnex < Formula
|
|
|
|
include Language::Haskell::Cabal
|
|
|
|
|
|
|
|
homepage "https://git-annex.branchable.com/"
|
2014-10-15 19:36:17 +00:00
|
|
|
url "http://hackage.haskell.org/package/git-annex-5.20141013/git-annex-5.20141013.tar.gz"
|
|
|
|
sha1 "db93f75db07862ce85bdc14adfdac5aba6104f90"
|
2014-03-28 00:59:50 +00:00
|
|
|
|
2014-05-06 22:52:15 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any
|
2014-10-16 03:17:12 +00:00
|
|
|
sha1 "9f353c6f66e8db47bd91a3c0fc65599aca50ad50" => :mavericks
|
|
|
|
sha1 "264534752e8d2c26e49c84a77571f34fba4fac35" => :mountain_lion
|
|
|
|
sha1 "92c21f66c0518b7daf870d230bdf5a6beed80d05" => :lion
|
2014-05-06 22:52:15 +00:00
|
|
|
end
|
|
|
|
|
2014-03-28 00:59:50 +00:00
|
|
|
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"
|
|
|
|
|
2014-10-16 02:36:41 +00:00
|
|
|
fails_with(:clang) { build 425 } # clang segfaults on Lion
|
|
|
|
|
2014-03-28 00:59:50 +00:00
|
|
|
def install
|
|
|
|
cabal_sandbox do
|
|
|
|
cabal_install_tools "alex", "happy", "c2hs"
|
|
|
|
# gcc required to build gnuidn
|
2014-07-24 07:44:44 +00:00
|
|
|
gcc = Formula["gcc"]
|
|
|
|
cabal_install "--with-gcc=#{gcc.bin}/gcc-#{gcc.version_suffix}",
|
|
|
|
"--only-dependencies"
|
2014-03-28 00:59:50 +00:00
|
|
|
cabal_install "--prefix=#{prefix}"
|
|
|
|
end
|
2014-06-15 20:58:10 +00:00
|
|
|
bin.install_symlink "git-annex" => "git-annex-shell"
|
|
|
|
system "make", "git-annex.1", "git-annex-shell.1", "git-union-merge.1"
|
|
|
|
man1.install "git-annex.1", "git-annex-shell.1", "git-union-merge.1"
|
2014-03-28 00:59:50 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
# make sure git can find git-annex
|
2014-07-29 08:04:59 +00:00
|
|
|
ENV.prepend_path "PATH", bin
|
2014-03-28 00:59:50 +00:00
|
|
|
# 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
|
2014-05-10 21:23:24 +00:00
|
|
|
assert !File.file?("bigfile")
|
2014-03-28 00:59:50 +00:00
|
|
|
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
|