aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYogesh Girdhar2011-09-18 14:00:46 -0400
committerCharlie Sharpsteen2011-09-20 21:07:33 -0700
commitd11a8d251fb163124c48a3c573b78414fafe8874 (patch)
treed8bfaec69e52286fed3aae2c1899bb9e1307e2a4
parent82f85cd97f068b5e39c84d894a580499e02f9a99 (diff)
downloadhomebrew-d11a8d251fb163124c48a3c573b78414fafe8874.tar.bz2
OpenCV: Update to 2.3.1a
Also correct `PYTHONPATH` in caveats. Fixes #5596. Fixes #7121. Fixes #7453. Closes #6692. Closes #7500. Closes #7706. Signed-off-by: Charlie Sharpsteen <source@sharpsteen.net>
-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 */
+