From feee2b1ca875ab0d3c8fb8a83e8f5f310c28d809 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20M=2E=20Basto?= Date: Thu, 14 Apr 2022 15:38:25 +0100 Subject: [PATCH] Switch to new Python loader, doesn't fix rhbz #2054951 but can be a step --- opencv.python.patch | 11 +++++++++++ opencv.spec | 10 +++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 opencv.python.patch diff --git a/opencv.python.patch b/opencv.python.patch new file mode 100644 index 0000000..afe9b11 --- /dev/null +++ b/opencv.python.patch @@ -0,0 +1,11 @@ +--- opencv-4.5.5/modules/python/common.cmake.orig 2022-04-11 18:40:18.925266930 +0100 ++++ opencv-4.5.5/modules/python/common.cmake 2022-04-11 18:42:17.753849346 +0100 +@@ -179,7 +179,7 @@ else() + else() + set(__python_binary_subdir "python-${${PYTHON}_VERSION_MAJOR}.${${PYTHON}_VERSION_MINOR}") + endif() +- set(__python_binary_install_path "${OPENCV_PYTHON_INSTALL_PATH}/${__python_loader_subdir}${__python_binary_subdir}") ++ set(__python_binary_install_path "${OPENCV_PYTHON_INSTALL_PATH}/${__python_loader_subdir}") + endif() + + install(TARGETS ${the_module} diff --git a/opencv.spec b/opencv.spec index 1ce865b..d80cd57 100644 --- a/opencv.spec +++ b/opencv.spec @@ -51,7 +51,7 @@ Name: opencv Version: 4.5.5 %global javaver %(foo=%{version}; echo ${foo//./}) %global abiver %(foo=%{version}; echo ${foo:0:3}) -Release: 6%{?dist} +Release: 7%{?dist} Summary: Collection of algorithms for computer vision # This is normal three clause BSD. License: BSD @@ -75,6 +75,7 @@ Source5: xorg.conf Patch0: opencv-4.1.0-install_3rdparty_licenses.patch Patch1: https://github.com/opencv/opencv/commit/81a6d1b0d4d93a3330cc99fbb1601c90b9516a9c.patch Patch2: https://github.com/opencv/opencv/commit/8d88bb06b230b5c4b5bca78d84102f5d1adf48cf.patch +Patch3: opencv.python.patch BuildRequires: gcc-c++ BuildRequires: cmake >= 2.6.3 @@ -256,6 +257,7 @@ popd &>/dev/null %patch0 -p1 -b .install_3rdparty_licenses %patch1 -p1 -R -b .soversion %patch2 -p1 -b .ppc64le_builtin_altivec_vadub +%patch3 -p1 -b .python_install_binary pushd %{name}_contrib-%{version} #patch1 -p1 -b .install_cvv @@ -328,7 +330,6 @@ install -pm 0644 %{SOURCE4} .cache/ade/ -DPROTOBUF_UPDATE_FILES=ON \ %{?with_opencl: -DOPENCL_INCLUDE_DIR=%{_includedir}/CL } \ %{!?with_opencl: -DWITH_OPENCL=OFF } \ - -DOPENCV_SKIP_PYTHON_LOADER=ON \ -DOPENCV_EXTRA_MODULES_PATH=opencv_contrib-%{version}/modules \ -DWITH_LIBV4L=ON \ -DWITH_OPENMP=ON \ @@ -427,7 +428,7 @@ ln -s -r %{buildroot}%{_jnidir}/opencv-%{javaver}.jar %{buildroot}%{_jnidir}/ope %{_datadir}/opencv4/samples %files -n python3-opencv -%{python3_sitearch}/cv2.cpython-3*.so +%{python3_sitearch}/cv2 %if %{with java} %files java @@ -487,6 +488,9 @@ ln -s -r %{buildroot}%{_jnidir}/opencv-%{javaver}.jar %{buildroot}%{_jnidir}/ope %{_libdir}/libopencv_xphoto.so.%{abiver}* %changelog +* Sun Mar 20 2022 Sérgio Basto - 4.5.5-7 +- Switch to new Python loader, doesn't fix rhbz #2054951 but can be a step + * Thu Mar 10 2022 Sandro Mani - 4.5.5-6 - Rebuild for tesseract 5.1.0