Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package opencv for openSUSE:Factory checked in at 2024-02-05 22:01:31 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/opencv (Old) and /work/SRC/openSUSE:Factory/.opencv.new.1815 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "opencv" Mon Feb 5 22:01:31 2024 rev:101 rq:1144110 version:4.9.0 Changes: -------- --- /work/SRC/openSUSE:Factory/opencv/opencv.changes 2024-01-19 23:03:15.644365283 +0100 +++ /work/SRC/openSUSE:Factory/.opencv.new.1815/opencv.changes 2024-02-05 22:01:43.684157698 +0100 @@ -1,0 +2,6 @@ +Fri Jan 19 20:01:43 UTC 2024 - Axel Braun <[email protected]> + +- Add %{?sle15allpythons} and build python bindings for all + configured versions (also for Tumbleweed) + +------------------------------------------------------------------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ opencv.spec ++++++ --- /var/tmp/diff_new_pack.d0OzVD/_old 2024-02-05 22:01:44.732195613 +0100 +++ /var/tmp/diff_new_pack.d0OzVD/_new 2024-02-05 22:01:44.732195613 +0100 @@ -29,6 +29,11 @@ %bcond_without ffmpeg %bcond_without python3 %bcond_without openblas +%if %{with python3} +# Enable python311 for SLE15 in addition to the regular python3 which is python 3.6 +%{?sle15allpythons} +%endif + Name: opencv Version: 4.9.0 Release: 0 @@ -73,8 +78,11 @@ %endif %if %{with python3} BuildRequires: python-rpm-macros -BuildRequires: python3-numpy-devel -BuildRequires: pkgconfig(python3) +BuildRequires: %{python_module numpy-devel} +BuildRequires: %{python_module devel} +BuildRequires: %{python_module setuptools} +%else +BuildRequires: python3-base %endif BuildRequires: pkgconfig(Qt5Concurrent) >= 5.2.0 BuildRequires: pkgconfig(Qt5Gui) >= 5.2.0 @@ -87,6 +95,18 @@ BuildRequires: pkgconfig(libavutil) BuildRequires: pkgconfig(libswscale) %endif +%if %{with python3} +%if "%pythons" != "python3" +# For Tumbleweed and SLE15 with activated multiflavor +%define python_subpackage_only 1 +%python_subpackages +%else +# For old SLE15 with only python3 and possibly old python-rpm-macros +%define python_sitearch %python3_sitearch +%define python_files() -n python3-%{**} +%endif +%endif + %description OpenCV means Intel Open Source Computer Vision Library. It is a collection of C @@ -236,6 +256,20 @@ documentation. It should be installed if you want to develop programs that will use the OpenCV library. +%if 0%{?python_subpackage_only} +%package -n python-%{name} +Summary: Python %{python_version} bindings for apps which use OpenCV +License: BSD-3-Clause +Group: Development/Libraries/Python +%if "%{python_flavor}" == "python3" || "%{python_provides}" == "python3" +Provides: python-%{name}-qt5 = %{version} +Obsoletes: python-%{name}-qt5 < %{version} +%endif + +%description -n python-%{name} +This package contains Python %{python_version} bindings for the OpenCV library. +%else + %package -n python3-%{name} Summary: Python 3 bindings for apps which use OpenCV License: BSD-3-Clause @@ -245,6 +279,7 @@ %description -n python3-%{name} This package contains Python 3 bindings for the OpenCV library. +%endif %package doc Summary: Documentation and examples for OpenCV @@ -280,6 +315,7 @@ # x86: disable SSE on 32bit, do not dispatch AVX and later - SSE3 # is the highest extension available on any non-64bit x86 CPU # ARM: ARMv6, e.g. RPi1, only has VFPv2 +pushd $PWD %cmake \ -DCMAKE_BUILD_TYPE=Release \ -DBUILD_WITH_DEBUG_INFO=ON \ @@ -325,17 +361,54 @@ -DCPU_BASELINE=NEON \ -DCPU_DISPATCH=FP16 \ %endif - -DPYTHON_DEFAULT_EXECUTABLE=%{_bindir}/python3 \ +%if %{with python3} -DOPENCV_SKIP_PYTHON_LOADER=ON \ + -DOPENCV_PYTHON3_VERSION=%{python3_version} \ -DOPENCV_PYTHON3_INSTALL_PATH=%{python3_sitearch} \ +%else + -DBUILD_opencv_python3=OFF \ +%endif + -DPYTHON_DEFAULT_EXECUTABLE=%{_bindir}/python3 \ -DOPENCV_DOWNLOAD_TRIES_LIST:STRING="" \ -DWITH_JASPER=OFF \ %{nil} %cmake_build +popd + +%if %{with python3} +mkdir pythonbuilds +pushd pythonbuilds +%define __sourcedir ../modules/python +%{python_expand # Build all non-primary flavors (if any) "standalone". +# cmake takes most of the config defined from +# $(OpenCV_BINARY_DIR)/opencv_python_config.cmake written during the main build. +if [ "py%{$python_version}" != "py%{python3_version}" ]; then + pushd $PWD + %cmake \ + -DOpenCV_BINARY_DIR=../../build/ \ + -DOPENCV_SKIP_PYTHON_LOADER=ON \ + -DOPENCV_PYTHON_VERSION=%{$python_version} \ + -DOPENCV_PYTHON_STANDALONE_INSTALL_PATH=%{$python_sitearch} \ + %{nil} + %cmake_build + popd +fi +} +popd +%endif %install %cmake_install +%if %{with python3} +pushd pythonbuilds +%{python_expand # +if [ "py%{$python_version}" != "py%{python3_version}" ]; then + %cmake_install +fi +} +popd +%endif mkdir -p %{buildroot}%{_docdir}/%{name}-doc mv %{buildroot}%{_datadir}/opencv4/samples %{buildroot}%{_docdir}/%{name}-doc/examples @@ -461,9 +534,9 @@ %{_datadir}/opencv4/valgrind* %if %{with python3} -%files -n python3-%{name} +%files %{python_files %{name}} %license LICENSE LICENSE.contrib -%{python3_sitearch}/cv2.%{py3_soflags}.so +%{python_sitearch}/cv2.*.so %endif %files doc
