2011-02-28 23:45:00 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Phash < Formula
|
|
|
|
homepage 'http://www.phash.org/'
|
2013-04-26 15:29:13 +00:00
|
|
|
url 'http://phash.org/releases/pHash-0.9.6.tar.gz'
|
2013-04-26 23:18:13 +00:00
|
|
|
sha1 '26f4c1e7ca6b77e6de2bdfce490b2736d4b63753'
|
2011-02-28 23:45:00 +00:00
|
|
|
|
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"
|
2011-02-28 23:45:00 +00:00
|
|
|
|
2012-10-27 21:44:03 +00:00
|
|
|
unless build.include? "disable-audio-hash"
|
2011-02-28 23:45:00 +00:00
|
|
|
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"
|
2011-02-28 23:45:00 +00:00
|
|
|
|
2012-06-21 17:35:43 +00:00
|
|
|
fails_with :clang do
|
|
|
|
build 318
|
|
|
|
cause "configure: WARNING: CImg.h: present but cannot be compiled"
|
|
|
|
end
|
|
|
|
|
2011-02-28 23:45:00 +00:00
|
|
|
def install
|
2012-06-21 17:35:43 +00:00
|
|
|
args = %W[--disable-debug
|
|
|
|
--disable-dependency-tracking
|
|
|
|
--prefix=#{prefix}
|
|
|
|
--enable-shared
|
|
|
|
]
|
2011-02-28 23:45:00 +00:00
|
|
|
|
|
|
|
# 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"
|
2011-02-28 23:45:00 +00:00
|
|
|
|
|
|
|
system "./configure", *args
|
|
|
|
system "make install"
|
|
|
|
end
|
|
|
|
end
|