diff --git a/download b/download deleted file mode 100644 index d09607f15f013b0c8d8b573889150e125f2308ee..0000000000000000000000000000000000000000 --- a/download +++ /dev/null @@ -1,3 +0,0 @@ -7505c44ca4eb54b4ab1e4777cb96ac05 face_landmark_model.dat -0f084dfef743cb4906e421992b42b578 opencv-clean-4.7.0.tar.gz -14454b0ca83fe0506b0a0c35a9dc7891 opencv_contrib-clean-4.7.0.tar.gz diff --git a/face_landmark_model.dat.xz b/face_landmark_model.dat.xz new file mode 100644 index 0000000000000000000000000000000000000000..b66a21034c37dfaa721e5bfb9e7680245af798f9 Binary files /dev/null and b/face_landmark_model.dat.xz differ diff --git a/opencv-clean-4.8.0.tar.gz b/opencv-clean-4.8.0.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..c86f90f4a5c9a8926531896d997255d8e9525569 Binary files /dev/null and b/opencv-clean-4.8.0.tar.gz differ diff --git a/opencv-clean.sh b/opencv-clean.sh deleted file mode 100644 index ffe18877d5e9e054543fd3d2b62c168bdd111745..0000000000000000000000000000000000000000 --- a/opencv-clean.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash - -VERSION=4.7.0 - -wget -c https://github.com/opencv/opencv/archive/${VERSION}/opencv-${VERSION}.tar.gz -wget -c https://github.com/opencv/opencv_contrib/archive/${VERSION}/opencv_contrib-${VERSION}.tar.gz -wget -c https://github.com/opencv/opencv_extra/archive/${VERSION}/opencv_extra-${VERSION}.tar.gz - -rm -rf opencv-${VERSION}/ -tar xf opencv-${VERSION}.tar.gz -find opencv-${VERSION}/ -iname "*lena*" -exec rm {} ';' -print -find opencv-${VERSION}/ -iname "*lenna*" -exec rm {} ';' -print -rm -r opencv-${VERSION}/modules/xfeatures2d/ -tar zcf opencv-clean-${VERSION}.tar.gz opencv-${VERSION}/ -rm -r opencv-${VERSION}/ - -rm -rf opencv_contrib-${VERSION}/ -tar xf opencv_contrib-${VERSION}.tar.gz -find opencv_contrib-${VERSION}/ -iname "*lena*" -exec rm {} ';' -print -find opencv_contrib-${VERSION}/ -iname "*lenna*" -exec rm {} ';' -print -rm -r opencv_contrib-${VERSION}/modules/xfeatures2d/ -tar zcf opencv_contrib-clean-${VERSION}.tar.gz opencv_contrib-${VERSION}/ -rm -r opencv_contrib-${VERSION}/ - -rm -rf opencv_extra-${VERSION}/ -tar xf opencv_extra-${VERSION}.tar.gz -find opencv_extra-${VERSION} -iname "*lena*" -exec rm {} ';' -print -find opencv_extra-${VERSION} -iname "*lenna*" -exec rm {} ';' -print -find opencv_extra-${VERSION} \( -iname "len*.*" -o -iname "*lena*.png" -o -iname "*lena*.jpg" \) -exec rm {} ';' -print -tar zcf opencv_extra-clean-${VERSION}.tar.gz opencv_extra-${VERSION}/ -rm -r opencv_extra-${VERSION}/ diff --git a/opencv.spec b/opencv.spec index 09d9e95d5e2e04f3fd47976f0a494764e8a41c82..db3c4d204ecd7c3c300b7f58bc55ca9f9caab76d 100644 --- a/opencv.spec +++ b/opencv.spec @@ -1,12 +1,13 @@ -%define anolis_release 11 +%define anolis_release 1 %undefine __cmake_in_source_build %bcond_with tests %if %{without tests} %bcond_with extras_tests %else -%bcond_with extras_tests +%bcond_without extras_tests %endif +# linters are enabled by default if BUILD_DOCS OR BUILD_EXAMPLES %bcond_with linters %bcond_with ffmpeg %bcond_without gstreamer @@ -44,7 +45,7 @@ %endif Name: opencv -Version: 4.7.0 +Version: 4.8.0 %global javaver %(foo=%{version}; echo ${foo//./}) %global majorver %(foo=%{version}; a=(${foo//./ }); echo ${a[0]} ) %global minorver %(foo=%{version}; a=(${foo//./ }); echo ${a[1]} ) @@ -53,25 +54,33 @@ Version: 4.7.0 Release: %{anolis_release}%{?dist} Summary: Collection of algorithms for computer vision # This is normal three clause BSD. -License: BSD +License: BSD-3-Clause and Apache-2.0 and ISC URL: https://opencv.org - -# Need to remove copyrighted lena.jpg images +# Edit opencv-clean.sh and set VERSION, save file and run opencv-clean.sh +# +# Need to remove copyrighted lena.jpg images (rhbz#1295173) # and SIFT/SURF (module xfeatures2d) from tarball, due to legal concerns. -# tarballs generated by opencv-clean.sh +# Source0: %{name}-clean-%{version}.tar.gz Source1: %{name}_contrib-clean-%{version}.tar.gz %{?with_extras_tests: Source2: %{name}_extra-clean-%{version}.tar.gz } -Source3: https://github.com/opencv/opencv_3rdparty/raw/contrib_face_alignment_20170818/face_landmark_model.dat -Source4: https://github.com/opencv/ade/archive/v0.1.2a.zip#/fa4b3e25167319cb0fa9432ef8281945-v0.1.2a.zip +Source3: face_landmark_model.dat.xz +# from https://github.com/opencv/ade/archive/v0.1.2a.zip +# mv v0.1.2a.zip $(md5sum v0.1.2a.zip | cut -d' ' -f1)-v0.1.2a.zip +Source4: fa4b3e25167319cb0fa9432ef8281945-v0.1.2a.zip Source5: xorg.conf -Source6: opencv-clean.sh +%global wechat_commit 3487ef7cde71d93c6a01bb0b84aa0f22c6128f6b +%global wechat_shortcommit %(c=%{wechat_commit}; echo ${c:0:7}) +%global wechat_gitdate 20230712 +Source6: https://github.com/WeChatCV/opencv_3rdparty/archive/%{wechat_commit}/wechat-%{wechat_gitdate}.git%{wechat_shortcommit}.tar.gz Patch0: opencv-4.1.0-install_3rdparty_licenses.patch Patch3: opencv.python.patch +ExcludeArch: loongarch64 + BuildRequires: gcc-c++ BuildRequires: cmake >= 2.6.3 BuildRequires: chrpath @@ -146,7 +155,7 @@ BuildRequires: blas-devel BuildRequires: lapack-devel } %{?with_gdcm:BuildRequires: gdcm-devel} -%{?with_libmfx:BuildRequires: libmfx-devel} +%{?with_libmfx:BuildRequires: oneVPL-devel} %{?with_clp:BuildRequires: coin-or-Clp-devel} %{?with_va:BuildRequires: libva-devel} %{?with_java: @@ -191,6 +200,8 @@ package. %package doc Summary: Documentation files Requires: opencv-devel = %{version}-%{release} +# Doc dependes on architecture, specifically whether the va_intel sample is installed depends on HAVE_VA +# BuildArch: noarch Provides: %{name}-devel-docs = %{version}-%{release} Obsoletes: %{name}-devel-docs < %{version}-%{release} @@ -229,14 +240,15 @@ distribution, since the library maintains binary compatibility, and tries to provide decent performance and stability. %prep -%setup -q -a1 %{?with_extras_tests:-a2} -%if 1 +%setup -q -a1 %{?with_extras_tests:-a2} -a6 + +# we don't use pre-built contribs except quirc pushd 3rdparty shopt -s extglob -rm -r !(openvx|quirc) +#rm -r !(openexr|openvx|quirc) +rm -r !(openvx|quirc|flatbuffers) shopt -u extglob popd &>/dev/null -%endif %patch -P 0 -p1 -b .install_3rdparty_licenses %patch -P 3 -p1 -b .python_install_binary @@ -247,15 +259,26 @@ popd # Install face_landmark_model mkdir -p .cache/data -install -pm 0644 %{SOURCE3} .cache/data +install -pm 0644 %{S:3} .cache/data pushd .cache/data + xz -d face_landmark_model.dat.xz mv face_landmark_model.dat 7505c44ca4eb54b4ab1e4777cb96ac05-face_landmark_model.dat popd +mkdir -p .cache/wechat_qrcode +mv opencv_3rdparty-%{wechat_commit}/detect.caffemodel .cache/wechat_qrcode/238e2b2d6f3c18d6c3a30de0c31e23cf-detect.caffemodel +mv opencv_3rdparty-%{wechat_commit}/detect.prototxt .cache/wechat_qrcode/6fb4976b32695f9f5c6305c19f12537d-detect.prototxt +mv opencv_3rdparty-%{wechat_commit}/sr.caffemodel .cache/wechat_qrcode/cbfcd60361a73beb8c583eea7e8e6664-sr.caffemodel +mv opencv_3rdparty-%{wechat_commit}/sr.prototxt .cache/wechat_qrcode/69db99927a70df953b471daaba03fbef-sr.prototxt +# Install ADE, needed for opencv_gapi mkdir -p .cache/ade -install -pm 0644 %{SOURCE4} .cache/ade/ +install -pm 0644 %{S:4} .cache/ade/ %build +# enabled by default if libraries are presents at build time: +# GTK, GSTREAMER, 1394, V4L, eigen3 +# non available on Fedora: FFMPEG, XINE +# disabling IPP because it is closed source library from intel %cmake \ -DCV_TRACE=OFF \ @@ -274,7 +297,7 @@ install -pm 0644 %{SOURCE4} .cache/ade/ %ifarch x86_64 %{ix86} -DCPU_BASELINE=SSE2 \ %endif - -DCMAKE_BUILD_TYPE=ReleaseWithDebInfo \ + -DCMAKE_BUILD_TYPE=Release \ %{?with_java: -DBUILD_opencv_java=ON \ -DOPENCV_JAR_INSTALL_PATH=%{_jnidir} } \ %{!?with_java: -DBUILD_opencv_java=OFF } \ @@ -305,7 +328,7 @@ install -pm 0644 %{SOURCE4} .cache/ade/ } \ -DBUILD_PROTOBUF=OFF \ -DPROTOBUF_UPDATE_FILES=ON \ -%{?with_opencl: -DOPENCL_INCLUDE_DIR=%{_includedir}/CL } \ +%{?with_opencl: -DOPENCL_INCLUDE_DIR=%{_includedir}/CL -DOPENCV_DNN_OPENCL=ON} \ %{!?with_opencl: -DWITH_OPENCL=OFF } \ -DOPENCV_EXTRA_MODULES_PATH=opencv_contrib-%{version}/modules \ -DWITH_LIBV4L=ON \ @@ -314,7 +337,7 @@ install -pm 0644 %{SOURCE4} .cache/ade/ -DOPENCV_GENERATE_PKGCONFIG=ON \ %{?with_extras_tests: -DOPENCV_TEST_DATA_PATH=opencv_extra-%{version}/testdata} \ %{?with_gdcm: -DWITH_GDCM=ON } \ - %{?with_libmfx: -DWITH_MFX=ON } \ + %{?with_libmfx: -DWITH_MFX=ON -DWITH_GAPI_ONEVPL=ON} \ %{?with_clp: -DWITH_CLP=ON } \ %{?with_va: -DWITH_VA=ON } \ %{!?with_vtk: -DWITH_VTK=OFF} \ @@ -340,6 +363,23 @@ ln -s -r %{buildroot}%{_jnidir}/opencv-%{javaver}.jar %{buildroot}%{_jnidir}/ope } +%check +#ifnarch ppc64 +%if %{with tests} + cp %{S:5} %{__cmake_builddir} + if [ -x /usr/libexec/Xorg ]; then + Xorg=/usr/libexec/Xorg + else + Xorg=/usr/libexec/Xorg.bin + fi + $Xorg -noreset +extension GLX +extension RANDR +extension RENDER -logfile ./xorg.log -config ./xorg.conf -configdir . :99 & + export DISPLAY=:99 + export LD_LIBRARY_PATH=%{_builddir}/%{name}-%{version}/%{__cmake_builddir}/lib:$LD_LIBARY_PATH + %ctest || : +%endif +#endif + + %files %doc README.md %{_bindir}/opencv_* @@ -397,7 +437,7 @@ ln -s -r %{buildroot}%{_jnidir}/opencv-%{javaver}.jar %{buildroot}%{_jnidir}/ope %{_libdir}/libopencv_alphamat.so.{%{abiver},%{version}} %{_libdir}/libopencv_aruco.so.{%{abiver},%{version}} %{_libdir}/libopencv_bgsegm.so.{%{abiver},%{version}} -%{_libdir}/libopencv_barcode.so.{%{abiver},%{version}} +#%%{_libdir}/libopencv_barcode.so.{#%%{abiver},#%%{version}} %{_libdir}/libopencv_bioinspired.so.{%{abiver},%{version}} %{_libdir}/libopencv_ccalib.so.{%{abiver},%{version}} %{?with_cuda: @@ -443,6 +483,9 @@ ln -s -r %{buildroot}%{_jnidir}/opencv-%{javaver}.jar %{buildroot}%{_jnidir}/ope %{_libdir}/libopencv_xphoto.so.{%{abiver},%{version}} %changelog +* Mon Jun 03 2024 mgb01105731 - 4.8.0-1 +- Update to 4.8.0 + * Mon Feb 19 2024 zhongling.h - 4.7.0-11 - rebuild with tbb-2021.11.0 diff --git a/opencv_contrib-clean-4.8.0.tar.gz b/opencv_contrib-clean-4.8.0.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..624126c3c7a5711652f54f574d6e0a7eb707ca0c Binary files /dev/null and b/opencv_contrib-clean-4.8.0.tar.gz differ diff --git a/wechat-20230712.git3487ef7.tar.gz b/wechat-20230712.git3487ef7.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..c962f46290161ae2d6b220e25cb74508a3d46099 Binary files /dev/null and b/wechat-20230712.git3487ef7.tar.gz differ