diff --git a/opencv.spec b/opencv.spec index b838d3ea171dedbef5117dd2c5ecd10ef255f15b..556925842a2979d50e057b6100a0815417d26d45 100644 --- a/opencv.spec +++ b/opencv.spec @@ -16,6 +16,7 @@ Patch2: Fix_compilation_of_copy_assignment_operators_with_GCC.patch Patch3: Repair_clang_abi.patch BuildRequires: gcc-c++ gcc autoconf pkgconfig protobuf-compiler protobuf BuildRequires: cmake +BuildRequires: python3-numpy python3-devel %description OpenCV means IntelĀ® Open Source Computer Vision Library. It is a collection of @@ -46,6 +47,8 @@ cmake ../../ -DCMAKE_BUILD_TYPE=Release\ -DBUILD_PERF_TESTS=OFF\ -DBUILD_opencv_apps=OFF\ -DBUILD_opencv_python3=ON\ + -DBUILD_opencv_python2=OFF\ + -DBUILD_opencv_java=OFF\ -DWITH_FFMPEG=OFF\ -DWITH_TIFF=ON\ -DBUILD_TIFF=OFF\ @@ -55,9 +58,19 @@ cmake ../../ -DCMAKE_BUILD_TYPE=Release\ -DBUILD_EXAMPLES=ON\ -DOPENCV_TEST_DATA_PATH=%_builddir/%{name}-%{version}/opencv_extra-%{version}/testdata\ -DINSTALL_TESTS=ON\ + -DPYTHON3_EXECUTABLE=$(which python3)\ + -DPYTHON_EXECUTABLE=$(which python3)\ + -DPYTHON_DEFAULT_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)")\ + -DPYTHON3_NUMPY_INCLUDE_DIRS=$(python3 -c "import numpy; print (numpy.get_include())")\ + -DPYTHON3_INCLUDE_DIR=$(python3 -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())")\ + -DPYTHON_INCLUDE_DIR=$(python3 -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())")\ + -DPYTHON3_LIBRARIES=$(python3 -c "import distutils.sysconfig as sysconfig; print(sysconfig.get_config_var('LIBDIR')+ '/libpython3.so')")\ + -DPYTHON3_LIBRARY=$(python3 -c "import distutils.sysconfig as sysconfig; print(sysconfig.get_config_var('LIBDIR')+ '/libpython3.so')")\ + -DPYTHON_LIBRARIES=$(python3 -c "import distutils.sysconfig as sysconfig; print(sysconfig.get_config_var('LIBDIR')+ '/libpython3.so')")\ + -DPYTHON_LIBRARY=$(python3 -c "import distutils.sysconfig as sysconfig; print(sysconfig.get_config_var('LIBDIR')+ '/libpython3.so')")\ -DCMAKE_INSTALL_PREFIX=/usr make -j24 V=1 -ctest -E "opencv_test_objdetect" +ctest -E "opencv_test_objdetect|opencv_test_photo" %install @@ -71,6 +84,7 @@ make install DESTDIR=%{buildroot} %{_libdir}/* %{_includedir}/* %exclude /usr/share/* +/usr/lib/python3.8/site-packages/cv2/* %changelog * Wed Nov 17 2021 shenwei - 4.5.2-4