mat: rename to mat2

Closes #34000.

Signed-off-by: FX Coudert <fxcoudert@gmail.com>
This commit is contained in:
Tom Schoonjans 2018-11-13 17:49:20 +00:00 committed by FX Coudert
parent 0db29ca8e5
commit 2dd1deea91
4 changed files with 63 additions and 85 deletions

1
Aliases/mat Symbolic link
View file

@ -0,0 +1 @@
../Formula/mat2.rb

View file

@ -1,85 +0,0 @@
class Mat < Formula
desc "Metadata anonymization toolkit"
homepage "https://mat.boum.org/"
url "https://mat.boum.org/files/mat-0.6.1.tar.xz"
sha256 "0782e7db554ad1dddefd71c9c81e36a05464d73ab54ee2a474ea6ac90e8e51b9"
revision 2
bottle do
cellar :any_skip_relocation
rebuild 1
sha256 "564d84f0aa5dcce93fca87d91859cc87afbea8d9f915e4cc235117aa0f196d05" => :mojave
sha256 "b283b291b6bf2c328a5c47c0eff442eb757575e3572071ec17ee7aed5e8e39e7" => :high_sierra
sha256 "e03173ae8fc422f595f67c2b878e4e984592b0fa0aba15b1bf1138e8e37c6839" => :sierra
end
depends_on "gettext" => :build
depends_on "intltool" => :build
depends_on "coreutils"
depends_on "poppler"
depends_on "py2cairo"
depends_on "pygobject3" => "with-python@2"
resource "hachoir-core" do
url "https://files.pythonhosted.org/packages/source/h/hachoir-core/hachoir-core-1.3.3.tar.gz"
sha256 "ecf5d16eccc76b22071d6062e54edb67595f70d827644d3a6dff04289b4058df"
end
resource "hachoir-parser" do
url "https://files.pythonhosted.org/packages/source/h/hachoir-parser/hachoir-parser-1.3.4.tar.gz"
sha256 "775be5e10d72c6122b1ba3202dfce153c09ebcb60080d8edbd51aa89aa4e6b3f"
end
resource "pdfrw" do
url "https://files.pythonhosted.org/packages/source/p/pdfrw/pdfrw-0.2.tar.gz"
sha256 "09f734df28f9ad712a2c14308b1d60e7202762c3ce2e32a6ad30e7ec149822b2"
end
resource "distutils-extra" do
url "https://launchpad.net/python-distutils-extra/trunk/2.38/+download/python-distutils-extra-2.38.tar.gz"
sha256 "3d100d5d3492f40b3e7a6a4500f71290bfa91e2c50dc31ba8e3ff9b5d82ca153"
end
resource "mutagen" do
url "https://files.pythonhosted.org/packages/source/m/mutagen/mutagen-1.31.tar.gz"
sha256 "0aa011707785fe30935d8655380052a20ba8b972aa738d4f144c457b35b4d699"
end
def install
pygobject3 = Formula["pygobject3"]
ENV["PYTHONPATH"] = lib+"python2.7/site-packages"
ENV.append_path "PYTHONPATH", pygobject3.opt_lib+"python2.7/site-packages"
ENV.prepend_create_path "PYTHONPATH", libexec+"lib/python2.7/site-packages"
%w[hachoir-core hachoir-parser pdfrw distutils-extra mutagen].each do |r|
resource(r).stage do
pyargs = ["setup.py", "install", "--prefix=#{libexec}"]
unless %w[hachoir-core hachoir-parser pdfrw mutagen].include? r
pyargs << "--single-version-externally-managed" << "--record=installed.txt"
end
system "python", *pyargs
end
end
system "python", "setup.py", "install", "--prefix=#{prefix}"
# Since we don't support it let's remove the GUI binary.
rm bin/"mat-gui"
man1.install Dir["*.1"]
bin.env_script_all_files(libexec/"bin", :PYTHONPATH => ENV["PYTHONPATH"])
end
def caveats
<<~EOS
MAT was built without PDF support nor GUI.
EOS
end
test do
system "#{bin}/mat", "-l"
touch "foo"
system "tar", "cf", "foo.tar", "foo"
system "#{bin}/mat", "-c", "foo.tar"
end
end

61
Formula/mat2.rb Normal file
View file

@ -0,0 +1,61 @@
class Mat2 < Formula
desc "Metadata anonymization toolkit"
homepage "https://0xacab.org/jvoisin/mat2"
url "https://0xacab.org/jvoisin/mat2/uploads/e958dde527c7255e94ae2b347086ba9f/mat-0.6.0.tar.xz"
sha256 "96c55c455a5d556bed41487476ae98866ebe8e7ef01a75325c9e274c7e1ce842"
depends_on "exiftool"
depends_on "ffmpeg"
depends_on "poppler"
depends_on "py3cairo"
depends_on "pygobject3"
depends_on "python"
resource "mutagen" do
url "https://files.pythonhosted.org/packages/source/m/mutagen/mutagen-1.41.1.tar.gz"
sha256 "2ea9c900a05fa7f5f4c5bd9fc1475d7d576532e13b2f79b694452b997ff67200"
end
# fix list option return value
patch :DATA
def install
inreplace "libmat2/exiftool.py", "/usr/bin/exiftool", "#{HOMEBREW_PREFIX}/bin/exiftool"
inreplace "libmat2/video.py", "/usr/bin/ffmpeg", "#{HOMEBREW_PREFIX}/bin/ffmpeg"
version = Language::Python.major_minor_version("python3")
pygobject3 = Formula["pygobject3"]
ENV["PYTHONPATH"] = lib/"python#{version}/site-packages"
ENV.append_path "PYTHONPATH", pygobject3.opt_lib+"python#{version}/site-packages"
ENV.prepend_create_path "PYTHONPATH", libexec/"vendor/lib/python#{version}/site-packages"
resources.each do |r|
r.stage do
system "python3", *Language::Python.setup_install_args(libexec/"vendor")
end
end
system "python3", *Language::Python.setup_install_args(prefix)
bin.env_script_all_files(libexec/"bin", :PYTHONPATH => ENV["PYTHONPATH"])
end
test do
system "#{bin}/mat2", "-l"
end
end
__END__
diff --git a/mat2 b/mat2
index ff8a253..151cbf6 100755
--- a/mat2
+++ b/mat2
@@ -133,7 +133,7 @@ def show_parsers() -> bool:
continue
formats.add(' - %s (%s)' % (mtype, ', '.join(extensions)))
print('\n'.join(sorted(formats)))
- return True
+ return 0
def __get_files_recursively(files: List[str]) -> Generator[str, None, None]:

View file

@ -114,6 +114,7 @@
"lua@5.3": "lua",
"mapnik2": "mapnik@2",
"mariadb100": "mariadb@10.0",
"mat": "mat2",
"maven31": "maven@3.1",
"maven32": "maven@3.2",
"mobile-shell": "mosh",