From c1b0305054cd6211d75a1363c3f15823bbfaaae9 Mon Sep 17 00:00:00 2001 From: Nicolas Chauvet Date: Sat, 18 Jan 2020 12:00:17 +0100 Subject: [PATCH] Enable GAPI --- opencv.spec | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/opencv.spec b/opencv.spec index 0328d5c..2cfce38 100644 --- a/opencv.spec +++ b/opencv.spec @@ -73,6 +73,7 @@ URL: https://opencv.org Source0: %{name}-clean-%{version}.tar.gz Source1: %{name}_contrib-clean-%{version}.tar.gz Source3: face_landmark_model.dat.xz +Source4: b624b995ec9c439cbc2e9e6ee940d3a2-v0.1.1f.zip Patch0: opencv-4.1.0-install_3rdparty_licenses.patch @@ -240,17 +241,25 @@ to provide decent performance and stability. %prep %setup -q -a1 +%if 1 # we don't use pre-built contribs except quirc -mv 3rdparty/quirc/ . -rm -r 3rdparty/ -mkdir 3rdparty/ -mv quirc/ 3rdparty/ +pushd 3rdparty +shopt -s extglob +rm -r !(openexr|openvx|quirc) +shopt -u extglob +popd &>/dev/null +%endif %patch0 -p1 -b .install_3rdparty_licenses pushd %{name}_contrib-%{version} popd +# Install ADE, needed for opencv_gapi +mkdir -p .cache/ade +install -pm 0644 %{SOURCE4} .cache/ade/ + + %build # enabled by default if libraries are presents at build time: # GTK, GSTREAMER, 1394, V4L, eigen3 @@ -273,6 +282,7 @@ popd -DWITH_OPENGL=ON \ -DOpenGL_GL_PREFERENCE=GLVND \ -DWITH_GDAL=ON \ + -DWITH_OPENEXR=ON \ -DWITH_UNICAP=ON \ -DCMAKE_SKIP_RPATH=ON \ -DWITH_CAROTENE=OFF \ @@ -297,9 +307,9 @@ popd %{!?with_xine: -DWITH_XINE=OFF } \ -DBUILD_DOCS=ON \ -DBUILD_EXAMPLES=ON \ + -DBUILD_opencv_python2=OFF \ -DINSTALL_C_EXAMPLES=ON \ -DINSTALL_PYTHON_EXAMPLES=ON \ - -DPYTHON2_EXECUTABLE=false \ -DPYTHON3_EXECUTABLE=%{__python3} \ -DPYTHON3_PACKAGES_PATH=%{python3_sitearch} \ -DENABLE_PYLINT=ON \ @@ -379,6 +389,7 @@ popd %{_libdir}/libopencv_cvv.so.%{abiver}* %{_libdir}/libopencv_features2d.so.%{abiver}* %{_libdir}/libopencv_flann.so.%{abiver}* +%{_libdir}/libopencv_gapi.so.%{abiver}* %{_libdir}/libopencv_hfs.so.%{abiver}* %{_libdir}/libopencv_highgui.so.%{abiver}* %{_libdir}/libopencv_imgcodecs.so.%{abiver}* @@ -409,7 +420,7 @@ popd %{_datadir}/opencv4/samples %files -n python3-opencv -%{_bindir}/setup_vars_opencv4.sh +%exclude %{_bindir}/setup_vars_opencv4.sh %{python3_sitearch}/cv2.cpython-3*.so %if %{with java} @@ -426,7 +437,6 @@ popd %{_libdir}/libopencv_bioinspired.so.%{abiver}* %{_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_dnn.so.%{abiver}* %{_libdir}/libopencv_dnn_objdetect.so.%{abiver}*