2010-05-18 23:09:29 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Opencv <Formula
|
2010-08-15 18:28:43 +00:00
|
|
|
# Don't use stable 2.1.0 due to a massive memory leak:
|
2010-08-04 23:54:36 +00:00
|
|
|
# https://code.ros.org/trac/opencv/ticket/253
|
2010-08-15 18:28:43 +00:00
|
|
|
url 'https://code.ros.org/svn/opencv/trunk/opencv', :using => :svn, :revision => '3478'
|
|
|
|
version "2.1.1-pre"
|
2010-05-18 23:09:29 +00:00
|
|
|
homepage 'http://opencv.willowgarage.com/wiki/'
|
|
|
|
|
2010-08-15 18:28:43 +00:00
|
|
|
# NOTE: Head builds past the revision above may break on OS X
|
|
|
|
head 'https://code.ros.org/svn/opencv/trunk/opencv', :using => :svn
|
|
|
|
|
2010-05-18 23:09:29 +00:00
|
|
|
depends_on 'cmake'
|
|
|
|
depends_on 'pkg-config'
|
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-04-07 05:58:35 +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.
|
|
|
|
# depends_on 'ffmpeg'
|
2010-05-18 23:09:29 +00:00
|
|
|
|
|
|
|
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-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
|