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/0e/ab/be8f7b727faa455db44ba8d90686cd03d0744da4eb1bedcedd7f9b87a041/diffoscope-161.tar.gz"
sha256 "9c27d60a7bf3984b53c8af3fee86eb3d3e2292c4ddb9449c38b6cba068b8e22c"
license "GPL-3.0-or-later"
livecheck do
url :stable
end
bottle do
cellar :any_skip_relocation
sha256 "411c673f78292775d2b122e07bed12116fe282d9cc838c38819facd5dd7a5013" => :catalina
sha256 "3360a5e8daa917441bc5e432e3c72b3072b9bd3b9161ee8ac1d07c2bb8ca0c63" => :mojave
sha256 "cd3dd6895228267bdff1049a6d0ea4ef96b8a65a24861fdb2b5b7f5cee1b46e8" => :high_sierra
end
depends_on "gnu-tar"
depends_on "libarchive"
depends_on "libmagic"
depends_on "python@3.9"
# Use resources from diffoscope[cmdline]
resource "argcomplete" do
url "https://files.pythonhosted.org/packages/45/bd/98dfd56ea8f6b2b7dd89bea8b067a55a6dbaec7b4cc28186cbafe2e1d24e/argcomplete-1.12.1.tar.gz"
sha256 "849c2444c35bb2175aea74100ca5f644c29bf716429399c0f2203bb5d9a8e4e6"
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.9"].opt_bin/"python3")
venv.pip_install resources
venv.pip_install buildpath
bin.install libexec/"bin/diffoscope"
libarchive = Formula["libarchive"].opt_lib/shared_library("libarchive")
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