require "language/haskell" class GitAnnex < Formula include Language::Haskell::Cabal desc "Manage files with git without checking in file contents" homepage "https://git-annex.branchable.com/" url "https://hackage.haskell.org/package/git-annex-6.20160126/git-annex-6.20160126.tar.gz" sha256 "dc59f670a3d0bdb90db8fc6cadba8003708219bb0dc3d56867a9246d825c0d11" head "git://git-annex.branchable.com/" bottle do revision 1 sha256 "cae47a07807195ea29aad622784872207c1b8af3868ac25bb1fcd63835c620ef" => :el_capitan sha256 "d68da09d6f22ec0aef7912ffa32f3f57c6ab46687192559c41d3a5cd5f81bd71" => :yosemite sha256 "03597faf2810cf06d5b2f59c2f72d68c62087ca0ffd500c5c723d233883bc13b" => :mavericks end option "with-git-union-merge", "Build the git-union-merge tool" 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 "quvi" def install install_cabal_package :using => ["alex", "happy", "c2hs"] do # this can be made the default behavior again once git-union-merge builds properly when bottling if build.with? "git-union-merge" system "make", "git-union-merge", "PREFIX=#{prefix}" bin.install "git-union-merge" system "make", "git-union-merge.1", "PREFIX=#{prefix}" end end bin.install_symlink "git-annex" => "git-annex-shell" end test do # make sure git can find git-annex ENV.prepend_path "PATH", bin # We don't want this here or it gets "caught" by git-annex. rm_r "Library/Python/2.7/lib/python/site-packages/homebrew.pth" system "git", "init" system "git", "annex", "init" (testpath/"Hello.txt").write "Hello!" assert !File.symlink?("Hello.txt") assert_match "add Hello.txt ok", shell_output("git annex add .") system "git", "commit", "-a", "-m", "Initial Commit" assert File.symlink?("Hello.txt") # The steps below are necessary to ensure the directory cleanly deletes. # git-annex guards files in a way that isn't entirely friendly of automatically # wiping temporary directories in the way `brew test` does at end of execution. system "git", "rm", "Hello.txt", "-f" system "git", "commit", "-a", "-m", "Farewell!" system "git", "annex", "unused" assert_match "dropunused 1 ok", shell_output("git annex dropunused 1 --force") system "git", "annex", "uninit" end end