homebrew-core/Formula/phash.rb

42 lines
1.2 KiB
Ruby
Raw Normal View History

require 'formula'
class Phash < Formula
homepage 'http://www.phash.org/'
2012-12-17 01:18:45 +00:00
url 'http://www.phash.org/releases/pHash-0.9.5.tar.gz'
sha1 '87ce165b344bb859f5fdaf7c1776b556db3d8a15'
2012-10-27 21:44:03 +00:00
depends_on 'cimg' unless build.include? "disable-image-hash" and build.include? "disable-video-hash"
depends_on 'ffmpeg' unless build.include? "disable-video-hash"
2012-10-27 21:44:03 +00:00
unless build.include? "disable-audio-hash"
depends_on 'libsndfile'
depends_on 'libsamplerate'
depends_on 'mpg123'
end
2012-10-27 21:44:03 +00:00
option "disable-image-hash", "Disable image hash"
option "disable-video-hash", "Disable video hash"
option "disable-audio-hash", "Disable audio hash"
fails_with :clang do
build 318
cause "configure: WARNING: CImg.h: present but cannot be compiled"
end
def install
args = %W[--disable-debug
--disable-dependency-tracking
--prefix=#{prefix}
--enable-shared
]
# disable specific hashes if specified as an option
2012-10-27 21:44:03 +00:00
args << "--disable-image-hash" if build.include? "disable-image-hash"
args << "--disable-video-hash" if build.include? "disable-video-hash"
args << "--disable-audio-hash" if build.include? "disable-audio-hash"
system "./configure", *args
system "make install"
end
end