public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Federico Pellegrin <fede@evolware.org>
To: git-commits@fedoraproject.org
Subject: [rpms/opencv] opencv5: Fix importing of Python module (#2406800)
Date: Fri, 28 Aug 2026 13:33:13 GMT	[thread overview]
Message-ID: <178792399306.1.12145515315770558350.rpms-opencv-1aebdc2c48cd@fedoraproject.org> (raw)

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
 

                 reply	other threads:[~2026-08-28 13:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178792399306.1.12145515315770558350.rpms-opencv-1aebdc2c48cd@fedoraproject.org \
    --to=fede@evolware.org \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox