Gentoo Archives: gentoo-commits

From: Tomas Chvatal <scarabeus@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/kde:master commit in: media-libs/opencv/files/, media-libs/opencv/
Date: Fri, 29 Apr 2011 21:43:40
Message-Id: b2894ad404a8e4d1a2f9a077e233e921280b3a82.scarabeus@gentoo
1 commit: b2894ad404a8e4d1a2f9a077e233e921280b3a82
2 Author: Tomas Chvatal <scarabeus <AT> gentoo <DOT> org>
3 AuthorDate: Fri Apr 29 20:58:00 2011 +0000
4 Commit: Tomas Chvatal <scarabeus <AT> gentoo <DOT> org>
5 CommitDate: Fri Apr 29 20:58:00 2011 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/kde.git;a=commit;h=b2894ad4
7
8 [media-libs/opencv] Build with libpng1.5 enhance the system libs patch more.
9
10 ---
11 media-libs/opencv/files/2.2.0-libpng1.5.patch | 39 ++++++++++++++++++++
12 .../opencv/files/2.2.0-use_system_libs.patch | 34 +++++++++++++++++
13 media-libs/opencv/opencv-2.2.0.ebuild | 5 ++-
14 3 files changed, 76 insertions(+), 2 deletions(-)
15
16 diff --git a/media-libs/opencv/files/2.2.0-libpng1.5.patch b/media-libs/opencv/files/2.2.0-libpng1.5.patch
17 new file mode 100644
18 index 0000000..1a99998
19 --- /dev/null
20 +++ b/media-libs/opencv/files/2.2.0-libpng1.5.patch
21 @@ -0,0 +1,39 @@
22 +Index: /trunk/opencv/modules/highgui/src/grfmt_png.cpp
23 +===================================================================
24 +--- /trunk/opencv/modules/highgui/src/grfmt_png.cpp (revision 4337)
25 ++++ /trunk/opencv/modules/highgui/src/grfmt_png.cpp (revision 4945)
26 +@@ -108,5 +108,5 @@
27 + {
28 + png_structp png_ptr = (png_structp)_png_ptr;
29 +- PngDecoder* decoder = (PngDecoder*)(png_ptr->io_ptr);
30 ++ PngDecoder* decoder = (PngDecoder*)(png_get_io_ptr(png_ptr));
31 + CV_Assert( decoder );
32 + const Mat& buf = decoder->m_buf;
33 +@@ -139,5 +139,5 @@
34 + if( info_ptr && end_info )
35 + {
36 +- if( setjmp( png_ptr->jmpbuf ) == 0 )
37 ++ if( setjmp( png_jmpbuf( png_ptr ) ) == 0 )
38 + {
39 + if( !m_buf.empty() )
40 +@@ -201,5 +201,5 @@
41 + png_infop end_info = (png_infop)m_end_info;
42 +
43 +- if( setjmp(png_ptr->jmpbuf) == 0 )
44 ++ if( setjmp( png_jmpbuf ( png_ptr ) ) == 0 )
45 + {
46 + int y;
47 +@@ -285,5 +285,5 @@
48 + return;
49 + png_structp png_ptr = (png_structp)_png_ptr;
50 +- PngEncoder* encoder = (PngEncoder*)(png_ptr->io_ptr);
51 ++ PngEncoder* encoder = (PngEncoder*)(png_get_io_ptr(png_ptr));
52 + CV_Assert( encoder && encoder->m_buf );
53 + size_t cursz = encoder->m_buf->size();
54 +@@ -327,5 +327,5 @@
55 + if( info_ptr )
56 + {
57 +- if( setjmp( png_ptr->jmpbuf ) == 0 )
58 ++ if( setjmp( png_jmpbuf ( png_ptr ) ) == 0 )
59 + {
60 + if( m_buf )
61
62 diff --git a/media-libs/opencv/files/2.2.0-use_system_libs.patch b/media-libs/opencv/files/2.2.0-use_system_libs.patch
63 index 3a0fdde..3a9c10c 100644
64 --- a/media-libs/opencv/files/2.2.0-use_system_libs.patch
65 +++ b/media-libs/opencv/files/2.2.0-use_system_libs.patch
66 @@ -32,3 +32,37 @@ diff -urN OpenCV-2.2.0.old/modules/core/src/lapack.cpp OpenCV-2.2.0/modules/core
67 #endif
68
69 #undef abs
70 +diff -urN OpenCV-2.2.0.old/modules/highgui/CMakeLists.txt OpenCV-2.2.0/modules/highgui/CMakeLists.txt
71 +--- OpenCV-2.2.0.old/modules/highgui/CMakeLists.txt 2010-12-05 04:35:24.000000000 +0100
72 ++++ OpenCV-2.2.0/modules/highgui/CMakeLists.txt 2011-04-29 22:24:32.000000000 +0200
73 +@@ -219,8 +219,8 @@
74 + set(the_target "opencv_highgui")
75 +
76 + add_definitions(-DHIGHGUI_EXPORTS -DCVAPI_EXPORTS)
77 +-
78 +-include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include"
79 ++include_directories("${ZLIB_INCLUDE_DIRS}"
80 ++ "${CMAKE_CURRENT_SOURCE_DIR}/include"
81 + "${CMAKE_CURRENT_SOURCE_DIR}/../core/include"
82 + "${CMAKE_CURRENT_SOURCE_DIR}/../imgproc/include"
83 + "${CMAKE_CURRENT_SOURCE_DIR}/src"
84 +@@ -285,7 +285,7 @@
85 + #target_link_libraries(${the_target} libtiff)
86 + endif()
87 +
88 +-target_link_libraries(${the_target} ${OPENCV_LINKER_LIBS} opencv_core opencv_imgproc zlib ${JPEG_LIBRARIES} ${PNG_LIBRARIES} ${TIFF_LIBRARIES} ${JASPER_LIBRARIES} ${HIGHGUI_LIBRARIES} ${OPENEXR_LIBRARIES})
89 ++target_link_libraries(${the_target} ${OPENCV_LINKER_LIBS} opencv_core opencv_imgproc ${ZLIB_LIBRARIES} ${JPEG_LIBRARIES} ${PNG_LIBRARIES} ${TIFF_LIBRARIES} ${JASPER_LIBRARIES} ${HIGHGUI_LIBRARIES} ${OPENEXR_LIBRARIES})
90 +
91 + if(APPLE)
92 + target_link_libraries(${the_target} "-lbz2 -framework Cocoa -framework QuartzCore")
93 +diff -urN OpenCV-2.2.0.old/modules/highgui/src/grfmt_png.cpp OpenCV-2.2.0/modules/highgui/src/grfmt_png.cpp
94 +--- OpenCV-2.2.0.old/modules/highgui/src/grfmt_png.cpp 2010-12-05 04:35:25.000000000 +0100
95 ++++ OpenCV-2.2.0/modules/highgui/src/grfmt_png.cpp 2011-04-29 22:25:25.000000000 +0200
96 +@@ -42,6 +42,7 @@
97 +
98 + #include "precomp.hpp"
99 +
100 ++#include <zlib.h>
101 + #ifdef HAVE_PNG
102 +
103 + /****************************************************************************************\
104
105 diff --git a/media-libs/opencv/opencv-2.2.0.ebuild b/media-libs/opencv/opencv-2.2.0.ebuild
106 index 84875a0..0a30fdb 100644
107 --- a/media-libs/opencv/opencv-2.2.0.ebuild
108 +++ b/media-libs/opencv/opencv-2.2.0.ebuild
109 @@ -21,9 +21,10 @@ IUSE="cuda doc eigen examples ffmpeg gstreamer gtk ieee1394 ipp jpeg jpeg2k open
110
111 RDEPEND="
112 app-arch/bzip2
113 + dev-libs/libf2c
114 sys-libs/zlib
115 sci-libs/clapack
116 - virtual/lapack
117 + sci-libs/flann
118 cuda? ( dev-util/nvidia-cuda-toolkit )
119 eigen? ( dev-cpp/eigen:2 )
120 ffmpeg? ( virtual/ffmpeg )
121 @@ -63,6 +64,7 @@ PATCHES=(
122 "${FILESDIR}/${PV}-ptrcvcapture.patch"
123 "${FILESDIR}/${PV}-v4l_2.6.38.patch"
124 "${FILESDIR}/${PV}-use_system_libs.patch"
125 + "${FILESDIR}/${PV}-libpng1.5.patch"
126 )
127
128 S=${WORKDIR}/${MY_P}
129 @@ -142,7 +144,6 @@ src_configure() {
130 mycmakeargs+=(
131 "-DBUILD_SHARED_LIBS=ON"
132 "-DOPENCV_DOC_INSTALL_PATH=share/doc/${PF}"
133 - "-DOPENCV_EXTRA_C_FLAGS=${CXXFLAGS}"
134 )
135
136 cmake-utils_src_configure