2010-05-18 23:09:29 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Opencv <Formula
|
2010-08-04 23:54:36 +00:00
|
|
|
# Use head, don't install 2.1.0 due to a *massive* memory leak:
|
|
|
|
# https://code.ros.org/trac/opencv/ticket/253
|
|
|
|
head 'https://code.ros.org/svn/opencv/trunk/opencv', :using => :svn
|
2010-05-18 23:09:29 +00:00
|
|
|
homepage 'http://opencv.willowgarage.com/wiki/'
|
2010-08-04 23:54:36 +00:00
|
|
|
md5 ''
|
2010-05-18 23:09:29 +00:00
|
|
|
|
|
|
|
depends_on 'cmake'
|
|
|
|
depends_on 'pkg-config'
|
2010-08-04 23:54:36 +00:00
|
|
|
|
2010-05-18 23:09:29 +00:00
|
|
|
# Optional.
|
|
|
|
depends_on 'libtiff'
|
|
|
|
depends_on 'jasper'
|
2010-08-04 23:54:36 +00:00
|
|
|
depends_on 'tbb'
|
2010-05-18 23:09:29 +00:00
|
|
|
|
|
|
|
# Very Optional? Pulls in lots of dependencies but maybe not needed unless you're doing video analysis
|
|
|
|
# Video analysis requires a bunch more things which we don't have: libgstreamer, libxine, unicap, libdc1394 2.x (or libdc1394 1.x + libraw1394).
|
|
|
|
# We can leave this disabled for now.
|
|
|
|
# Maybe we could add a flag?
|
|
|
|
#depends_on 'ffmpeg'
|
2010-08-04 23:54:36 +00:00
|
|
|
|
2010-05-18 23:09:29 +00:00
|
|
|
# There are other optional dependencies but they don't currently exist in Homebrew.
|
|
|
|
|
|
|
|
def install
|
|
|
|
system "cmake -G 'Unix Makefiles' -DCMAKE_INSTALL_PREFIX:PATH=#{prefix} ."
|
|
|
|
system "make"
|
|
|
|
system "make install"
|
|
|
|
end
|
2010-08-04 23:54:36 +00:00
|
|
|
|
2010-05-18 23:09:29 +00:00
|
|
|
def caveats
|
|
|
|
return <<-EOS
|
|
|
|
The OpenCV Python module will not work until you edit your PYTHONPATH like so:
|
2010-08-04 23:54:36 +00:00
|
|
|
|
2010-05-18 23:09:29 +00:00
|
|
|
export PYTHONPATH="#{HOMEBREW_PREFIX}/lib/python2.6/site-packages/:$PYTHONPATH"
|
2010-08-04 23:54:36 +00:00
|
|
|
|
2010-05-18 23:09:29 +00:00
|
|
|
To make this permanent, put it in your shell's profile (e.g. ~/.profile).
|
|
|
|
EOS
|
|
|
|
end
|
|
|
|
end
|