2010-05-18 23:09:29 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Opencv <Formula
|
2010-12-09 10:01:59 +00:00
|
|
|
url 'http://downloads.sourceforge.net/project/opencvlibrary/opencv-unix/2.2/OpenCV-2.2.0.tar.bz2'
|
|
|
|
version "2.2"
|
2010-05-18 23:09:29 +00:00
|
|
|
homepage 'http://opencv.willowgarage.com/wiki/'
|
2010-12-09 10:01:59 +00:00
|
|
|
md5 '122c9ac793a46854ef2819fedbbd6b1b'
|
2010-08-15 18:28:43 +00:00
|
|
|
|
2010-09-19 17:21:57 +00:00
|
|
|
depends_on 'cmake' => :build
|
|
|
|
depends_on 'pkg-config' => :build
|
2010-08-04 23:54:36 +00:00
|
|
|
|
2010-04-07 05:58:35 +00:00
|
|
|
depends_on 'libtiff' => :optional
|
|
|
|
depends_on 'jasper' => :optional
|
|
|
|
depends_on 'tbb' => :optional
|
2010-05-18 23:09:29 +00:00
|
|
|
|
2010-09-13 22:16:09 +00:00
|
|
|
# Can also depend on ffmpeg, but this pulls in a lot of extra stuff that
|
|
|
|
# you don't need unless you're doing video analysis, and some of it isn't
|
|
|
|
# in Homebrew anyway.
|
2010-05-18 23:09:29 +00:00
|
|
|
|
2010-07-30 17:51:05 +00:00
|
|
|
def options
|
|
|
|
[['--build32', 'Force a 32-bit build.']]
|
|
|
|
end
|
|
|
|
|
2010-05-18 23:09:29 +00:00
|
|
|
def install
|
2010-07-30 17:51:05 +00:00
|
|
|
makefiles = "cmake -G 'Unix Makefiles' -DCMAKE_INSTALL_PREFIX:PATH=#{prefix} ."
|
|
|
|
makefiles += " -DOPENCV_EXTRA_C_FLAGS='-arch i386 -m32'" if ARGV.include? '--build32'
|
|
|
|
system makefiles
|
2010-05-18 23:09:29 +00:00
|
|
|
system "make"
|
|
|
|
system "make install"
|
|
|
|
end
|
2010-08-04 23:54:36 +00:00
|
|
|
|
2010-04-07 05:58:35 +00:00
|
|
|
def caveats; <<-EOS.undent
|
|
|
|
The OpenCV Python module will not work until you edit your PYTHONPATH like so:
|
|
|
|
export PYTHONPATH="#{HOMEBREW_PREFIX}/lib/python2.6/site-packages/:$PYTHONPATH"
|
2010-08-04 23:54:36 +00:00
|
|
|
|
2010-04-07 05:58:35 +00:00
|
|
|
To make this permanent, put it in your shell's profile (e.g. ~/.profile).
|
2010-05-18 23:09:29 +00:00
|
|
|
EOS
|
|
|
|
end
|
|
|
|
end
|