2015-12-02 11:30:21 +00:00
|
|
|
class Diffoscope < Formula
|
|
|
|
desc "In-depth comparison of files, archives, and directories."
|
|
|
|
homepage "https://diffoscope.org"
|
|
|
|
url "https://pypi.python.org/packages/source/d/diffoscope/diffoscope-42.tar.gz"
|
|
|
|
sha256 "c0241acf5de7eb0e9e209e43dbf389beca722ddfb8b5d5630fd40569f1f465e2"
|
2016-12-23 15:12:54 +00:00
|
|
|
revision 1
|
2015-12-02 11:30:21 +00:00
|
|
|
|
2015-12-02 11:40:48 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any_skip_relocation
|
2016-12-24 09:25:22 +00:00
|
|
|
sha256 "c82b2fa62c50c2c3bf9e9fc76180260eb2e74271da3087831aa3861305b0a881" => :sierra
|
|
|
|
sha256 "0ba46201e568d407d5950e8494eae43c1bb3e72926f707c416e8804392b4848a" => :el_capitan
|
|
|
|
sha256 "0ba46201e568d407d5950e8494eae43c1bb3e72926f707c416e8804392b4848a" => :yosemite
|
2015-12-02 11:40:48 +00:00
|
|
|
end
|
|
|
|
|
2015-12-02 11:30:21 +00:00
|
|
|
depends_on "libmagic"
|
|
|
|
depends_on "libarchive"
|
|
|
|
depends_on "gnu-tar"
|
|
|
|
depends_on :python3
|
|
|
|
|
2015-12-02 15:24:14 +00:00
|
|
|
patch do
|
2016-09-29 05:25:01 +00:00
|
|
|
# Patch for legacy diff(1)
|
|
|
|
# https://anonscm.debian.org/cgit/reproducible/diffoscope.git/patch/?id=261be7
|
|
|
|
url "https://raw.githubusercontent.com/Homebrew/formula-patches/ebbff7b/diffoscope/patch-legacy-diff.diff"
|
2015-12-02 15:24:14 +00:00
|
|
|
sha256 "aeaffa34a774e05477c9ef78df35174b006670b2963b9064c9c4c13484825b0b"
|
|
|
|
end
|
|
|
|
|
2015-12-02 11:30:21 +00:00
|
|
|
resource "libarchive-c" do
|
|
|
|
url "https://pypi.python.org/packages/source/l/libarchive-c/libarchive-c-2.2.tar.gz"
|
|
|
|
sha256 "5d54aa6f6ab21e3bd12c2f8b6c4e80316b049c2b60ab0a4418cb34d8c63e997c"
|
|
|
|
end
|
|
|
|
|
|
|
|
resource "python-magic" do
|
|
|
|
url "https://pypi.python.org/packages/source/p/python-magic/python-magic-0.4.10.tar.gz"
|
|
|
|
sha256 "79fd2865ec96074749825f9e9562953995d5bf12b6793f24d75c37479ad4a2c3"
|
|
|
|
end
|
|
|
|
|
|
|
|
def install
|
|
|
|
inreplace "diffoscope/comparators/tar.py", "'tar'", "'gtar'"
|
|
|
|
|
|
|
|
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"
|
2016-09-24 15:45:48 +00:00
|
|
|
bin.env_script_all_files(libexec+"bin", :PYTHONPATH => ENV["PYTHONPATH"],
|
|
|
|
:LIBARCHIVE => libarchive)
|
2015-12-02 11:30:21 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
(testpath/"test1").write "test"
|
|
|
|
cp testpath/"test1", testpath/"test2"
|
|
|
|
system "#{bin}/diffoscope", "test1", "test2"
|
|
|
|
end
|
|
|
|
end
|