homebrew-core/Formula/diffoscope.rb

63 lines
2.4 KiB
Ruby

class Diffoscope < Formula
include Language::Python::Virtualenv
desc "In-depth comparison of files, archives, and directories"
homepage "https://diffoscope.org"
url "https://files.pythonhosted.org/packages/47/19/c28e4ddd0ebf5601725939b74b6aa1463523ef65e8e0753c695ced871155/diffoscope-160.tar.gz"
sha256 "f164b5e74cc11f6238ad8d62c92d3a819fa4c8b618683fc0533e04f21acae6b2"
license "GPL-3.0-or-later"
livecheck do
url :stable
end
bottle do
cellar :any_skip_relocation
sha256 "69557b54a73292d32bc8a3fcb03699e6a7b8a4b39f34fe4e552b2f1ca78d6864" => :catalina
sha256 "dd1ae6de32c26ea68d6ea5fc5c3b47dd61c566151054549c99f6fa69713f2aba" => :mojave
sha256 "005775db01a419fa6576906e2325e5a90e9be89c44fd3da22c7fe325b53e05c1" => :high_sierra
end
depends_on "gnu-tar"
depends_on "libarchive"
depends_on "libmagic"
depends_on "python@3.8"
# Use resources from diffoscope[cmdline]
resource "argcomplete" do
url "https://files.pythonhosted.org/packages/df/a0/3544d453e6b80792452d71fdf45aac532daf1c2b2d7fc6cb712e1c3daf11/argcomplete-1.12.0.tar.gz"
sha256 "2fbe5ed09fd2c1d727d4199feca96569a5b50d44c71b16da9c742201f7cc295c"
end
resource "libarchive-c" do
url "https://files.pythonhosted.org/packages/63/fe/9e6c78db381934e28c7ec3d30d4f209fe24442d17f1bd8c56d13ae185cf6/libarchive-c-2.9.tar.gz"
sha256 "9919344cec203f5db6596a29b5bc26b07ba9662925a05e24980b84709232ef60"
end
resource "progressbar" do
url "https://files.pythonhosted.org/packages/a3/a6/b8e451f6cff1c99b4747a2f7235aa904d2d49e8e1464e0b798272aa84358/progressbar-2.5.tar.gz"
sha256 "5d81cb529da2e223b53962afd6c8ca0f05c6670e40309a7219eacc36af9b6c63"
end
resource "python-magic" do
url "https://files.pythonhosted.org/packages/e3/85/1aff76b966622868a73717abd8b501a3c91890e23a65e5f574ff6df1970f/python-magic-0.4.18.tar.gz"
sha256 "b757db2a5289ea3f1ced9e60f072965243ea43a2221430048fd8cacab17be0ce"
end
def install
venv = virtualenv_create(libexec, Formula["python@3.8"].opt_bin/"python3")
venv.pip_install resources
venv.pip_install buildpath
bin.install libexec/"bin/diffoscope"
libarchive = Formula["libarchive"].opt_lib/"libarchive.dylib"
bin.env_script_all_files(libexec/"bin", LIBARCHIVE: libarchive)
end
test do
(testpath/"test1").write "test"
cp testpath/"test1", testpath/"test2"
system "#{bin}/diffoscope", "--progress", "test1", "test2"
end
end