diff options
| author | Yogesh Girdhar | 2012-02-28 11:48:22 -0500 |
|---|---|---|
| committer | Adam Vandenberg | 2012-03-16 22:06:16 -0700 |
| commit | 383e4dcd366854b12a0d28dc80c30e4ca970b770 (patch) | |
| tree | cafdf9c341b811afe7ceb903f2f14e7e1ddacf7d /Library/Formula | |
| parent | a75d9d51d0262860aeefcc8e932dbf047275f29b (diff) | |
| download | homebrew-383e4dcd366854b12a0d28dc80c30e4ca970b770.tar.bz2 | |
opencv patched to compile with clang
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Diffstat (limited to 'Library/Formula')
| -rw-r--r-- | Library/Formula/opencv.rb | 79 |
1 files changed, 73 insertions, 6 deletions
diff --git a/Library/Formula/opencv.rb b/Library/Formula/opencv.rb index fbe0229cf..888404a40 100644 --- a/Library/Formula/opencv.rb +++ b/Library/Formula/opencv.rb @@ -9,10 +9,9 @@ def site_package_dir end class Opencv < Formula + homepage 'http://opencv.willowgarage.com/wiki/' 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/' - depends_on 'cmake' => :build depends_on 'pkg-config' => :build @@ -20,21 +19,24 @@ class Opencv < Formula depends_on 'libtiff' => :optional depends_on 'jasper' => :optional depends_on 'tbb' => :optional + depends_on 'qt' if ARGV.include? '--with-qt' depends_on 'numpy' => :python + # 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. + # Fix conflict when OpenEXR is installed. See: + # http://tech.groups.yahoo.com/group/OpenCV/message/83201 + # Fix compile on llvm-gcc-4.2. See + # "https://code.ros.org/trac/opencv/ticket/1431" + # "https://code.ros.org/trac/opencv/ticket/1432" def patches - # Fix conflict when OpenEXR is installed. See: - # http://tech.groups.yahoo.com/group/OpenCV/message/83201 DATA end - depends_on 'qt' if ARGV.include? '--with-qt' - def options [ ["--32-bit", "Build 32-bit only."], @@ -102,4 +104,69 @@ index 642000b..b1414f1 100644 +using Imf::PixelType; /* libpng version only */ + + +Fix compile on llvm-gcc-4.2. See + https://code.ros.org/trac/opencv/ticket/1431 + https://code.ros.org/trac/opencv/ticket/1432 + +diff --git a/modules/flann/include/opencv2/flann/any.h b/modules/flann/include/opencv2/flann/any.h +index 46e1116..0a5f468 100644 +--- a/modules/flann/include/opencv2/flann/any.h ++++ b/modules/flann/include/opencv2/flann/any.h +@@ -114,7 +114,7 @@ struct choose_policy<any> + #define SMALL_POLICY(TYPE) \ + template<> \ + struct choose_policy<TYPE> { typedef small_any_policy<TYPE> type; \ +- }; ++ } + + SMALL_POLICY(signed char); + SMALL_POLICY(unsigned char); +diff --git a/modules/flann/include/opencv2/flann/defines.h b/modules/flann/include/opencv2/flann/defines.h +index c71e149..7bd8964 100644 +--- a/modules/flann/include/opencv2/flann/defines.h ++++ b/modules/flann/include/opencv2/flann/defines.h +@@ -120,7 +120,7 @@ enum flann_log_level_t + FLANN_LOG_FATAL = 1, + FLANN_LOG_ERROR = 2, + FLANN_LOG_WARN = 3, +- FLANN_LOG_INFO = 4, ++ FLANN_LOG_INFO = 4 + }; + + enum flann_distance_t + + +diff --git a/modules/flann/include/opencv2/flann/any.h b/modules/flann/include/opencv2/flann/any.h +index 0a5f468..9f9a4dd 100644 +--- a/modules/flann/include/opencv2/flann/any.h ++++ b/modules/flann/include/opencv2/flann/any.h +@@ -30,6 +30,12 @@ struct empty_any + { + }; + ++inline std::ostream& operator <<(std::ostream& out, const empty_any&) ++{ ++ out<<"[empty_any]"; ++ return out; ++} ++ + struct base_any_policy + { + virtual void static_delete(void** x) = 0; +diff --git a/modules/flann/include/opencv2/flann/lsh_index.h b/modules/flann/include/opencv2/flann/lsh_index.h +index a777990..77f15d5 100644 +--- a/modules/flann/include/opencv2/flann/lsh_index.h ++++ b/modules/flann/include/opencv2/flann/lsh_index.h +@@ -56,6 +56,10 @@ namespace cvflann + struct LshIndexParams : public IndexParams + { ++ LshIndexParams() ++ { ++ } ++ + LshIndexParams(unsigned int table_number, unsigned int key_size, unsigned int multi_probe_level) + { + (* this)["algorithm"] = FLANN_INDEX_LSH; |
