diff options
| author | Laurent Arnoud | 2014-07-22 16:15:31 +0200 |
|---|---|---|
| committer | Mike McQuaid | 2014-07-28 19:36:08 +0200 |
| commit | 331adc4fbf2e068291696d7442a846dedd078f19 (patch) | |
| tree | f29c8cb969c23537ea741816117a5cce23a333e3 /Library | |
| parent | 08c882e7ffd5cdb6d8710ee76be21f6fb0fe01c8 (diff) | |
| download | homebrew-331adc4fbf2e068291696d7442a846dedd078f19.tar.bz2 | |
hachoir-metadata 1.3.3
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Formula/hachoir-metadata.rb | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/Library/Formula/hachoir-metadata.rb b/Library/Formula/hachoir-metadata.rb new file mode 100644 index 000000000..7d350b129 --- /dev/null +++ b/Library/Formula/hachoir-metadata.rb @@ -0,0 +1,46 @@ +require "formula" + +class HachoirMetadata < Formula + homepage "https://bitbucket.org/haypo/hachoir/wiki/Home" + url "http://cheeseshop.python.org/packages/source/h/hachoir-metadata/hachoir-metadata-1.3.3.tar.gz" + sha1 "6f44f2f15a5d24866636117901d0b870137d8af7" + + depends_on :python if MacOS.version <= :snow_leopard + + resource "hachoir-core" do + url "http://cheeseshop.python.org/packages/source/h/hachoir-core/hachoir-core-1.3.3.tar.gz" + sha1 "e1d3b5da7d57087c922942b7653cb3b195c7769f" + end + + resource "hachoir-parser" do + url "http://cheeseshop.python.org/packages/source/h/hachoir-parser/hachoir-parser-1.3.4.tar.gz" + sha1 "8433e1598b1e8d9404e6978117a203775e68c075" + end + + resource "hachoir-regex" do + url "http://cheeseshop.python.org/packages/source/h/hachoir-regex/hachoir-regex-1.0.5.tar.gz" + sha1 "98a3c7e8922f926fdb6c1dec92e093d75712eb3b" + end + + def install + ENV["PYTHONPATH"] = lib+"python2.7/site-packages" + ENV.prepend_create_path "PYTHONPATH", libexec+"lib/python2.7/site-packages" + ENV.prepend_create_path "PYTHONPATH", prefix+"lib/python2.7/site-packages" + + ["hachoir-core", "hachoir-parser", "hachoir-regex"].each do |res| + resource(res).stage do + system "python", "setup.py", "install", "--prefix=#{libexec}" + end + end + + system "python", "setup.py", "install", "--prefix=#{prefix}" + bin.env_script_all_files(libexec+"bin", :PYTHONPATH => ENV["PYTHONPATH"]) + end + + test do + test_png = HOMEBREW_LIBRARY/"Homebrew/test/fixtures/test.png" + output = `#{bin}/hachoir-metadata --mime #{test_png}` + assert output.include?("image/png") + assert_equal 0, $?.exitstatus + end +end |
