Accepting request 109883 from KDE:Distro:Factory

Fix build with gcc 4.7 - Please work with upstream to resolve it in upstream code base. There is also a chance that a newer version of the package might have this fixed already. (forwarded request 109787 from dimstar)

OBS-URL: https://build.opensuse.org/request/show/109883
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/opencv?expand=0&rev=30
This commit is contained in:
Stephan Kulow 2012-03-20 10:30:49 +00:00 committed by Git OBS Bridge
parent b7f02a04a1
commit 6d2b25a59f
3 changed files with 24 additions and 3 deletions

13
opencv-gcc47.patch Normal file
View File

@ -0,0 +1,13 @@
Index: OpenCV-2.3.1/modules/highgui/src/window_QT.cpp
===================================================================
--- OpenCV-2.3.1.orig/modules/highgui/src/window_QT.cpp
+++ OpenCV-2.3.1/modules/highgui/src/window_QT.cpp
@@ -46,6 +46,8 @@
#ifdef _WIN32
#include <windows.h>
#define usleep Sleep
+#else
+#include <unistd.h> //for usleep
#endif
#ifndef M_PI

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Sat Mar 17 12:01:52 UTC 2012 - dimstar@opensuse.org
- Add opencv-gcc47.patch: Fix build with gcc 4.7.
-------------------------------------------------------------------
Tue Jan 10 04:24:32 UTC 2012 - crrodriguez@opensuse.org

View File

@ -39,6 +39,8 @@ Patch2: %{name}-2.3-underlinking.patch
Patch3: %{name}-datadir.patch
# PATCH-FIX-UPSTREAM opencv-clang.patch idoenmez@suse.de -- Upstream r6881 to fix clang compatibility
Patch4: %{name}-clang.patch
# PATCH-FIX-UPSTREAM opencv-gcc47.patch dimstar@opensuse.org -- Fix build with gcc 4.7.
Patch5: opencv-gcc47.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: OpenEXR-devel
BuildRequires: cmake
@ -51,12 +53,12 @@ BuildRequires: libjasper-devel
BuildRequires: libqt4-devel
#BuildRequires: libucil-devel
#BuildRequires: libunicap-devel
BuildRequires: libilmbase-devel
BuildRequires: libjpeg-devel
BuildRequires: libtiff-devel
BuildRequires: libxine-devel
BuildRequires: python-numpy-devel
BuildRequires: libtiff-devel
BuildRequires: zlib-devel
BuildRequires: libjpeg-devel
BuildRequires: libilmbase-devel
%if %{with ffmpeg}
BuildRequires: libffmpeg-devel
%endif
@ -117,6 +119,7 @@ This package contains the documentation and examples for the OpenCV library.
%patch2
%patch3 -p1
%patch4 -p1
%patch5 -p1
# Windows specific and with wrong end of line
rm -f doc/packaging.txt