Accepting request 75617 from KDE:Distro:Factory
Fix compilation with kernel 2.6.38 headers which removed v4l interface. (forwarded request 75616 from namtrac) OBS-URL: https://build.opensuse.org/request/show/75617 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/opencv?expand=0&rev=17
This commit is contained in:
parent
8eba5ee96d
commit
390780546f
33
opencv-v4l-2.6.38.patch
Normal file
33
opencv-v4l-2.6.38.patch
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
diff -up OpenCV-2.2.0/modules/highgui/src/cap_v4l.cpp.nov4l1 OpenCV-2.2.0/modules/highgui/src/cap_v4l.cpp
|
||||||
|
--- OpenCV-2.2.0/modules/highgui/src/cap_v4l.cpp.nov4l1 2010-12-05 11:35:25.000000000 +0800
|
||||||
|
+++ OpenCV-2.2.0/modules/highgui/src/cap_v4l.cpp 2011-04-18 10:40:01.984950054 +0800
|
||||||
|
@@ -214,7 +214,7 @@
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/mman.h>
|
||||||
|
|
||||||
|
-#include <linux/videodev.h>
|
||||||
|
+#include <libv4l1-videodev.h>
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
diff -up OpenCV-2.2.0/modules/highgui/src/cap_v4l.cpp.nov4l1 OpenCV-2.2.0/modules/highgui/src/cap_libv4l.cpp.cpp
|
||||||
|
--- OpenCV-2.2.0/modules/highgui/src/cap_libv4l.cpp.nov4l1 2010-12-05 11:35:25.000000000 +0800
|
||||||
|
+++ OpenCV-2.2.0/modules/highgui/src/cap_libv4l.cpp 2011-04-18 10:39:07.568578185 +0800
|
||||||
|
@@ -224,7 +224,7 @@
|
||||||
|
#include "highgui.h"
|
||||||
|
#include "precomp.hpp"
|
||||||
|
|
||||||
|
-#if !defined WIN32 && defined HAVE_CAMV4L && defined HAVE_CAMV4L2
|
||||||
|
+#if !defined WIN32 && defined HAVE_CAMV4L2
|
||||||
|
|
||||||
|
#define CLEAR(x) memset (&(x), 0, sizeof (x))
|
||||||
|
|
||||||
|
@@ -241,7 +241,7 @@
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <sys/ioctl.h>
|
||||||
|
|
||||||
|
-#include <linux/videodev.h>
|
||||||
|
+#include <libv4l1-videodev.h>
|
||||||
|
#include <linux/videodev2.h>
|
||||||
|
|
||||||
|
#include <libv4l1.h>
|
@ -1,3 +1,8 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Jul 6 08:23:04 UTC 2011 - idonmez@novell.com
|
||||||
|
|
||||||
|
- Add opencv-v4l-2.6.38.patch: use the new libv4l2 interface
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Mon Dec 27 16:56:15 EET 2010 - koprok@nand.bg
|
Mon Dec 27 16:56:15 EET 2010 - koprok@nand.bg
|
||||||
|
|
||||||
|
60
opencv.spec
60
opencv.spec
@ -23,32 +23,48 @@ Name: opencv
|
|||||||
%define soname 2_2
|
%define soname 2_2
|
||||||
Version: 2.2.0
|
Version: 2.2.0
|
||||||
Release: 1
|
Release: 1
|
||||||
Summary: Collection of algorithms for computer vision
|
|
||||||
Group: Development/Libraries
|
|
||||||
License: BSD3c
|
License: BSD3c
|
||||||
|
Summary: Collection of algorithms for computer vision
|
||||||
Url: http://%{name}.willowgarage.com/wiki/
|
Url: http://%{name}.willowgarage.com/wiki/
|
||||||
|
Group: Development/Libraries
|
||||||
Source0: http://downloads.sourceforge.net/project/%{name}library/%{name}-unix/2.2/OpenCV-%{version}.tar.bz2
|
Source0: http://downloads.sourceforge.net/project/%{name}library/%{name}-unix/2.2/OpenCV-%{version}.tar.bz2
|
||||||
Patch0: %{name}-2.2-libdir.patch
|
Patch0: %{name}-2.2-libdir.patch
|
||||||
Patch1: %{name}-2.2-samples.patch
|
Patch1: %{name}-2.2-samples.patch
|
||||||
# PATCH-FIX-UPSTREAM %{name}-2.1-underlinking.patch sf#3083546 reddwarf@opensuse.org -- Link against libv4l2
|
|
||||||
Patch3: %{name}-2.1-underlinking.patch
|
Patch3: %{name}-2.1-underlinking.patch
|
||||||
Patch4: %{name}-2.2-gcc46.patch
|
Patch4: %{name}-2.2-gcc46.patch
|
||||||
Patch5: %{name}-2.2-zlib.patch
|
Patch5: %{name}-2.2-zlib.patch
|
||||||
|
# PATCH-FIX-UPSTREAM opencv-v4l-2.6.38.patch idoenmez@suse.de -- Fix libv4l2 support
|
||||||
|
Patch6: opencv-v4l-2.6.38.patch
|
||||||
|
BuildRequires: gstreamer-0_10-plugins-base-devel
|
||||||
|
BuildRequires: pkgconfig(gstreamer-0.10)
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
BuildRequires: gstreamer-0_10-devel gstreamer-0_10-plugins-base-devel
|
|
||||||
%if 0%{?suse_version} >= 1110
|
%if 0%{?suse_version} >= 1110
|
||||||
BuildRequires: libdc1394-devel libv4l-devel libxine-devel
|
BuildRequires: libdc1394-devel
|
||||||
|
BuildRequires: libxine-devel
|
||||||
%else
|
%else
|
||||||
BuildRequires: xine-devel
|
BuildRequires: xine-devel
|
||||||
%endif
|
%endif
|
||||||
BuildRequires: OpenEXR-devel gtk2-devel libjasper-devel libjpeg-devel libtiff-devel
|
BuildRequires: OpenEXR-devel
|
||||||
BuildRequires: cmake gcc-c++ libpng-devel python-devel zlib-devel
|
BuildRequires: cmake
|
||||||
|
BuildRequires: gcc-c++
|
||||||
|
BuildRequires: libjasper-devel
|
||||||
|
BuildRequires: libjpeg-devel
|
||||||
|
BuildRequires: libpng-devel
|
||||||
|
BuildRequires: libtiff-devel
|
||||||
|
BuildRequires: python-devel
|
||||||
|
BuildRequires: zlib-devel
|
||||||
|
BuildRequires: pkgconfig(gtk+-2.0)
|
||||||
%if %{with ffmpeg}
|
%if %{with ffmpeg}
|
||||||
BuildRequires: libffmpeg-devel
|
BuildRequires: libffmpeg-devel
|
||||||
%endif
|
%endif
|
||||||
%if 0%{?suse_version} >= 1130
|
%if 0%{?suse_version} >= 1130
|
||||||
BuildRequires: python-numpy-devel
|
BuildRequires: python-numpy-devel
|
||||||
%endif
|
%endif
|
||||||
|
%if 0%{?suse_version} < 1210
|
||||||
|
BuildRequires: libv4l-devel
|
||||||
|
%else
|
||||||
|
BuildRequires: libv4l-devel >= 0.8.4
|
||||||
|
%endif
|
||||||
|
|
||||||
%description
|
%description
|
||||||
OpenCV means Intel® Open Source Computer Vision Library. It is a collection of C
|
OpenCV means Intel® Open Source Computer Vision Library. It is a collection of C
|
||||||
@ -57,7 +73,6 @@ Computer Vision algorithms.
|
|||||||
|
|
||||||
%package -n %{libname}%{soname}
|
%package -n %{libname}%{soname}
|
||||||
|
|
||||||
|
|
||||||
Summary: Development files for using the OpenCV library
|
Summary: Development files for using the OpenCV library
|
||||||
Group: Development/Libraries
|
Group: Development/Libraries
|
||||||
|
|
||||||
@ -81,7 +96,6 @@ use the OpenCV library.
|
|||||||
|
|
||||||
%package -n python-%{name}
|
%package -n python-%{name}
|
||||||
|
|
||||||
|
|
||||||
Summary: Python bindings for apps which use OpenCV
|
Summary: Python bindings for apps which use OpenCV
|
||||||
Group: Development/Libraries
|
Group: Development/Libraries
|
||||||
Requires: python-base
|
Requires: python-base
|
||||||
@ -91,7 +105,6 @@ This package contains Python bindings for the OpenCV library.
|
|||||||
|
|
||||||
%package -n %{name}-doc
|
%package -n %{name}-doc
|
||||||
|
|
||||||
|
|
||||||
Summary: Documentation and examples for OpenCV
|
Summary: Documentation and examples for OpenCV
|
||||||
Group: Documentation
|
Group: Documentation
|
||||||
# Since this package also contains examples that need -devel to be compiled
|
# Since this package also contains examples that need -devel to be compiled
|
||||||
@ -107,22 +120,27 @@ This package contains the documentation and examples for the OpenCV library.
|
|||||||
%patch3
|
%patch3
|
||||||
%patch4 -p1
|
%patch4 -p1
|
||||||
%patch5 -p1
|
%patch5 -p1
|
||||||
|
|
||||||
|
%if 0%{?suse_version} >= 1210
|
||||||
|
%patch6 -p1
|
||||||
|
%endif
|
||||||
|
|
||||||
# Windows specific and with wrong end of line
|
# Windows specific and with wrong end of line
|
||||||
%{__rm} -f doc/packaging.txt
|
rm -f doc/packaging.txt
|
||||||
%{__chmod} +x samples/c/build_all.sh
|
chmod +x samples/c/build_all.sh
|
||||||
sed -i 's/\r$//' samples/c/adaptiveskindetector.cpp \
|
sed -i 's/\r$//' samples/c/adaptiveskindetector.cpp \
|
||||||
samples/c/latentsvmdetect.cpp \
|
samples/c/latentsvmdetect.cpp \
|
||||||
samples/gpu/hog.cpp \
|
samples/gpu/hog.cpp \
|
||||||
samples/python/camshift.py
|
samples/python/camshift.py
|
||||||
|
|
||||||
%build
|
%build
|
||||||
export CFLAGS=$RPM_OPT_FLAGS
|
export CFLAGS="%{optflags}"
|
||||||
export CXXFLAGS=$RPM_OPT_FLAGS
|
export CXXFLAGS="%{optflags}"
|
||||||
%{__mkdir} build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
cmake -DCMAKE_SKIP_RPATH=ON \
|
cmake -DCMAKE_SKIP_RPATH=ON \
|
||||||
-DCMAKE_INSTALL_PREFIX='%{_prefix}' \
|
-DCMAKE_INSTALL_PREFIX='%{_prefix}' \
|
||||||
-DLIB_SUFFIX=$(echo %_lib | cut -b4-) \
|
-DLIB_SUFFIX=$(echo %{_lib} | cut -b4-) \
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
-DUSE_OMIT_FRAME_POINTER=OFF \
|
-DUSE_OMIT_FRAME_POINTER=OFF \
|
||||||
-DWITH_XINE=ON \
|
-DWITH_XINE=ON \
|
||||||
@ -130,14 +148,14 @@ cmake -DCMAKE_SKIP_RPATH=ON \
|
|||||||
-DINSTALL_C_EXAMPLES=ON \
|
-DINSTALL_C_EXAMPLES=ON \
|
||||||
-DINSTALL_PYTHON_EXAMPLES=ON \
|
-DINSTALL_PYTHON_EXAMPLES=ON \
|
||||||
..
|
..
|
||||||
%{__make} %{?jobs:-j %jobs} VERBOSE=1
|
make %{?_smp_mflags} VERBOSE=1
|
||||||
|
|
||||||
%install
|
%install
|
||||||
cd build
|
cd build
|
||||||
%{__make} DESTDIR=%{?buildroot:%{buildroot}} install/fast
|
make DESTDIR=%{?buildroot:%{buildroot}} install/fast
|
||||||
%{__mkdir_p} %{buildroot}%{_docdir}
|
mkdir -p %{buildroot}%{_docdir}
|
||||||
%{__mv} %{buildroot}%{_datadir}/%{name}/doc %{buildroot}%{_docdir}/%{name}-doc
|
mv %{buildroot}%{_datadir}/%{name}/doc %{buildroot}%{_docdir}/%{name}-doc
|
||||||
%{__mv} %{buildroot}%{_datadir}/%{name}/samples %{buildroot}%{_docdir}/%{name}-doc/examples
|
mv %{buildroot}%{_datadir}/%{name}/samples %{buildroot}%{_docdir}/%{name}-doc/examples
|
||||||
|
|
||||||
%clean
|
%clean
|
||||||
rm -rf %{buildroot}
|
rm -rf %{buildroot}
|
||||||
|
Loading…
Reference in New Issue
Block a user