From dee26322c3451eab0a14cd819a38eca8acb8891a Mon Sep 17 00:00:00 2001 From: Josef Ridky Date: Fri, 2 Mar 2018 09:59:17 +0100 Subject: [PATCH] Rebase to 3.4.1 --- .gitignore | 2 + ...513447eb16784113e982f6bef0dcabb77732.patch | 86 ------------------- opencv-3.1-pillow.patch | 13 --- opencv-3.4.1-cmake_paths.patch | 24 ++++++ opencv-3.4.1-cmake_va_intel_fix.patch | 9 ++ opencv-clean.sh | 2 +- opencv.spec | 49 +++++------ sources | 4 +- 8 files changed, 58 insertions(+), 131 deletions(-) delete mode 100644 476c513447eb16784113e982f6bef0dcabb77732.patch delete mode 100644 opencv-3.1-pillow.patch create mode 100644 opencv-3.4.1-cmake_paths.patch create mode 100644 opencv-3.4.1-cmake_va_intel_fix.patch diff --git a/.gitignore b/.gitignore index 9f2c082..972c5a5 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,5 @@ OpenCV-2.1.0.tar.bz2 /opencv_contrib-clean-3.2.0.tar.gz /opencv_contrib-clean-3.3.1.tar.gz /opencv-clean-3.3.1.tar.gz +/opencv_contrib-clean-3.4.1.tar.gz +/opencv-clean-3.4.1.tar.gz diff --git a/476c513447eb16784113e982f6bef0dcabb77732.patch b/476c513447eb16784113e982f6bef0dcabb77732.patch deleted file mode 100644 index 08b709a..0000000 --- a/476c513447eb16784113e982f6bef0dcabb77732.patch +++ /dev/null @@ -1,86 +0,0 @@ -From 5f80e42dac5f186d8b5fe9c64d700db26e5753e7 Mon Sep 17 00:00:00 2001 -From: Alexander Alekhin -Date: Sat, 28 Oct 2017 02:22:21 +0300 -Subject: [PATCH] cmake: update OpenBLAS support - -- reorder path HINTS to avoid conflicts with other LAPACK libraries -- add extern "C" { } to avoid generation of C++ symbols ---- - cmake/OpenCVFindLAPACK.cmake | 3 ++- - cmake/OpenCVFindOpenBLAS.cmake | 34 +++++++++++++++++----------------- - 2 files changed, 19 insertions(+), 18 deletions(-) - -diff --git a/cmake/OpenCVFindLAPACK.cmake b/cmake/OpenCVFindLAPACK.cmake -index 6a686c6cdc8..f5fce672568 100644 ---- a/cmake/OpenCVFindLAPACK.cmake -+++ b/cmake/OpenCVFindLAPACK.cmake -@@ -31,10 +31,11 @@ macro(ocv_lapack_check) - else() - # adding proxy opencv_lapack.h header - set(CBLAS_H_PROXY_PATH ${CMAKE_BINARY_DIR}/opencv_lapack.h) -- set(_lapack_include_str "\#include \"${OPENCV_CBLAS_H_PATH_${_lapack_impl}}\"") -+ set(_lapack_include_str "extern \"C\" {\n\#include \"${OPENCV_CBLAS_H_PATH_${_lapack_impl}}\"") - if(NOT "${OPENCV_CBLAS_H_PATH_${_lapack_impl}}" STREQUAL "${OPENCV_LAPACKE_H_PATH_${_lapack_impl}}") - set(_lapack_include_str "${_lapack_include_str}\n#include \"${OPENCV_LAPACKE_H_PATH_${_lapack_impl}}\"") - endif() -+ set(_lapack_include_str "${_lapack_include_str}\n}\n") - # update file contents (if required) - set(__content_str "") - if(EXISTS "${CBLAS_H_PROXY_PATH}") -diff --git a/cmake/OpenCVFindOpenBLAS.cmake b/cmake/OpenCVFindOpenBLAS.cmake -index 60594dee46a..ae2daaa194f 100644 ---- a/cmake/OpenCVFindOpenBLAS.cmake -+++ b/cmake/OpenCVFindOpenBLAS.cmake -@@ -44,35 +44,35 @@ - #license and copyright terms herein. - - SET(Open_BLAS_INCLUDE_SEARCH_PATHS -- /usr/include -+ $ENV{OpenBLAS_HOME} -+ $ENV{OpenBLAS_HOME}/include -+ /opt/OpenBLAS/include -+ /usr/local/include/openblas - /usr/include/openblas -+ /usr/local/include/openblas-base - /usr/include/openblas-base - /usr/local/include -- /usr/local/include/openblas -- /usr/local/include/openblas-base -- /opt/OpenBLAS/include -- $ENV{OpenBLAS_HOME} -- $ENV{OpenBLAS_HOME}/include -+ /usr/include - ) - - SET(Open_BLAS_LIB_SEARCH_PATHS -- /lib/ -- /lib/openblas-base -- /lib64/ -- /usr/lib -- /usr/lib/openblas-base -- /usr/lib64 -- /usr/local/lib -- /usr/local/lib64 -- /opt/OpenBLAS/lib - $ENV{OpenBLAS}cd - $ENV{OpenBLAS}/lib - $ENV{OpenBLAS_HOME} - $ENV{OpenBLAS_HOME}/lib -+ /opt/OpenBLAS/lib -+ /usr/local/lib64 -+ /usr/local/lib -+ /lib/openblas-base -+ /lib64/ -+ /lib/ -+ /usr/lib/openblas-base -+ /usr/lib64 -+ /usr/lib - ) - --FIND_PATH(OpenBLAS_INCLUDE_DIR NAMES cblas.h PATHS ${Open_BLAS_INCLUDE_SEARCH_PATHS}) --FIND_LIBRARY(OpenBLAS_LIB NAMES openblas PATHS ${Open_BLAS_LIB_SEARCH_PATHS}) -+FIND_PATH(OpenBLAS_INCLUDE_DIR NAMES cblas.h PATHS ${Open_BLAS_INCLUDE_SEARCH_PATHS} NO_DEFAULT_PATH) -+FIND_LIBRARY(OpenBLAS_LIB NAMES openblas PATHS ${Open_BLAS_LIB_SEARCH_PATHS} NO_DEFAULT_PATH) - - SET(OpenBLAS_FOUND ON) - diff --git a/opencv-3.1-pillow.patch b/opencv-3.1-pillow.patch deleted file mode 100644 index fcdf230..0000000 --- a/opencv-3.1-pillow.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff -up OpenCV-2.4.4/modules/contrib/doc/facerec/src/crop_face.py.pillow OpenCV-2.4.4/modules/contrib/doc/facerec/src/crop_face.py ---- ./modules/face/samples/etc/crop_face.py.pillow 2013-01-28 00:00:47.000000000 +0100 -+++ ./modules/face/samples/etc/crop_face.py 2013-02-18 19:56:11.979405809 +0100 -@@ -31,7 +31,8 @@ - # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - # POSSIBILITY OF SUCH DAMAGE. - --import sys, math, Image -+import sys, math -+from PIL import Image - - def Distance(p1,p2): - dx = p2[0] - p1[0] diff --git a/opencv-3.4.1-cmake_paths.patch b/opencv-3.4.1-cmake_paths.patch new file mode 100644 index 0000000..96af291 --- /dev/null +++ b/opencv-3.4.1-cmake_paths.patch @@ -0,0 +1,24 @@ +--- ./CMakeLists.txt.orig 2018-02-27 01:46:32.259819239 +0000 ++++ ./CMakeLists.txt 2018-02-27 19:48:19.658736383 +0000 +@@ -439,19 +439,14 @@ else() + ocv_update(OPENCV_CONFIG_INSTALL_PATH ".") + else() + include(GNUInstallDirs) +- ocv_update(OPENCV_LIB_INSTALL_PATH ${CMAKE_INSTALL_LIBDIR}${LIB_SUFFIX}) ++ ocv_update(OPENCV_LIB_INSTALL_PATH ${CMAKE_INSTALL_LIBDIR}) + ocv_update(OPENCV_3P_LIB_INSTALL_PATH share/OpenCV/3rdparty/${OPENCV_LIB_INSTALL_PATH}) + ocv_update(OPENCV_SAMPLES_SRC_INSTALL_PATH share/OpenCV/samples) + ocv_update(OPENCV_JAR_INSTALL_PATH share/OpenCV/java) + ocv_update(OPENCV_OTHER_INSTALL_PATH share/OpenCV) + + if(NOT DEFINED OPENCV_CONFIG_INSTALL_PATH) +- math(EXPR SIZEOF_VOID_P_BITS "8 * ${CMAKE_SIZEOF_VOID_P}") +- if(LIB_SUFFIX AND NOT SIZEOF_VOID_P_BITS EQUAL LIB_SUFFIX) +- ocv_update(OPENCV_CONFIG_INSTALL_PATH ${CMAKE_INSTALL_LIBDIR}${LIB_SUFFIX}/cmake/opencv) +- else() +- ocv_update(OPENCV_CONFIG_INSTALL_PATH share/OpenCV) +- endif() ++ ocv_update(OPENCV_CONFIG_INSTALL_PATH lib${LIB_SUFFIX}/OpenCV) + endif() + endif() + ocv_update(OPENCV_INCLUDE_INSTALL_PATH "include") diff --git a/opencv-3.4.1-cmake_va_intel_fix.patch b/opencv-3.4.1-cmake_va_intel_fix.patch new file mode 100644 index 0000000..3b1ba4c --- /dev/null +++ b/opencv-3.4.1-cmake_va_intel_fix.patch @@ -0,0 +1,9 @@ +--- ./samples/va_intel/CMakeLists.txt.bak 2018-02-28 01:53:40.199554269 +0000 ++++ ./samples/va_intel/CMakeLists.txt 2018-02-28 01:54:34.036200492 +0000 +@@ -17,5 +17,5 @@ ocv_include_modules_recurse(${OPENCV_VA_ + file(GLOB all_samples RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cpp) + foreach(sample_filename ${all_samples}) + ocv_define_sample(tgt ${sample_filename} va_intel) +- ocv_target_link_libraries(${tgt} ${OPENCV_LINKER_LIBS} ${OPENCV_VA_INTEL_SAMPLES_REQUIRED_DEPS}) ++ ocv_target_link_libraries(${tgt} ${OPENCV_LINKER_LIBS} ${OPENCV_VA_INTEL_SAMPLES_REQUIRED_DEPS} ${VA_LIBRARIES} ${VA_INTEL_LIBRARIES}) + endforeach() diff --git a/opencv-clean.sh b/opencv-clean.sh index d0543d3..636dab4 100755 --- a/opencv-clean.sh +++ b/opencv-clean.sh @@ -1,4 +1,4 @@ -export VERSION=3.3.1 +export VERSION=3.4.1 wget -c https://github.com/opencv/opencv/archive/${VERSION}/opencv-${VERSION}.tar.gz tar xf opencv-${VERSION}.tar.gz diff --git a/opencv.spec b/opencv.spec index b758fa3..a263c0f 100644 --- a/opencv.spec +++ b/opencv.spec @@ -29,16 +29,15 @@ #VTK support disabled. Incompatible combination: OpenCV + Qt5 and VTK ver.7.1.1 + Qt4 %bcond_with vtk %ifarch %{ix86} x86_64 -#disabled for now, maybe for opencv 3.4 -%bcond_with mfx +%bcond_without libmfx %else -%bcond_with mfx +%bcond_with libmfx %endif %bcond_without clp -%bcond_without va +%bcond_with va %global srcname opencv -%global abiver 3.3 +%global abiver 3.4 # Required because opencv-core has lot of spurious dependencies # (despite supposed to be "-core") @@ -47,8 +46,8 @@ %global optflags %(echo %{optflags} -Wl,--as-needed ) Name: opencv -Version: 3.3.1 -Release: 8%{?dist} +Version: 3.4.1 +Release: 1%{?dist} Summary: Collection of algorithms for computer vision # This is normal three clause BSD. License: BSD @@ -62,13 +61,8 @@ Source0: %{name}-clean-%{version}.tar.gz Source1: %{name}_contrib-clean-%{version}.tar.gz # fix/simplify cmake config install location (upstreamable) # https://bugzilla.redhat.com/1031312 -Patch1: opencv-3.2.0-cmake_paths.patch -Patch2: opencv-3.1-pillow.patch -# Backport patch, update OpenBLAS support -# https://github.com/opencv/opencv/pull/9955 -# https://github.com/opencv/opencv/commit/476c513447eb16784113e982f6bef0dcabb77732.patch -Patch50: 476c513447eb16784113e982f6bef0dcabb77732.patch - +Patch1: opencv-3.4.1-cmake_paths.patch +Patch2: opencv-3.4.1-cmake_va_intel_fix.patch BuildRequires: libtool BuildRequires: cmake >= 2.6.3 BuildRequires: chrpath @@ -123,6 +117,7 @@ BuildRequires: protobuf-devel BuildRequires: gdal-devel BuildRequires: glog-devel BuildRequires: doxygen +BuildRequires: python-beautifulsoup4 #for doc/doxygen/bib2xhtml.pl BuildRequires: perl-open BuildRequires: gflags-devel @@ -140,22 +135,18 @@ BuildRequires: hdf5-devel BuildRequires: ceres-solver-devel } } -#BuildRequires: plantuml %{?with_openblas: BuildRequires: openblas-devel BuildRequires: blas-devel BuildRequires: lapack-devel -#BuildRequires: blas64-devel -#BuildRequires: lapack64-devel -#BuildRequires: torch-devel (retired) } %{?with_gdcm:BuildRequires: gdcm-devel} -%{?with_mfx:BuildRequires: libmfx-devel} +%{?with_libmfx:BuildRequires: libmfx-devel} %{?with_clp:BuildRequires: coin-or-Clp-devel} %{?with_va:BuildRequires: libva-devel} Requires: opencv-core%{_isa} = %{version}-%{release} -Requires: gcc, gcc-c++ +BuildRequires: gcc, gcc-c++ %description OpenCV means Intel® Open Source Computer Vision Library. It is a collection of @@ -237,14 +228,11 @@ to provide decent performance and stability. rm -rf 3rdparty/ # missing dependecies for dnn module in Fedora (protobuf-cpp) rm -rf modules/dnn/ - %patch1 -p1 -b .cmake_paths -%patch50 -p1 -b .openblas - +%patch2 -p1 pushd %{name}_contrib-%{version} # missing dependecies for dnn_modern module in Fedora (tiny-dnn) rm -rf modules/dnn_modern/ -%patch2 -p1 -b .pillow popd # fix dos end of lines @@ -288,12 +276,13 @@ pushd build -DINSTALL_C_EXAMPLES=ON \ -DINSTALL_PYTHON_EXAMPLES=ON \ -DENABLE_PYLINT=ON \ - -DOPENCL_INCLUDE_DIR=${_includedir}/CL \ + -DBUILD_PROTOBUF=OFF \ -DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib-%{version}/modules \ -DWITH_LIBV4L=ON \ -DWITH_OPENMP=ON \ + -DENABLE_PKG_CONFIG=OFF \ %{?with_gdcm: -DWITH_GDCM=ON } \ - %{?with_mfx: -DWITH_MFX=ON } \ + %{?with_libmfx: -DWITH_MFX=ON } \ %{?with_clp: -DWITH_CLP=ON } \ %{?with_va: -DWITH_VA=ON } \ .. @@ -338,8 +327,10 @@ popd %files core %{_libdir}/libopencv_core.so.%{abiver}* +%{_libdir}/libopencv_cvv.so.%{abiver}* %{_libdir}/libopencv_features2d.so.%{abiver}* %{_libdir}/libopencv_flann.so.%{abiver}* +%{_libdir}/libopencv_hfs.so.%{abiver}* %{_libdir}/libopencv_highgui.so.%{abiver}* %{_libdir}/libopencv_imgcodecs.so.%{abiver}* %{_libdir}/libopencv_imgproc.so.%{abiver}* @@ -352,7 +343,6 @@ popd %{_libdir}/libopencv_video.so.%{abiver}* %{_libdir}/libopencv_videoio.so.%{abiver}* %{_libdir}/libopencv_videostab.so.%{abiver}* -%{_libdir}/libopencv_cvv.so.%{abiver}* %files devel %{_includedir}/opencv @@ -378,7 +368,7 @@ popd %{_libdir}/libopencv_calib3d.so.%{abiver}* %{_libdir}/libopencv_ccalib.so.%{abiver}* #Module opencv_datasets disabled because opencv_text dependency can't be resolved! -#{_libdir}/libopencv_datasets.so.%%{abiver}* +{_libdir}/libopencv_datasets.so.%%{abiver}* # Disabled because of missing dependency package in fedora (protobuf-cpp) #{_libdir}/libopencv_dnn.so.%%{abiver}* %{_libdir}/libopencv_dpm.so.%{abiver}* @@ -405,10 +395,11 @@ popd %{_libdir}/libopencv_xphoto.so.%{abiver}* %changelog -* Thu Mar 01 2018 Josef Ridky - 3.3.1-8 +* Thu Mar 01 2018 Josef Ridky - 3.4.1-1 - Spec clean up (remove Group tag, add ldconfig scriptlets, escape macros in comments) - Remove unused patch - Add gcc and gcc-c++ requirements +- Rebase to version 3.4.1 * Sun Feb 18 2018 Sérgio Basto - 3.3.1-7 - Rebuild for gdcm-2.8 diff --git a/sources b/sources index b3b70fd..05f2ac2 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (opencv_contrib-clean-3.3.1.tar.gz) = a5473dfd1bfa443c8569a451dc6c5de27a02723e58288ce1f6fd88414c6c2919f5847aae711551b3aff5918e15cd7199dbc465df99f2b4b9af31034b9a5f7a6e -SHA512 (opencv-clean-3.3.1.tar.gz) = e262183437e2729f0926176dd1e16b9c13697ef03f4cc4d06c84566b6dc368f3575add29844bd49af386bcef3f4e654fde7a6e97aed2d657b6ae6d5218fe10b9 +SHA512 (opencv_contrib-clean-3.4.1.tar.gz) = 1bdd54f3f48a268a1099a91456415af86ef2d449ef547ac14447cf5fcc6af84561e76f183b6124ecc638a8b80b312909521a4c9b5d9e7f3ed544d99acfe9cc96 +SHA512 (opencv-clean-3.4.1.tar.gz) = d73038400cafe9f03eab27f3ec79f0cf42930603727d8682d45853bf1165aa62e5fde77e56e8ca73ae65096bf3c6b5dff0780994bc7d67414657f2e027eb8f8a