public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/opencv] opencv5: Fix importing of Python module (#2406800)
@ 2026-08-28 13:33 Federico Pellegrin
  0 siblings, 0 replies; only message in thread
From: Federico Pellegrin @ 2026-08-28 13:33 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/opencv
Branch : opencv5
Commit : 1aebdc2c48cd8f620ee328115d57c266459b8b00
Author : Federico Pellegrin <fede@evolware.org>
Date   : 2025-10-30T20:26:11+01:00
Stats  : +13/-1 in 1 file(s)
URL    : https://src.fedoraproject.org/rpms/opencv/c/1aebdc2c48cd8f620ee328115d57c266459b8b00?branch=opencv5

Log:
Fix importing of Python module (#2406800)

---
diff --git a/opencv.spec b/opencv.spec
index 0c0f648..e9f24f4 100644
--- a/opencv.spec
+++ b/opencv.spec
@@ -75,7 +75,7 @@ Version:        4.11.0
 %global minorver %(foo=%{version}; a=(${foo//./ }); echo ${a[1]} )
 %global padding  %(digits=00; num=%{minorver}; echo ${digits:${#num}:${#digits}} )
 %global abiver   %(echo %{majorver}%{padding}%{minorver} )
-Release:        16%{?dist}
+Release:        17%{?dist}
 Summary:        Collection of algorithms for computer vision
 # This is normal three clause BSD.
 License:        BSD-3-Clause AND Apache-2.0 AND ISC
@@ -558,6 +558,10 @@ mkdir -p %{buildroot}/%{python3_sitearch}/cv2
 mv %{buildroot}/%{python3_sitelib}/cv2/cv2.cpython-*-linux-gnu.so \
   %{buildroot}/%{python3_sitearch}/cv2
 %endif
+# Correct reference in config-x.yz, keep build one for testing
+mkdir test_python
+cp %{buildroot}/%{python3_sitelib}/cv2/config-*.py test_python
+sed -i -e "s#/builddir[^']*#%{python3_sitearch}/cv2#g" %{buildroot}/%{python3_sitelib}/cv2/config-*.py
 
 rm -rf %{buildroot}%{_datadir}/OpenCV/licenses/
 %if %{with java}
@@ -573,7 +577,12 @@ ln -s -r %{buildroot}%{_jnidir}/opencv-%{javaver}.jar %{buildroot}%{_jnidir}/ope
 
 %check
 export LD_LIBRARY_PATH=%{_builddir}/%{name}-%{version}/%{__cmake_builddir}/lib:$LD_LIBARY_PATH
+# Due to complex import method, we need to point to builddir temporarily at least to have test working, undoing
+# the fix above and then removing this again
+cp %{buildroot}/%{python3_sitelib}/cv2/config-*.py .
+cp %{__cmake_builddir}/python_loader/test_python/config-*.py %{buildroot}/%{python3_sitelib}/cv2/
 %pyproject_check_import -e cv2.config
+cp config-*.py %{buildroot}/%{python3_sitelib}/cv2/
 
 #ifnarch ppc64
 %if %{with tests}
@@ -639,6 +648,9 @@ export LD_LIBRARY_PATH=%{_builddir}/%{name}-%{version}/%{__cmake_builddir}/lib:$
 
 
 %changelog
+* Wed Oct 29 2025 Federico Pellegrin <fede@evolware.org> - 4.11.0-17
+- Fix importing of Python module (#2406800)
+
 * Mon Oct 20 2025 Nicolas Chauvet <kwizart@gmail.com> - 4.11.0-16
 - Fix build with i686
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-08-28 13:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-28 13:33 [rpms/opencv] opencv5: Fix importing of Python module (#2406800) Federico Pellegrin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox