89 lines
3.2 KiB
Ruby
89 lines
3.2 KiB
Ruby
class GitAnnex < Formula
|
|
desc "Manage files with git without checking in file contents"
|
|
homepage "https://git-annex.branchable.com/"
|
|
url "https://hackage.haskell.org/package/git-annex-8.20201007/git-annex-8.20201007.tar.gz"
|
|
sha256 "0af92007388dbb0cbd02dc3d1565b6712bcae56de7089f31dfdff63909f3216c"
|
|
license all_of: ["AGPL-3.0-or-later", "BSD-2-Clause", "BSD-3-Clause",
|
|
"GPL-2.0-only", "GPL-3.0-or-later", "MIT"]
|
|
head "git://git-annex.branchable.com/"
|
|
|
|
livecheck do
|
|
url :stable
|
|
end
|
|
|
|
bottle do
|
|
cellar :any
|
|
sha256 "f2c38120494f3ad79479f71be3dea9c2d70835f4741f7b6e9895a5c134b33115" => :catalina
|
|
sha256 "b34d6d5111db90eef1df3557f2edc766d4e8ec77c68b16c395bd5b5c846dd81c" => :mojave
|
|
sha256 "0a5add918150d312a27174e8b04d0323a141cbe2db3667a8f804d50fbef1eae7" => :high_sierra
|
|
end
|
|
|
|
depends_on "cabal-install" => :build
|
|
depends_on "ghc@8.6" => :build
|
|
depends_on "pkg-config" => :build
|
|
depends_on "gsasl"
|
|
depends_on "libmagic"
|
|
depends_on "quvi"
|
|
|
|
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
|
|
|
|
plist_options manual: "git annex assistant --autostart"
|
|
|
|
def plist
|
|
<<~EOS
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
<plist version="1.0">
|
|
<dict>
|
|
<key>Label</key>
|
|
<string>#{plist_name}</string>
|
|
<key>RunAtLoad</key>
|
|
<true/>
|
|
<key>KeepAlive</key>
|
|
<false/>
|
|
<key>ProgramArguments</key>
|
|
<array>
|
|
<string>#{opt_bin}/git-annex</string>
|
|
<string>assistant</string>
|
|
<string>--autostart</string>
|
|
</array>
|
|
</dict>
|
|
</plist>
|
|
EOS
|
|
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.*\(recording state in git\.\.\.\)/m, shell_output("git annex add .")
|
|
system "git", "commit", "-a", "-m", "Initial Commit"
|
|
assert File.symlink?("Hello.txt")
|
|
|
|
# make sure the various remotes were built
|
|
assert_match shell_output("git annex version | grep 'remote types:'").chomp,
|
|
"remote types: git gcrypt p2p S3 bup directory rsync web bittorrent " \
|
|
"webdav adb tahoe glacier ddar git-lfs httpalso hook external"
|
|
|
|
# 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
|