diff --git a/README.md b/README.md index 86330af..c0fa9e1 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,4 @@ # opencv2 +OpenCV (Open Source Computer Vision) is a library of programming functions for real time computer vision. + diff --git a/opencv-2.1.0-libpng14.patch b/opencv-2.1.0-libpng14.patch new file mode 100644 index 0000000..16da821 --- /dev/null +++ b/opencv-2.1.0-libpng14.patch @@ -0,0 +1,11 @@ +--- OpenCV-2.1.0/src/highgui/grfmt_png.cpp 2010-04-06 03:24:44.000000000 +0200 ++++ OpenCV-2.1.0/src/highgui/grfmt_png.cpp.libpng14 2010-10-11 19:42:14.000000000 +0200 +@@ -223,7 +223,7 @@ + png_set_palette_to_rgb( png_ptr ); + + if( m_color_type == PNG_COLOR_TYPE_GRAY && m_bit_depth < 8 ) +- png_set_gray_1_2_4_to_8( png_ptr ); ++ png_set_expand_gray_1_2_4_to_8( png_ptr ); + + if( CV_MAT_CN(m_type) > 1 && color ) + png_set_bgr( png_ptr ); // convert RGB to BGR diff --git a/opencv-2.3.1-arm-build.patch b/opencv-2.3.1-arm-build.patch new file mode 100644 index 0000000..eac13bc --- /dev/null +++ b/opencv-2.3.1-arm-build.patch @@ -0,0 +1,13 @@ +Index: src/OpenCV-2.3.1/modules/flann/include/opencv2/flann/dist.h +=================================================================== +--- src/OpenCV-2.3.1/modules/flann/include/opencv2/flann/dist.h 2011-09-12 20:42:27.000000000 +0200 ++++ src/OpenCV-2.3.1/modules/flann/include/opencv2/flann/dist.h 2012-02-05 15:10:28.715982724 +0100 +@@ -60,7 +60,7 @@ + inline double abs(double x) { return fabs(x); } + + template<> +-inline long double abs(long double x) { return fabsl(x); } ++inline long double abs(long double x) { return fabs(x); } + + + template diff --git a/opencv-2.4.10-i586-inconsistent-constraint-asm.patch b/opencv-2.4.10-i586-inconsistent-constraint-asm.patch new file mode 100644 index 0000000..789f65f --- /dev/null +++ b/opencv-2.4.10-i586-inconsistent-constraint-asm.patch @@ -0,0 +1,46 @@ +From ea50be0529c248961e1b66293f8a9e4b807294a6 Mon Sep 17 00:00:00 2001 +From: Samuel Martin +Date: Sun, 12 Oct 2014 10:17:23 +0200 +Subject: [PATCH] core: fix x86 PIC code compilation + +This bug was triggered by Buildroot autobuilders [1,2], causing this +kind of failures [3,4]: + + [ 14%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/system.cpp.o + /home/test/autobuild/instance-0/output/build/opencv-2.4.10/modules/core/src/system.cpp: In function '(static initializers for /home/test/autobuild/instance-0/output/build/opencv-2.4.10/modules/core/src/system.cpp)': + /home/test/autobuild/instance-0/output/build/opencv-2.4.10/modules/core/src/system.cpp:280:10: error: inconsistent operand constraints in an 'asm' + make[3]: *** [modules/core/CMakeFiles/opencv_core.dir/src/system.cpp.o] Error 1 + +[1] http://buildroot.org/ +[2] http://autobuild.buildroot.org/ +[3] http://autobuild.buildroot.org/?reason=opencv-2.4.10 +[4] http://autobuild.buildroot.org/results/483/4838285b25d6293a5cf0bb9eadd5040a7c75d766/build-end.log + +Signed-off-by: Samuel Martin +--- + modules/core/src/system.cpp | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/modules/core/src/system.cpp b/modules/core/src/system.cpp +index 5a970d5..e9ffdc7 100644 +--- a/modules/core/src/system.cpp ++++ b/modules/core/src/system.cpp +@@ -267,14 +267,17 @@ struct HWFeatures + : "cc" + ); + #else ++ // We need to preserve ebx since we are compiling PIC code. ++ // This means we cannot use "=b" for the 2nd output register. + asm volatile + ( + "pushl %%ebx\n\t" + "movl $7,%%eax\n\t" + "movl $0,%%ecx\n\t" + "cpuid\n\t" ++ "movl %%ebx,%1\n\t" + "popl %%ebx\n\t" +- : "=a"(cpuid_data[0]), "=b"(cpuid_data[1]), "=c"(cpuid_data[2]), "=d"(cpuid_data[3]) ++ : "=a"(cpuid_data[0]), "=r"(cpuid_data[1]), "=c"(cpuid_data[2]), "=d"(cpuid_data[3]) + : + : "cc" + ); diff --git a/opencv-2.4.9-buildfix-x86-asm-constraint.patch b/opencv-2.4.9-buildfix-x86-asm-constraint.patch new file mode 100644 index 0000000..2c73e41 --- /dev/null +++ b/opencv-2.4.9-buildfix-x86-asm-constraint.patch @@ -0,0 +1,55 @@ +diff --git a/package/opencv/opencv-0001-core-fix-x86-PIC-code-compilation.patch b/package/opencv/opencv-0001-core-fix-x86-PIC-code-compilation.patch +new file mode 100644 +index 0000000..9e8c2e9 +--- /dev/null ++++ b/package/opencv/opencv-0001-core-fix-x86-PIC-code-compilation.patch +@@ -0,0 +1,49 @@ ++From ea50be0529c248961e1b66293f8a9e4b807294a6 Mon Sep 17 00:00:00 2001 ++From: Samuel Martin ++Date: Sun, 12 Oct 2014 10:17:23 +0200 ++Subject: [PATCH] core: fix x86 PIC code compilation ++ ++This bug was triggered by Buildroot autobuilders [1,2], causing this ++kind of failures [3,4]: ++ ++ [ 14%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/system.cpp.o ++ /home/test/autobuild/instance-0/output/build/opencv-2.4.10/modules/core/src/system.cpp: In function '(static initializers for /home/test/autobuild/instance-0/output/build/opencv-2.4.10/modules/core/src/system.cpp)': ++ /home/test/autobuild/instance-0/output/build/opencv-2.4.10/modules/core/src/system.cpp:280:10: error: inconsistent operand constraints in an 'asm' ++ make[3]: *** [modules/core/CMakeFiles/opencv_core.dir/src/system.cpp.o] Error 1 ++ ++[1] http://buildroot.org/ ++[2] http://autobuild.buildroot.org/ ++[3] http://autobuild.buildroot.org/?reason=opencv-2.4.10 ++[4] http://autobuild.buildroot.org/results/483/4838285b25d6293a5cf0bb9eadd5040a7c75d766/build-end.log ++ ++Signed-off-by: Samuel Martin ++--- ++ modules/core/src/system.cpp | 5 ++++- ++ 1 file changed, 4 insertions(+), 1 deletion(-) ++ ++diff --git a/modules/core/src/system.cpp b/modules/core/src/system.cpp ++index 5a970d5..e9ffdc7 100644 ++--- a/modules/core/src/system.cpp +++++ b/modules/core/src/system.cpp ++@@ -267,14 +267,17 @@ struct HWFeatures ++ : "cc" ++ ); ++ #else +++ // We need to preserve ebx since we are compiling PIC code. +++ // This means we cannot use "=b" for the 2nd output register. ++ asm volatile ++ ( ++ "pushl %%ebx\n\t" ++ "movl $7,%%eax\n\t" ++ "movl $0,%%ecx\n\t" ++ "cpuid\n\t" +++ "movl %%ebx,%1\n\t" ++ "popl %%ebx\n\t" ++- : "=a"(cpuid_data[0]), "=b"(cpuid_data[1]), "=c"(cpuid_data[2]), "=d"(cpuid_data[3]) +++ : "=a"(cpuid_data[0]), "=r"(cpuid_data[1]), "=c"(cpuid_data[2]), "=d"(cpuid_data[3]) ++ : ++ : "cc" ++ ); ++-- ++2.1.2 ++ diff --git a/opencv2.spec b/opencv2.spec new file mode 100644 index 0000000..325b31a --- /dev/null +++ b/opencv2.spec @@ -0,0 +1,373 @@ +%define pkgver %(echo %version | sed "s|[a-z]||") +%define javaver %(echo %version | cut -d. -f1-3 | tr -d .) +Name: opencv2 +Version: 2.4.13 +Release: 1mamba +Summary: Collection of algorithms for computer vision +Group: Development/Libraries +Vendor: openmamba +Distribution: openmamba +Packager: Davide Madrisan +URL: http://opencv.willowgarage.com/wiki/ +Source: http://downloads.sourceforge.net/project/opencvlibrary/opencv-unix/%{version}/opencv-%{version}.zip +#Source: http://downloads.sourceforge.net/project/opencvlibrary/opencv-unix/%{version}/opencv-%{version}.tar.gz +Patch0: opencv-2.1.0-libpng14.patch +Patch1: opencv-2.3.1-arm-build.patch +Patch2: opencv-2.4.9-buildfix-x86-asm-constraint.patch +Patch3: opencv-2.4.10-i586-inconsistent-constraint-asm.patch +License: BSD +## AUTOBUILDREQ-BEGIN +BuildRequires: glibc-devel +BuildRequires: libatk-devel +BuildRequires: libavcodec-ffmpeg-devel +BuildRequires: libavformat-ffmpeg-devel +BuildRequires: libavutil-ffmpeg-devel +BuildRequires: libbzip2-devel +BuildRequires: libcairo-devel +BuildRequires: libdc1394-devel +BuildRequires: libfontconfig-devel +BuildRequires: libfreetype-devel +BuildRequires: libgcc +BuildRequires: libgdk-pixbuf-devel +BuildRequires: libglib-devel +BuildRequires: libgst-plugins-base-devel +BuildRequires: libgst-plugins-base010-devel +BuildRequires: libgstreamer-devel +BuildRequires: libgstreamer010-devel +BuildRequires: libgtk2-devel +BuildRequires: libilmbase-devel +BuildRequires: libjasper-devel +BuildRequires: libjpeg-devel +BuildRequires: libopenexr-devel +BuildRequires: libpango-devel +BuildRequires: libpng-devel +BuildRequires: libpython-devel +BuildRequires: libpython27-devel +BuildRequires: libstdc++6-devel +BuildRequires: libswscale-ffmpeg-devel +BuildRequires: libtiff-devel +BuildRequires: libunicap-devel +BuildRequires: libv4l-devel +BuildRequires: libxine-devel +BuildRequires: libxml2-devel +BuildRequires: libz-devel +## AUTOBUILDREQ-END +BuildRequires: python-Imaging +BuildRequires: python-numpy +Requires: lib%{name} = %{?epoch:%epoch:}%{version}-%{release} +BuildRoot: %{_tmppath}/%{name}-%{version}-root + +%description +OpenCV (Open Source Computer Vision) is a library of programming functions for real time computer vision. + +%package -n lib%{name} +Summary: Collection of algorithms for computer vision +Group: System/Libraries +Provides: libopencv-kde4 +Obsoletes: libopencv-kde4 +Provides: libopencv-kde4-devel +Obsoletes: libopencv-kde4-devel + +%description -n lib%{name} +OpenCV (Open Source Computer Vision) is a library of programming functions for real time computer vision. +This package contains the OpenCV static libraries. + +%package -n lib%{name}-devel +Summary: Devel package for %{name} +Group: Development/Libraries +Requires: lib%{name} = %{?epoch:%epoch:}%{version}-%{release} +Requires: java-opencv2 = %{?epoch:%epoch:}%{version}-%{release} + +%description -n lib%{name}-devel +OpenCV (Open Source Computer Vision) is a library of programming functions for real time computer vision. +This package contains static libraries and header files need for development. + +%package -n lib%{name}-kde4 +Summary: OpenCV libraries build with gstreamer 0.10 for KDE 4 +Group: System/Libraries + +%description -n lib%{name}-kde4 +OpenCV (Open Source Computer Vision) is a library of programming functions for real time computer vision. +This package contains the OpenCV libraries built with gstreamer 0.10 for KDE 4 + +%package -n lib%{name}-kde4-devel +Summary: Devel package for %{name} +Group: Development/Libraries +Requires: lib%{name}-kde4 = %{?epoch:%epoch:}%{version}-%{release} +Requires: java-opencv2 = %{?epoch:%epoch:}%{version}-%{release} + +%description -n lib%{name}-kde4-devel +OpenCV (Open Source Computer Vision) is a library of programming functions for real time computer vision. +This package contains static libraries and header files need for development. + +%package -n java-opencv2 +Summary: Java bindings for apps which use OpenCV +Group: Development/Libraries +Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release} + +%description -n java-opencv2 +This package contains Python bindings for the OpenCV library. + +%package -n python-cv2 +Summary: Python bindings for apps which use OpenCV +Group: Development/Libraries +Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release} +Requires: python-Imaging +Requires: python-numpy + +%description -n python-cv2 +This package contains Python bindings for the OpenCV library. + +%prep +%setup -q -n opencv-%{version} +#-D -T +#:<< _EOF +%ifarch %{ix86} +%patch2 -p1 +%endif +#%patch3 -p1 + +#% define _use_internal_dependency_generator 0 + +## Cohexistance provides/requires for KDE4 legacy package +#% define __find_provides %{_builddir}/opencv-%{version}/find_provides.sh +#cat > %{_builddir}/opencv-%{version}/find_provides.sh <<_EOF +##! /bin/sh +#grep -v %{buildroot}%{_kde4_libdir} | \ +#%{_prefix}/lib/rpm/find-provides %{buildroot} %{_target_cpu} +#_EOF +#chmod +x %{_builddir}/opencv-%{version}/find_provides.sh +# +#% define __find_requires %{_builddir}/opencv-%{version}/find_requires.sh +#cat > %{_builddir}/opencv-%{version}/find_requires.sh <<_EOF +##! /bin/sh +#%{_prefix}/lib/rpm/find-requires %{buildroot} %{_target_cpu} 2>/dev/null | +#while read line; do +# [ "\${line:0:10}" == "libopencv_" ] || echo "\$line" +#done +#_EOF +#chmod +x %{_builddir}/opencv-%{version}/find_requires.sh + + +# WARNING: don't reinstall with -D -T or cmake files will be incorrect +#% ifarch arm +#% patch1 -p2 +#% endif + +%build +#:<< _EOF +#-- Interfaces: +# -- Use IPP: NO (Intel Performance Primitive) +# -- Use TBB: NO (Threading Building Blocks library) +# -- Build Documentation 0 +# +# append flag -D__STDC_CONSTANT_MACROS to fix build with ffmpeg >= 0.6 +PYTHON_PATH=`echo %python27_sitelib | sed "s|%{_prefix}/||"` +%cmake -d build \ + -DCMAKE_BUILD_TYPE=Release \ + -DWITH_GSTREAMER=1 \ + -DWITH_XINE=1 \ + -DWITH_UNICAP=1 \ + -DWITH_1394=1 \ + -DWITH_FFMPEG=1 \ + -DWITH_QUICKTIME=0 \ + -DBUILD_SWIG_PYTHON_SUPPORT=1 \ + -DINSTALL_C_EXAMPLES=0 \ + -DCMAKE_CXX_FLAGS:STRING="$RPM_OPT_FLAGS -D__STDC_CONSTANT_MACROS" \ + -DPYTHON_PACKAGES_PATH:PATH=$PYTHON_PATH \ + -DENABLE_PRECOMPILED_HEADERS=OFF + +%make_jobs + +:<< _disabled +cd .. + +# Gstreamer 0.10 version for KDE4 (digikam) +%cmake_kde4 -d build_kde4 \ + -DCMAKE_BUILD_TYPE=Release \ + -DWITH_GSTREAMER=0 \ + -DWITH_XINE=1 \ + -DWITH_UNICAP=1 \ + -DWITH_1394=1 \ + -DWITH_FFMPEG=1 \ + -DWITH_QUICKTIME=0 \ + -DBUILD_SWIG_PYTHON_SUPPORT=1 \ + -DINSTALL_C_EXAMPLES=0 \ + -DCMAKE_CXX_FLAGS:STRING="$RPM_OPT_FLAGS -D__STDC_CONSTANT_MACROS" \ + -DPYTHON_PACKAGES_PATH:PATH=$PYTHON_PATH + +%make_jobs + +%install +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" +#% makeinstall -C build_kde4 +%makeinstall -C build + +## Fix permissions +#chmod 0755 %{buildroot}%{python_sitearch}/cv2.so +#chmod 0755 %{buildroot}%{python_sitearch}/cv.py + +# Remove unpackaged files +rm -fr %{buildroot}%{_datadir}/opencv/doc +rm -rf %{buildroot}%{_kde4_sharedir}/OpenCV/java +rm -rf %{buildroot}%{_kde4_bindir} +rm -rf %{buildroot}/opt/kde/lib/python* + +%clean +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" + +%post -n lib%{name} +/sbin/ldconfig +: + +%postun -n lib%{name} +/sbin/ldconfig +: + +%post -n lib%{name}-kde4 +/sbin/ldconfig +: + +%postun -n lib%{name}-kde4 +/sbin/ldconfig +: + +%files +%defattr(-,root,root) +%{_bindir}/opencv_* + +%files -n libopencv2 +%defattr(-,root,root) +%{_libdir}/libopencv_*.so.* + +%files -n libopencv2-devel +%defattr(-,root,root) +%dir %{_includedir}/opencv +%{_includedir}/opencv/* +%dir %{_includedir}/opencv2 +%{_includedir}/opencv2/* +%{_libdir}/libopencv_*.so +%{_libdir}/libopencv_ts.a +%dir %{_datadir}/OpenCV +%dir %{_datadir}/OpenCV/haarcascades +%{_datadir}/OpenCV/haarcascades/* +%dir %{_datadir}/OpenCV/lbpcascades +%{_datadir}/OpenCV/lbpcascades/* +%dir %{_datadir}/OpenCV +%dir %{_datadir}/OpenCV/doc +%{_datadir}/OpenCV/doc/* +%{_datadir}/OpenCV/*.cmake +%{_libdir}/pkgconfig/opencv.pc + +%files -n java-opencv2 +%defattr(-,root,root) +%dir %{_datadir}/OpenCV/java +%{_datadir}/OpenCV/java/libopencv_java%{javaver}.so +%{_datadir}/OpenCV/java/opencv-%{javaver}.jar + +%ifnarch arm +%files -n python-cv2 +%defattr(-,root,root) +%{python_sitelib}/cv.py +%{python_sitelib}/cv2.so +%endif + +#%files -n libopencv2-kde4 +#%defattr(-,root,root) +#%{_kde4_libdir}/libopencv_calib3d.so.* +#%{_kde4_libdir}/libopencv_contrib.so.* +#%{_kde4_libdir}/libopencv_core.so.* +#%{_kde4_libdir}/libopencv_features2d.so.* +#%{_kde4_libdir}/libopencv_flann.so.* +#%{_kde4_libdir}/libopencv_gpu.so.* +#%{_kde4_libdir}/libopencv_highgui.so.* +#%{_kde4_libdir}/libopencv_imgproc.so.* +#%{_kde4_libdir}/libopencv_legacy.so.* +#%{_kde4_libdir}/libopencv_ml.so.* +#%{_kde4_libdir}/libopencv_nonfree.so.* +#%{_kde4_libdir}/libopencv_objdetect.so.* +#%{_kde4_libdir}/libopencv_ocl.so.* +#%{_kde4_libdir}/libopencv_photo.so.* +#%{_kde4_libdir}/libopencv_stitching.so.* +#%{_kde4_libdir}/libopencv_superres.so.* +#%{_kde4_libdir}/libopencv_video.so.* +#%{_kde4_libdir}/libopencv_videostab.so.* +#%dir %{_kde4_sharedir}/OpenCV/ +#%dir %{_kde4_sharedir}/OpenCV/doc +#%{_kde4_sharedir}/OpenCV/doc/* +#%dir %{_kde4_sharedir}/OpenCV/haarcascades +#%{_kde4_sharedir}/OpenCV/haarcascades/* +#%dir %{_kde4_sharedir}/OpenCV/lbpcascades +#%{_kde4_sharedir}/OpenCV/lbpcascades/* + +#%files -n libopencv2-kde4-devel +#%defattr(-,root,root) +#%dir %{_kde4_includedir}/opencv +#%{_kde4_includedir}/opencv/* +#%dir %{_kde4_includedir}/opencv2 +#%{_kde4_includedir}/opencv2/* +#%{_kde4_libdir}/libopencv_*.so +#%{_kde4_libdir}/libopencv_ts.a +#%{_kde4_sharedir}/OpenCV/*.cmake +#%{_kde4_libdir}/pkgconfig/opencv.pc + +%changelog +* Mon Jul 23 2018 Silvan Calarco 2.4.13-1mamba +- update to 2.4.13 + +* Wed Dec 23 2015 Silvan Calarco 2.4.11-3mamba +- rebuilt with gcc 5.3.0 + +* Tue Sep 22 2015 Silvan Calarco 2.4.11-2mamba +- libopencv-devel: require java-opencv or provided cmake files fail + +* Fri Aug 14 2015 Silvan Calarco 2.4.11-1mamba +- update to 2.4.11 + +* Fri May 29 2015 Silvan Calarco 2.4.10-2mamba +- build kde4 version with gstreamer 0.10 (should fix digikam) + +* Sun Dec 28 2014 Automatic Build System 2.4.10-1mamba +- automatic version update by autodist + +* Thu Sep 04 2014 Silvan Calarco 2.4.9-2mamba +- rebuilt to fix wrong cmake files on i586 which don't like to digikam + +* Tue Jul 15 2014 Automatic Build System 2.4.9-1mamba +- automatic version update by autodist + +* Wed Jan 15 2014 Silvan Calarco 2.4.8-1mamba +- update to 2.4.8 + +* Wed Nov 13 2013 Automatic Build System 2.4.7-1mamba +- automatic version update by autodist + +* Mon Aug 26 2013 Silvan Calarco 2.4.6.1-3mamba +- rebuilt after upgrading libatlas-3.8.4-2mamba which fixes python-numpy + +* Wed Aug 21 2013 Silvan Calarco 2.4.6.1-2mamba +- rebuilt with libopenexr-2.0.1-3mamba nad python-numpy 1.8 + +* Sun Jul 14 2013 Automatic Build System 2.4.6.1-1mamba +- automatic version update by autodist + +* Mon Jul 08 2013 Automatic Build System 2.4.6-1mamba +- automatic version update by autodist + +* Thu Apr 25 2013 Automatic Build System 2.4.5-1mamba +- update to 2.4.5 + +* Sat Dec 01 2012 Automatic Build System 2.4.3-1mamba +- automatic version update by autodist + +* Thu Aug 09 2012 Automatic Build System 2.4.2-1mamba +- automatic version update by autodist + +* Fri Dec 09 2011 Silvan Calarco 2.3.1a-1mamba +- update to 2.3.1a + +* Mon Oct 11 2010 Davide Madrisan 2.1.0-1mamba +- update to 2.1.0 + +* Mon Dec 07 2009 Davide Madrisan 2.0.0-1mamba +- package created by autospec