!27 Fix tests failed & Add option to build DNN

From: @misaka00251 
Reviewed-by: @zhunaipan 
Signed-off-by: @zhunaipan
This commit is contained in:
openeuler-ci-bot 2023-05-23 06:58:45 +00:00 committed by Gitee
commit 03ac94a4a4
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -1,6 +1,6 @@
Name: opencv Name: opencv
Version: 4.5.2 Version: 4.5.2
Release: 7 Release: 8
Summary: OpenCV means Intel® Open Source Computer Vision Library. Summary: OpenCV means Intel® Open Source Computer Vision Library.
License: Apache-2.0 License: Apache-2.0
URL: https://github.com/opencv/opencv URL: https://github.com/opencv/opencv
@ -16,9 +16,14 @@ Patch2: Fix_compilation_of_copy_assignment_operators_with_GCC.patch
Patch3: Repair_clang_abi.patch Patch3: Repair_clang_abi.patch
Patch4: CVE-2022-0561_and_CVE-2022-0562.patch Patch4: CVE-2022-0561_and_CVE-2022-0562.patch
Patch5: CVE-2022-0908.patch Patch5: CVE-2022-0908.patch
BuildRequires: qt5-qtbase-devel
BuildRequires: gcc-c++ gcc autoconf pkgconfig protobuf-compiler protobuf BuildRequires: gcc-c++ gcc autoconf pkgconfig protobuf-compiler protobuf
BuildRequires: cmake BuildRequires: cmake
BuildRequires: python3-numpy python3-devel BuildRequires: python3-numpy python3-devel
BuildRequires: tesseract-devel
BuildRequires: mesa-libGLU-devel
BuildRequires: java-1.8.0-openjdk
%description %description
OpenCV means Intel® Open Source Computer Vision Library. It is a collection of OpenCV means Intel® Open Source Computer Vision Library. It is a collection of
@ -37,8 +42,8 @@ pwd
mkdir -p cmake/build mkdir -p cmake/build
cd cmake/build cd cmake/build
cmake ../../ -DCMAKE_BUILD_TYPE=Release\ cmake ../../ -DCMAKE_BUILD_TYPE=Release\
-DWITH_PROTOBUF=OFF\ -DWITH_PROTOBUF=ON\
-DWITH_WEBP=OFF\ -DWITH_WEBP=ON\
-DWITH_IPP=OFF\ -DWITH_IPP=OFF\
-DWITH_ADE=OFF\ -DWITH_ADE=OFF\
-DBUILD_ZLIB=ON\ -DBUILD_ZLIB=ON\
@ -48,11 +53,19 @@ cmake ../../ -DCMAKE_BUILD_TYPE=Release\
-DBUILD_TESTS=ON\ -DBUILD_TESTS=ON\
-DBUILD_PERF_TESTS=OFF\ -DBUILD_PERF_TESTS=OFF\
-DBUILD_opencv_apps=OFF\ -DBUILD_opencv_apps=OFF\
-DWITH_CUDA=OFF\
-DBUILD_JAVA=ON\
-DBUILD_opencv_dnn=ON\
-DBUILD_opencv_dnn_modern=ON\
-DBUILD_opencv_face=ON\
-DBUILD_opencv_python3=ON\ -DBUILD_opencv_python3=ON\
-DBUILD_opencv_python2=OFF\ -DBUILD_opencv_python2=OFF\
-DBUILD_opencv_java=OFF\ -DBUILD_opencv_java=ON\
-DWITH_GTK=OFF\
-DWITH_OPENGL=ON\
-DWITH_FFMPEG=OFF\ -DWITH_FFMPEG=OFF\
-DWITH_TIFF=ON\ -DWITH_TIFF=ON\
-DWITH_QT=5\
-DBUILD_TIFF=OFF\ -DBUILD_TIFF=OFF\
-DWITH_JASPER=OFF\ -DWITH_JASPER=OFF\
-DBUILD_JASPER=OFF\ -DBUILD_JASPER=OFF\
@ -74,7 +87,7 @@ cmake ../../ -DCMAKE_BUILD_TYPE=Release\
-DOPENCV_CONFIG_INSTALL_PATH=%{_lib}/cmake/OpenCV \ -DOPENCV_CONFIG_INSTALL_PATH=%{_lib}/cmake/OpenCV \
-DOPENCV_GENERATE_PKGCONFIG=ON -DOPENCV_GENERATE_PKGCONFIG=ON
make -j24 V=1 make -j24 V=1
ctest -E "opencv_test_objdetect|opencv_test_photo" ctest -E "opencv_test_objdetect|opencv_test_photo|opencv_test_highgui"
%install %install
@ -91,6 +104,10 @@ make install DESTDIR=%{buildroot}
%{python3_sitelib}/cv2/* %{python3_sitelib}/cv2/*
%changelog %changelog
* Sat May 06 2023 misaka00251 <liuxin@iscas.ac.cn> - 4.5.2-8
- Fix tests failed
- Add option to build DNN
* Thu Nov 05 2022 shenwei <shenwei41@huawei.com> - 4.5.2-7 * Thu Nov 05 2022 shenwei <shenwei41@huawei.com> - 4.5.2-7
- fix three cve bug of the opencv - fix three cve bug of the opencv