homebrew-core/Formula/diffoscope.rb

59 lines
2.3 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/00/9c/24f31ba83d7a0a50c48a5bf7ff0ef875ebfba49de8dfa3b61832d6981cab/diffoscope-149.tar.gz"
sha256 "38bd10b07893f8cda24f4433da9287f543227349f87e2590e90cc7f2df650996"
bottle do
cellar :any_skip_relocation
sha256 "c727fbee3d4c7e8056d9015b6027c917ac76c3b214d57aecddf55f432a16857d" => :catalina
sha256 "cbc2eb2ec9172cc4c3743fccdc8a5f684d2fc089d7cd423045e5acee390e6a8e" => :mojave
sha256 "32705ed9fd0b48e8709e2e7c514a24aa41fd007c074077ebbd79855ac4a4a2f2" => :high_sierra
end
depends_on "gnu-tar"
depends_on "libarchive"
depends_on "libmagic"
depends_on "python@3.8"
# required by cmdline
resource "argcomplete" do
url "https://files.pythonhosted.org/packages/43/61/345856864a72ccc004bea5f74183c58bfd6675f9eab931ff9ce21a8fe06b/argcomplete-1.11.1.tar.gz"
sha256 "5ae7b601be17bf38a749ec06aa07fb04e7b6b5fc17906948dc1866e7facf3740"
end
resource "libarchive-c" do
url "https://files.pythonhosted.org/packages/63/fe/9e6c78db381934e28c7ec3d30d4f209fe24442d17f1bd8c56d13ae185cf6/libarchive-c-2.9.tar.gz"
sha256 "9919344cec203f5db6596a29b5bc26b07ba9662925a05e24980b84709232ef60"
end
# required by cmdline
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