aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Library/Formula/opencv.rb40
1 files changed, 36 insertions, 4 deletions
diff --git a/Library/Formula/opencv.rb b/Library/Formula/opencv.rb
index bd6f0ef7c..6ee9a569a 100644
--- a/Library/Formula/opencv.rb
+++ b/Library/Formula/opencv.rb
@@ -1,10 +1,18 @@
require 'formula'
+def which_python
+ "python" + `python -c 'import sys;print(sys.version[:3])'`.strip
+end
+
+def site_package_dir
+ "lib/#{which_python}/site-packages"
+end
+
class Opencv < Formula
- url 'http://downloads.sourceforge.net/project/opencvlibrary/opencv-unix/2.2/OpenCV-2.2.0.tar.bz2'
- version "2.2"
+ url 'http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.3.1/OpenCV-2.3.1a.tar.bz2'
+ md5 '82e4b6bfa349777233eea09b075e931e'
homepage 'http://opencv.willowgarage.com/wiki/'
- md5 '122c9ac793a46854ef2819fedbbd6b1b'
+
depends_on 'cmake' => :build
depends_on 'pkg-config' => :build
@@ -17,6 +25,12 @@ class Opencv < Formula
# you don't need unless you're doing video analysis, and some of it isn't
# in Homebrew anyway.
+ def patches
+ # Fix conflict when OpenEXR is installed. See:
+ # http://tech.groups.yahoo.com/group/OpenCV/message/83201
+ DATA
+ end
+
def options
[['--build32', 'Force a 32-bit build.']]
end
@@ -31,9 +45,27 @@ class Opencv < Formula
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"
+ export PYTHONPATH="#{HOMEBREW_PREFIX}/#{site_package_dir}:$PYTHONPATH"
To make this permanent, put it in your shell's profile (e.g. ~/.profile).
EOS
end
end
+
+__END__
+
+Fix conflict when OpenEXR is installed. See:
+ http://tech.groups.yahoo.com/group/OpenCV/message/83201
+
+diff --git a/modules/highgui/src/grfmt_exr.hpp b/modules/highgui/src/grfmt_exr.hpp
+index 642000b..b1414f1 100644
+--- a/modules/highgui/src/grfmt_exr.hpp
++++ b/modules/highgui/src/grfmt_exr.hpp
+@@ -56,6 +56,7 @@ namespace cv
+
+ using namespace Imf;
+ using namespace Imath;
++using Imf::PixelType;
+
+ /* libpng version only */
+