Accepting request 79592 from KDE:Distro:Factory

- Dropped opencv-2.3-ffmpeg.patch, applied upstream
 (forwarded request 79589 from koprok)

OBS-URL: https://build.opensuse.org/request/show/79592
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/opencv?expand=0&rev=23
This commit is contained in:
Sascha Peilicke 2011-08-24 12:04:40 +00:00 committed by Git OBS Bridge
parent d5f10eed26
commit ca20cb32d4
11 changed files with 169 additions and 448 deletions

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:bcbfff0ff767f0cf2523707a307a5fd0db4853c19c3498f322c8c5839429940b
size 42849210

3
OpenCV-2.3.1.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:30e7f3e7b07fb5bd1605c934101e9f2487c3e2fcc97478e529756575024ee2b8
size 32588659

View File

@ -1,23 +0,0 @@
diff -urN OpenCV-2.3.0-orig/CMakeLists.txt OpenCV-2.3.0/CMakeLists.txt
--- OpenCV-2.3.0-orig/CMakeLists.txt 2011-07-04 07:21:50.000000000 +0300
+++ OpenCV-2.3.0/CMakeLists.txt 2011-08-14 03:02:57.072585001 +0300
@@ -845,8 +845,8 @@
message(STATUS "CUDA NVCC target flags: ${CUDA_NVCC_FLAGS}")
else()
- unset(CUDA_ARCH_BIN CACHE)
- unset(CUDA_ARCH_PTX CACHE)
+ set(CUDA_ARCH_BIN)
+ set(CUDA_ARCH_PTX)
endif()
endif()
@@ -1422,7 +1422,7 @@
# Solution folders:
#-----------------------------------
-if(${CMAKE_VERSION} VERSION_GREATER "2.8.0")
+if(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.8)
set(ENABLE_SOLUTION_FOLDERS OFF CACHE BOOL "Solution folder in Visual Studio or in other IDEs")
endif()

View File

@ -1,249 +0,0 @@
Index: modules/highgui/include/opencv2/highgui/highgui_c.h
===================================================================
--- modules/highgui/include/opencv2/highgui/highgui_c.h.orig
+++ modules/highgui/include/opencv2/highgui/highgui_c.h
@@ -367,8 +367,10 @@ enum
CV_CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION_ON = CV_CAP_OPENNI_DEPTH_GENERATOR + CV_CAP_PROP_OPENNI_REGISTRATION_ON,
// Properties of cameras available through GStreamer interface
- CV_CAP_GSTREAMER_QUEUE_LENGTH = 200, // default is 1
- CV_CAP_PROP_PVAPI_MULTICASTIP = 300 // ip for anable multicast master mode. 0 for disable multicast
+ CV_CAP_GSTREAMER_QUEUE_LENGTH = 200, // default is 1
+ CV_CAP_PROP_PVAPI_MULTICASTIP = 300, // ip for anable multicast master mode. 0 for disable multicast
+
+ CV_CAP_PROP_THREADS = 400
};
enum
Index: modules/highgui/src/cap_ffmpeg_api.hpp
===================================================================
--- modules/highgui/src/cap_ffmpeg_api.hpp.orig
+++ modules/highgui/src/cap_ffmpeg_api.hpp
@@ -21,7 +21,8 @@ enum
CV_FFMPEG_CAP_PROP_FRAME_HEIGHT=4,
CV_FFMPEG_CAP_PROP_FPS=5,
CV_FFMPEG_CAP_PROP_FOURCC=6,
- CV_FFMPEG_CAP_PROP_FRAME_COUNT=7
+ CV_FFMPEG_CAP_PROP_FRAME_COUNT=7,
+ CV_FFMPEG_CAP_PROP_THREADS=8
};
Index: modules/highgui/src/cap_ffmpeg_impl.hpp
===================================================================
--- modules/highgui/src/cap_ffmpeg_impl.hpp.orig
+++ modules/highgui/src/cap_ffmpeg_impl.hpp
@@ -135,7 +135,7 @@ extern "C" {
#define PIX_FMT_RGBA32 PIX_FMT_RGB32
#endif
-
+#define CALC_FFMPEG_VERSION(a,b,c) ( a<<16 | b<<8 | c )
char * FOURCC2str( int fourcc )
{
@@ -365,6 +365,7 @@ struct CvCapture_FFMPEG
and so the filename is needed to reopen the file on backward seeking.
*/
char * filename;
+ int count_threads;
};
@@ -379,6 +380,7 @@ void CvCapture_FFMPEG::init()
memset( &frame, 0, sizeof(frame) );
filename = 0;
packet.data = NULL;
+ count_threads = 1;
#if defined(HAVE_FFMPEG_SWSCALE)
img_convert_ctx = 0;
#endif
@@ -444,6 +446,9 @@ bool CvCapture_FFMPEG::reopen()
#else
AVCodecContext *enc = &ic->streams[video_stream]->codec;
#endif
+
+ avcodec_thread_init(enc, count_threads);
+
AVCodec *codec = avcodec_find_decoder(enc->codec_id);
avcodec_open(enc, codec);
video_st = ic->streams[video_stream];
@@ -489,7 +494,13 @@ bool CvCapture_FFMPEG::open( const char*
AVCodecContext *enc = &ic->streams[i]->codec;
#endif
- if( CODEC_TYPE_VIDEO == enc->codec_type && video_stream < 0) {
+ avcodec_thread_init(enc, count_threads);
+
+ #if LIBAVFORMAT_BUILD < CALC_FFMPEG_VERSION(53, 4, 0)
+ #define AVMEDIA_TYPE_VIDEO CODEC_TYPE_VIDEO
+ #endif
+
+ if( AVMEDIA_TYPE_VIDEO == enc->codec_type && video_stream < 0) {
AVCodec *codec = avcodec_find_decoder(enc->codec_id);
if (!codec ||
avcodec_open(enc, codec) < 0)
@@ -576,14 +587,18 @@ bool CvCapture_FFMPEG::grabFrame()
continue;
}
-#if LIBAVFORMAT_BUILD > 4628
- avcodec_decode_video(video_st->codec,
- picture, &got_picture,
- packet.data, packet.size);
-#else
- avcodec_decode_video(&video_st->codec,
- picture, &got_picture,
- packet.data, packet.size);
+#if LIBAVFORMAT_BUILD >= CALC_FFMPEG_VERSION(53, 4, 0)
+ avcodec_decode_video2(video_st->codec, picture, &got_picture, &packet);
+#else
+ #if LIBAVFORMAT_BUILD > 4628
+ avcodec_decode_video(video_st->codec,
+ picture, &got_picture,
+ packet.data, packet.size);
+ #else
+ avcodec_decode_video(&video_st->codec,
+ picture, &got_picture,
+ packet.data, packet.size);
+ #endif
#endif
if (got_picture) {
@@ -702,12 +717,14 @@ double CvCapture_FFMPEG::getProperty( in
return (double)video_st->codec.codec_tag;
#endif
break;
+ case CV_CAP_PROP_THREADS:
+ return count_threads;
+ break;
}
+
return 0;
}
-
-
// this is a VERY slow fallback function, ONLY used if ffmpeg's av_seek_frame delivers no correct result!
bool CvCapture_FFMPEG::slowSeek( int framenumber )
{
@@ -787,6 +804,12 @@ bool CvCapture_FFMPEG::setProperty( int
picture_pts=(int64_t)value;
}
break;
+
+ case CV_CAP_PROP_THREADS:
+ {
+ count_threads = (int)value;
+ }
+ break;
default:
return false;
@@ -824,6 +847,38 @@ struct CvVideoWriter_FFMPEG
static const char * icvFFMPEGErrStr(int err)
{
+#if LIBAVFORMAT_BUILD >= CALC_FFMPEG_VERSION(53, 4, 0)
+ switch(err) {
+ case AVERROR_BSF_NOT_FOUND:
+ return "Bitstream filter not found";
+ case AVERROR_DECODER_NOT_FOUND:
+ return "Decoder not found";
+ case AVERROR_DEMUXER_NOT_FOUND:
+ return "Demuxer not found";
+ case AVERROR_ENCODER_NOT_FOUND:
+ return "Encoder not found";
+ case AVERROR_EOF:
+ return "End of file";
+ case AVERROR_EXIT:
+ return "Immediate exit was requested; the called function should not be restarted";
+ case AVERROR_FILTER_NOT_FOUND:
+ return "Filter not found";
+ case AVERROR_INVALIDDATA:
+ return "Invalid data found when processing input";
+ case AVERROR_MUXER_NOT_FOUND:
+ return "Muxer not found";
+ case AVERROR_OPTION_NOT_FOUND:
+ return "Option not found";
+ case AVERROR_PATCHWELCOME:
+ return "Not yet implemented in FFmpeg, patches welcome";
+ case AVERROR_PROTOCOL_NOT_FOUND:
+ return "Protocol not found";
+ case AVERROR_STREAM_NOT_FOUND:
+ return "Stream not found";
+ default:
+ break;
+ }
+#else
switch(err) {
case AVERROR_NUMEXPECTED:
return "Incorrect filename syntax";
@@ -838,7 +893,9 @@ static const char * icvFFMPEGErrStr(int
default:
break;
}
- return "Unspecified error";
+#endif
+
+ return "Unspecified error";
}
/* function internal to FFMPEG (libavformat/riff.c) to lookup codec id by fourcc tag*/
@@ -918,7 +975,7 @@ static AVStream *icv_add_video_stream_FF
#endif
#if LIBAVFORMAT_BUILD > 4621
- c->codec_id = av_guess_codec(oc->oformat, NULL, oc->filename, NULL, CODEC_TYPE_VIDEO);
+ c->codec_id = av_guess_codec(oc->oformat, NULL, oc->filename, NULL, AVMEDIA_TYPE_VIDEO);
#else
c->codec_id = oc->oformat->video_codec;
#endif
@@ -930,7 +987,7 @@ static AVStream *icv_add_video_stream_FF
//if(codec_tag) c->codec_tag=codec_tag;
codec = avcodec_find_encoder(c->codec_id);
- c->codec_type = CODEC_TYPE_VIDEO;
+ c->codec_type = AVMEDIA_TYPE_VIDEO;
/* put sample parameters */
c->bit_rate = bitrate;
@@ -1015,7 +1072,11 @@ int icv_av_write_frame_FFMPEG( AVFormatC
AVPacket pkt;
av_init_packet(&pkt);
- pkt.flags |= PKT_FLAG_KEY;
+ #ifndef PKT_FLAG_KEY
+ #define PKT_FLAG_KEY AV_PKT_FLAG_KEY
+ #endif
+
+ pkt.flags |= PKT_FLAG_KEY;
pkt.stream_index= video_st->index;
pkt.data= (uint8_t *)picture;
pkt.size= sizeof(AVPicture);
@@ -1237,7 +1298,13 @@ bool CvVideoWriter_FFMPEG::open( const c
av_register_all ();
/* auto detect the output format from the name and fourcc code. */
+
+#if LIBAVFORMAT_BUILD >= CALC_FFMPEG_VERSION(53, 4, 0)
+ fmt = av_guess_format(NULL, filename, NULL);
+#else
fmt = guess_format(NULL, filename, NULL);
+#endif
+
if (!fmt)
return false;
@@ -1260,7 +1327,11 @@ bool CvVideoWriter_FFMPEG::open( const c
#endif
// alloc memory for context
+#if LIBAVFORMAT_BUILD >= CALC_FFMPEG_VERSION(53, 4, 0)
+ oc = avformat_alloc_context();
+#else
oc = av_alloc_format_context();
+#endif
assert (oc);
/* set file name */

View File

@ -1,93 +0,0 @@
diff -urN OpenCV-2.3.0-orig/CMakeLists.txt OpenCV-2.3.0/CMakeLists.txt
--- OpenCV-2.3.0-orig/CMakeLists.txt 2011-07-04 07:21:50.000000000 +0300
+++ OpenCV-2.3.0/CMakeLists.txt 2011-08-12 17:50:13.803976563 +0300
@@ -619,11 +619,11 @@
string(REGEX MATCH "[0-9].[0-9]" PYTHON_VERSION_MAJOR_MINOR "${PYTHON_VERSION_FULL}")
if(UNIX)
- set(PYTHON_PLUGIN_INSTALL_PATH lib/python${PYTHON_VERSION_MAJOR_MINOR}/site-packages/opencv)
+ set(PYTHON_PLUGIN_INSTALL_PATH lib${LIB_SUFFIX}/python${PYTHON_VERSION_MAJOR_MINOR}/site-packages/opencv)
if(APPLE)
- set(PYTHON_PACKAGES_PATH lib/python${PYTHON_VERSION_MAJOR_MINOR}/site-packages CACHE PATH "Where to install the python packages.")
- else() #debian based assumed, install to the dist-packages.
- set(PYTHON_PACKAGES_PATH lib/python${PYTHON_VERSION_MAJOR_MINOR}/dist-packages CACHE PATH "Where to install the python packages.")
+ set(PYTHON_PACKAGES_PATH lib%{LIB_SUFFIX}/python${PYTHON_VERSION_MAJOR_MINOR}/site-packages CACHE PATH "Where to install the python packages.")
+ else()
+ set(PYTHON_PACKAGES_PATH lib${LIB_SUFFIX}/python${PYTHON_VERSION_MAJOR_MINOR}/site-packages CACHE PATH "Where to install the python packages.")
endif()
endif()
if(WIN32)
@@ -1191,7 +1191,7 @@
# PROCESS SUBDIRECTORIES:
# ----------------------------------------------------------------------------
# Save libs and executables in the same place
-set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib CACHE PATH "Output directory for libraries" )
+set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib${LIB_SUFFIX} CACHE PATH "Output directory for libraries" )
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin CACHE PATH "Output directory for applications" )
if(WIN32)
@@ -1322,19 +1322,19 @@
# Part 2/2: ${BIN_DIR}/unix-install/opencv.pc -> For use *with* "make install"
# prefix=/usr
# exec_prefix=${prefix}
-# libdir=${exec_prefix}/lib
+# libdir=${exec_prefix}/lib${LIB_SUFFIX}
# includedir=${prefix}/include/opencv
# -------------------------------------------------------------------------------------------
set(prefix ${CMAKE_INSTALL_PREFIX})
set(exec_prefix "\${prefix}")
-set(libdir "\${exec_prefix}/lib")
+set(libdir "\${exec_prefix}/lib${LIB_SUFFIX}")
set(includedir "\${prefix}/include")
set(VERSION ${OPENCV_VERSION})
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/opencv.pc.cmake.in" "${CMAKE_BINARY_DIR}/unix-install/opencv.pc" @ONLY IMMEDIATE)
if(UNIX)
- install(FILES ${CMAKE_BINARY_DIR}/unix-install/opencv.pc DESTINATION lib/pkgconfig)
+ install(FILES ${CMAKE_BINARY_DIR}/unix-install/opencv.pc DESTINATION lib${LIB_SUFFIX}/pkgconfig)
endif()
diff -urN OpenCV-2.3.0-orig/modules/gpu/CMakeLists.txt OpenCV-2.3.0/modules/gpu/CMakeLists.txt
--- OpenCV-2.3.0-orig/modules/gpu/CMakeLists.txt 2011-07-04 07:21:58.000000000 +0300
+++ OpenCV-2.3.0/modules/gpu/CMakeLists.txt 2011-08-12 17:49:54.058784260 +0300
@@ -149,8 +149,8 @@
install(TARGETS ${the_target}
RUNTIME DESTINATION bin COMPONENT main
- LIBRARY DESTINATION lib COMPONENT main
- ARCHIVE DESTINATION lib COMPONENT main)
+ LIBRARY DESTINATION lib${LIB_SUFFIX} COMPONENT main
+ ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT main)
install(FILES ${lib_hdrs}
DESTINATION include/opencv2/${name}
diff -urN OpenCV-2.3.0-orig/modules/highgui/CMakeLists.txt OpenCV-2.3.0/modules/highgui/CMakeLists.txt
--- OpenCV-2.3.0-orig/modules/highgui/CMakeLists.txt 2011-07-04 07:21:58.000000000 +0300
+++ OpenCV-2.3.0/modules/highgui/CMakeLists.txt 2011-08-12 17:49:54.058784260 +0300
@@ -362,8 +362,8 @@
install(TARGETS ${the_target}
RUNTIME DESTINATION bin COMPONENT main
- LIBRARY DESTINATION lib COMPONENT main
- ARCHIVE DESTINATION lib COMPONENT main)
+ LIBRARY DESTINATION lib${LIB_SUFFIX} COMPONENT main
+ ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT main)
install(FILES ${highgui_ext_hdrs}
DESTINATION include/opencv2/highgui
diff -urN OpenCV-2.3.0-orig/OpenCVModule.cmake OpenCV-2.3.0/OpenCVModule.cmake
--- OpenCV-2.3.0-orig/OpenCVModule.cmake 2011-07-04 07:21:59.000000000 +0300
+++ OpenCV-2.3.0/OpenCVModule.cmake 2011-08-12 17:49:54.058784260 +0300
@@ -97,8 +97,8 @@
install(TARGETS ${the_target}
RUNTIME DESTINATION bin COMPONENT main
- LIBRARY DESTINATION lib COMPONENT main
- ARCHIVE DESTINATION lib COMPONENT main)
+ LIBRARY DESTINATION lib${LIB_SUFFIX} COMPONENT main
+ ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT main)
install(FILES ${lib_hdrs}
DESTINATION include/opencv2/${name}

View File

@ -1,63 +0,0 @@
diff -urN OpenCV-2.3.0-orig/CMakeLists.txt OpenCV-2.3.0/CMakeLists.txt
--- OpenCV-2.3.0-orig/CMakeLists.txt 2011-07-04 07:21:50.000000000 +0300
+++ OpenCV-2.3.0/CMakeLists.txt 2011-08-12 18:02:28.672630556 +0300
@@ -1439,7 +1439,7 @@
add_subdirectory(doc)
add_subdirectory(data)
-if(BUILD_EXAMPLES OR INSTALL_PYTHON_EXAMPLES)
+if(BUILD_EXAMPLES OR INSTALL_C_EXAMPLES OR INSTALL_PYTHON_EXAMPLES)
add_subdirectory(samples)
endif()
diff -urN OpenCV-2.3.0-orig/samples/CMakeLists.txt OpenCV-2.3.0/samples/CMakeLists.txt
--- OpenCV-2.3.0-orig/samples/CMakeLists.txt 2011-07-04 07:22:00.000000000 +0300
+++ OpenCV-2.3.0/samples/CMakeLists.txt 2011-08-12 18:03:13.638254532 +0300
@@ -3,9 +3,15 @@
#
# ----------------------------------------------------------------------------
+if(BUILD_EXAMPLES OR INSTALL_C_EXAMPLES)
add_subdirectory(c)
add_subdirectory(cpp)
add_subdirectory(gpu)
+endif()
+if(INSTALL_PYTHON_EXAMPLES AND BUILD_NEW_PYTHON_SUPPORT)
+add_subdirectory(python)
+add_subdirectory(python2)
+endif()
if(0)
add_subdirectory(swig_python)
diff -urN OpenCV-2.3.0-orig/samples/python/CMakeLists.txt OpenCV-2.3.0/samples/python/CMakeLists.txt
--- OpenCV-2.3.0-orig/samples/python/CMakeLists.txt 1970-01-01 02:00:00.000000000 +0200
+++ OpenCV-2.3.0/samples/python/CMakeLists.txt 2011-08-12 18:02:28.672630556 +0300
@@ -0,0 +1,12 @@
+# -------------------------------------------------------------------------
+# CMake file for Python samples. See root CMakeLists.txt
+# -------------------------------------------------------------------------
+
+file(GLOB PYTHON_SAMPLES *.py)
+if(NOT WIN32)
+install(FILES ${PYTHON_SAMPLES}
+ DESTINATION share/opencv/samples/python
+ PERMISSIONS OWNER_READ OWNER_EXECUTE
+ GROUP_READ GROUP_EXECUTE
+ WORLD_READ WORLD_EXECUTE)
+endif()
diff -urN OpenCV-2.3.0-orig/samples/python2/CMakeLists.txt OpenCV-2.3.0/samples/python2/CMakeLists.txt
--- OpenCV-2.3.0-orig/samples/python2/CMakeLists.txt 1970-01-01 02:00:00.000000000 +0200
+++ OpenCV-2.3.0/samples/python2/CMakeLists.txt 2011-08-12 18:03:54.701431832 +0300
@@ -0,0 +1,12 @@
+# -------------------------------------------------------------------------
+# CMake file for Python samples. See root CMakeLists.txt
+# -------------------------------------------------------------------------
+
+file(GLOB PYTHON_SAMPLES *.py)
+if(NOT WIN32)
+install(FILES ${PYTHON_SAMPLES}
+ DESTINATION share/opencv/samples/python2
+ PERMISSIONS OWNER_READ OWNER_EXECUTE
+ GROUP_READ GROUP_EXECUTE
+ WORLD_READ WORLD_EXECUTE)
+endif()

35
opencv-datadir.patch Normal file
View File

@ -0,0 +1,35 @@
diff -urN OpenCV-2.3.1-orig/CMakeLists.txt OpenCV-2.3.1/CMakeLists.txt
--- OpenCV-2.3.1-orig/CMakeLists.txt 2011-08-17 22:42:55.000000000 +0300
+++ OpenCV-2.3.1/CMakeLists.txt 2011-08-19 15:14:51.227242178 +0300
@@ -125,7 +125,7 @@
elseif(OPENCV_MANGLED_INSTALL_PATHS)
set(OPENCV_DOC_INSTALL_PATH share/OpenCV-${OPENCV_VERSION}/doc)
else()
- set(OPENCV_DOC_INSTALL_PATH share/OpenCV/doc)
+ set(OPENCV_DOC_INSTALL_PATH share/opencv/doc)
endif()
if(ANDROID)
@@ -1370,8 +1370,8 @@
install(FILES ${CMAKE_BINARY_DIR}/unix-install/OpenCVConfig.cmake DESTINATION share/OpenCV-${OPENCV_VERSION}/)
install(FILES ${CMAKE_BINARY_DIR}/unix-install/OpenCVConfig-version.cmake DESTINATION share/OpenCV-${OPENCV_VERSION}/)
else()
- install(FILES "${CMAKE_BINARY_DIR}/unix-install/OpenCVConfig.cmake" DESTINATION share/OpenCV/)
- install(FILES ${CMAKE_BINARY_DIR}/unix-install/OpenCVConfig-version.cmake DESTINATION share/OpenCV/)
+ install(FILES "${CMAKE_BINARY_DIR}/unix-install/OpenCVConfig.cmake" DESTINATION share/opencv/)
+ install(FILES ${CMAKE_BINARY_DIR}/unix-install/OpenCVConfig-version.cmake DESTINATION share/opencv/)
endif()
endif()
diff -urN OpenCV-2.3.1-orig/data/CMakeLists.txt OpenCV-2.3.1/data/CMakeLists.txt
--- OpenCV-2.3.1-orig/data/CMakeLists.txt 2011-08-02 15:48:41.000000000 +0300
+++ OpenCV-2.3.1/data/CMakeLists.txt 2011-08-19 15:13:34.349553000 +0300
@@ -2,6 +2,6 @@
file(GLOB LBP_CASCADES lbpcascades/*.xml)
if(NOT WIN32)
-install(FILES ${HAAR_CASCADES} DESTINATION share/OpenCV/haarcascades COMPONENT main)
-install(FILES ${LBP_CASCADES} DESTINATION share/OpenCV/lbpcascades COMPONENT main)
+install(FILES ${HAAR_CASCADES} DESTINATION share/opencv/haarcascades COMPONENT main)
+install(FILES ${LBP_CASCADES} DESTINATION share/opencv/lbpcascades COMPONENT main)
endif()

15
opencv-libdir.patch Normal file
View File

@ -0,0 +1,15 @@
diff -urN OpenCV-2.3.1-orig/CMakeLists.txt OpenCV-2.3.1/CMakeLists.txt
--- OpenCV-2.3.1-orig/CMakeLists.txt 2011-08-17 22:42:55.000000000 +0300
+++ OpenCV-2.3.1/CMakeLists.txt 2011-08-19 13:40:08.785540389 +0300
@@ -665,9 +665,9 @@
OUTPUT_VARIABLE PYTHON_STD_PACKAGES_PATH
OUTPUT_STRIP_TRAILING_WHITESPACE)
if("${PYTHON_STD_PACKAGES_PATH}" MATCHES "site-packages")
- set(PYTHON_PACKAGES_PATH lib/python${PYTHON_VERSION_MAJOR_MINOR}/site-packages CACHE PATH "Where to install the python packages.")
+ set(PYTHON_PACKAGES_PATH lib${LIB_SUFFIX}/python${PYTHON_VERSION_MAJOR_MINOR}/site-packages CACHE PATH "Where to install the python packages.")
else() #debian based assumed, install to the dist-packages.
- set(PYTHON_PACKAGES_PATH lib/python${PYTHON_VERSION_MAJOR_MINOR}/dist-packages CACHE PATH "Where to install the python packages.")
+ set(PYTHON_PACKAGES_PATH lib${LIB_SUFFIX}/python${PYTHON_VERSION_MAJOR_MINOR}/dist-packages CACHE PATH "Where to install the python packages.")
endif()
endif()
if(CMAKE_HOST_WIN32)

79
opencv-samples.patch Normal file
View File

@ -0,0 +1,79 @@
diff -urN OpenCV-2.3.1-orig/CMakeLists.txt OpenCV-2.3.1/CMakeLists.txt
--- OpenCV-2.3.1-orig/CMakeLists.txt 2011-08-17 22:42:55.000000000 +0300
+++ OpenCV-2.3.1/CMakeLists.txt 2011-08-19 14:29:28.889802927 +0300
@@ -1539,7 +1539,7 @@
add_subdirectory(data)
add_subdirectory(3rdparty)
-if(BUILD_EXAMPLES OR BUILD_ANDROID_EXAMPLES OR INSTALL_PYTHON_EXAMPLES)
+if(BUILD_EXAMPLES OR INSTALL_C_EXAMPLES OR BUILD_ANDROID_EXAMPLES OR INSTALL_PYTHON_EXAMPLES)
add_subdirectory(samples)
endif()
diff -urN OpenCV-2.3.1-orig/samples/CMakeLists.txt OpenCV-2.3.1/samples/CMakeLists.txt
--- OpenCV-2.3.1-orig/samples/CMakeLists.txt 2011-08-02 15:48:16.000000000 +0300
+++ OpenCV-2.3.1/samples/CMakeLists.txt 2011-08-19 14:29:28.890802914 +0300
@@ -3,12 +3,19 @@
#
# ----------------------------------------------------------------------------
+if(BUILD_EXAMPLES OR INSTALL_C_EXAMPLES)
add_subdirectory(c)
add_subdirectory(cpp)
if(NOT ANDROID)
add_subdirectory(gpu)
endif()
+endif()
+
+if(INSTALL_PYTHON_EXAMPLES AND BUILD_NEW_PYTHON_SUPPORT)
+add_subdirectory(python)
+add_subdirectory(python2)
+endif()
if(BUILD_ANDROID_EXAMPLES)
add_subdirectory(android)
diff -urN OpenCV-2.3.1-orig/samples/gpu/CMakeLists.txt OpenCV-2.3.1/samples/gpu/CMakeLists.txt
--- OpenCV-2.3.1-orig/samples/gpu/CMakeLists.txt 2011-08-12 00:17:05.000000000 +0300
+++ OpenCV-2.3.1/samples/gpu/CMakeLists.txt 2011-08-19 14:39:59.379420799 +0300
@@ -71,7 +71,7 @@
if (NOT WIN32)
file(GLOB install_list *.c *.cpp *.jpg *.png *.data makefile.* build_all.sh *.dsp *.cmd )
install(FILES ${install_list}
- DESTINATION share/opencv/samples/${project}
+ DESTINATION share/opencv/samples/gpu
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ)
endif ()
diff -urN OpenCV-2.3.1-orig/samples/python/CMakeLists.txt OpenCV-2.3.1/samples/python/CMakeLists.txt
--- OpenCV-2.3.1-orig/samples/python/CMakeLists.txt 1970-01-01 02:00:00.000000000 +0200
+++ OpenCV-2.3.1/samples/python/CMakeLists.txt 2011-08-19 14:40:20.072343997 +0300
@@ -0,0 +1,12 @@
+# -------------------------------------------------------------------------
+# CMake file for Python samples. See root CMakeLists.txt
+# -------------------------------------------------------------------------
+
+file(GLOB PYTHON_SAMPLES *.py)
+if(NOT WIN32)
+install(FILES ${PYTHON_SAMPLES}
+ DESTINATION share/opencv/samples/python
+ PERMISSIONS OWNER_READ OWNER_EXECUTE
+ GROUP_READ GROUP_EXECUTE
+ WORLD_READ WORLD_EXECUTE)
+endif()
diff -urN OpenCV-2.3.1-orig/samples/python2/CMakeLists.txt OpenCV-2.3.1/samples/python2/CMakeLists.txt
--- OpenCV-2.3.1-orig/samples/python2/CMakeLists.txt 1970-01-01 02:00:00.000000000 +0200
+++ OpenCV-2.3.1/samples/python2/CMakeLists.txt 2011-08-19 14:40:31.182302811 +0300
@@ -0,0 +1,12 @@
+# -------------------------------------------------------------------------
+# CMake file for Python samples. See root CMakeLists.txt
+# -------------------------------------------------------------------------
+
+file(GLOB PYTHON_SAMPLES *.py)
+if(NOT WIN32)
+install(FILES ${PYTHON_SAMPLES}
+ DESTINATION share/opencv/samples/python2
+ PERMISSIONS OWNER_READ OWNER_EXECUTE
+ GROUP_READ GROUP_EXECUTE
+ WORLD_READ WORLD_EXECUTE)
+endif()

View File

@ -1,3 +1,25 @@
-------------------------------------------------------------------
Tue Aug 23 17:46:53 EEST 2011 - koprok@nand.bg
- Dropped opencv-2.3-ffmpeg.patch, applied upstream
-------------------------------------------------------------------
Tue Aug 23 16:31:53 EEST 2011 - koprok@nand.bg
- Revive opencv-2.3-ffmpeg.patch, needs rebase
- Tag all patches according to openSUSE packaging guidelines
-------------------------------------------------------------------
Tue Aug 23 11:22:19 EEST 2011 - koprok@nand.bg
- Removed opencv-2.3-cmake.patch, old cmake cannot be used any more.
- Python bindings cannot be built without NumPy any more.
-------------------------------------------------------------------
Fri Aug 19 15:03:45 EEST 2011 - koprok@nand.bg
- Update to OpenCV 2.3.1
-------------------------------------------------------------------
Wed Aug 17 23:50:39 UTC 2011 - reddwarf@opensuse.org

View File

@ -21,20 +21,21 @@
Name: opencv
%define libname lib%{name}
%define soname 2_3
Version: 2.3.0
Version: 2.3.1
Release: 14
License: BSD3c
Summary: Collection of algorithms for computer vision
Url: http://%{name}.willowgarage.com/wiki/
Group: Development/Libraries
Source0: http://downloads.sourceforge.net/project/%{name}library/%{name}-unix/2.3/OpenCV-%{version}.tar.bz2
Patch0: %{name}-2.3-libdir.patch
Patch1: %{name}-2.3-samples.patch
Source0: http://downloads.sourceforge.net/project/%{name}library/%{name}-unix/%{version}/OpenCV-%{version}.tar.bz2
# PATCH-FIX-UPSTREAM %{name}-libdir.patch koprok@nand.bg -- Add an option to install libraries and python packages in lib64.
Patch0: %{name}-libdir.patch
# PATCH-FIX-UPSTREAM %{name}-samples.patch koprok@nand.bg -- Improve samples installation.
Patch1: %{name}-samples.patch
# PATCH-FIX-UPSTREAM %{name}-2.3-underlinking.patch reddwarf@opensuse.org -- Make libopencv_highgui.so link to libv4l2 since it's using symbols defined there.
Patch3: %{name}-2.3-underlinking.patch
Patch7: %{name}-2.3-cmake.patch
# PATCH-FIX-UPSTREAM %{name}-2.3-ffmpeg.patch reddwarf@opensuse.org -- Allows to compile with latest ffmpeg. Took from upstream SVN.
Patch8: %{name}-2.3-ffmpeg.patch
# PATCH-FIX-OPENSUSE %{name}-datadir.patch koprok@nand.bg -- Install data files in share/opencv instead of share/OpenCV.
Patch9: %{name}-datadir.patch
%if 0%{?suse_version} >= 1120
BuildRequires: gstreamer-0_10-plugins-base-devel
BuildRequires: gstreamer-0_10-devel
@ -61,8 +62,7 @@ BuildRequires: libffmpeg-devel
%endif
%if 0%{?suse_version} >= 1130
BuildRequires: python-numpy-devel
%endif
%if 0%{?suse_version} >= 1120
%else
BuildRequires: python-numpy
%endif
%if 0%{?suse_version} < 1210
@ -126,10 +126,7 @@ This package contains the documentation and examples for the OpenCV library.
%patch0 -p1
%patch1 -p1
%patch3
%patch7 -p1
%if %{with ffmpeg}
%patch8
%endif
%patch9 -p1
# Windows specific and with wrong end of line
rm -f doc/packaging.txt
@ -182,7 +179,7 @@ rm -rf %{buildroot}
%defattr(0644, root, root, 0755)
%attr(0755, root, root) %{_bindir}/%{name}_*
%{_datadir}/%{name}
%exclude %{_datadir}/%{name}/OpenCVConfig.cmake
%exclude %{_datadir}/%{name}/OpenCVConfig*.cmake
%files devel
%defattr(0644, root, root, 0755)
@ -190,14 +187,15 @@ rm -rf %{buildroot}
%{_includedir}/opencv2
%{_libdir}/lib*.so
%{_libdir}/pkgconfig/%{name}.pc
%{_datadir}/%{name}/OpenCVConfig.cmake
%{_datadir}/%{name}/OpenCVConfig*.cmake
%files -n python-%{name}
%defattr(0644, root, root, 0755)
%if 0%{?suse_version} < 1120
%{py_sitedir}/cv.so
%{py_sitedir}/cv.py
%{py_sitedir}/cv2.so
%else
%{python_sitearch}/cv.so
%{python_sitearch}/cv.py
%{python_sitearch}/cv2.so
%endif