59 lines
2.4 KiB
Ruby
59 lines
2.4 KiB
Ruby
class Diffoscope < Formula
|
|
desc "In-depth comparison of files, archives, and directories"
|
|
homepage "https://diffoscope.org"
|
|
url "https://files.pythonhosted.org/packages/89/3f/e99b3a34f7b57b9680582936db229bba361e12b088a20cf82ebd3fafcd8c/diffoscope-128.tar.gz"
|
|
sha256 "b3baeb222b8ea81765c4b1e3db084da923e0f08f1a4d1207014abb4f0cd29568"
|
|
|
|
bottle do
|
|
cellar :any_skip_relocation
|
|
sha256 "a3adf0916ecc3946fa7edf974b05d8b2dcd39caab86056ef3572e1f0e4122b71" => :catalina
|
|
sha256 "a3adf0916ecc3946fa7edf974b05d8b2dcd39caab86056ef3572e1f0e4122b71" => :mojave
|
|
sha256 "a3adf0916ecc3946fa7edf974b05d8b2dcd39caab86056ef3572e1f0e4122b71" => :high_sierra
|
|
end
|
|
|
|
depends_on "gnu-tar"
|
|
depends_on "libarchive"
|
|
depends_on "libmagic"
|
|
depends_on "python"
|
|
|
|
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/84/30/80932401906eaf787f2e9bd86dc458f1d2e75b064b4c187341f29516945c/python-magic-0.4.15.tar.gz"
|
|
sha256 "f3765c0f582d2dfc72c15f3b5a82aecfae9498bd29ca840d72f37d7bd38bfcd5"
|
|
end
|
|
|
|
def install
|
|
ENV.delete("PYTHONPATH") # play nice with libmagic --with-python
|
|
|
|
pyver = Language::Python.major_minor_version "python3"
|
|
ENV.prepend_create_path "PYTHONPATH", libexec/"vendor/lib/python#{pyver}/site-packages"
|
|
|
|
resources.each do |r|
|
|
r.stage do
|
|
system "python3", *Language::Python.setup_install_args(libexec/"vendor")
|
|
end
|
|
end
|
|
|
|
ENV.prepend_create_path "PYTHONPATH", libexec/"lib/python#{pyver}/site-packages"
|
|
system "python3", *Language::Python.setup_install_args(libexec)
|
|
bin.install Dir[libexec/"bin/*"]
|
|
libarchive = Formula["libarchive"].opt_lib/"libarchive.dylib"
|
|
bin.env_script_all_files(libexec/"bin", :PYTHONPATH => ENV["PYTHONPATH"],
|
|
:LIBARCHIVE => libarchive)
|
|
end
|
|
|
|
test do
|
|
(testpath/"test1").write "test"
|
|
cp testpath/"test1", testpath/"test2"
|
|
system "#{bin}/diffoscope", "--progress", "test1", "test2"
|
|
end
|
|
end
|