diff mbox series

[meta-oe,wrynose] opencv: rewrite build-tree paths in all CPU-dispatch stub files

Message ID 20261027063302.2742839-1-primoz.fiser@norik.com
State Under Review
Delegated to: Anuj Mittal
Headers show
Series [meta-oe,wrynose] opencv: rewrite build-tree paths in all CPU-dispatch stub files | expand

Commit Message

Primoz Fiser Oct. 27, 2026, 6:33 a.m. UTC
The recipe already rewrote the absolute ${S} path embedded in two
PowerPC VSX3 dispatch stubs (arithm.vsx3.cpp, convert.vsx3.cpp) before
packaging, but OpenCV's cmake ocv_add_dispatched_file() macro generates
one such stub per enabled ISA in every module (avx, avx2, avx512_skx,
sse4_1, sse4_2, neon, ...). On NEON builds this produces further
dispatch stubs under ${B}/modules/dnn/* (layers_common.neon.cpp,
fast_gemm_kernels.neon.cpp, conv_block.neon.cpp) whose #include lines
still embed the raw build-tree path, tripping the buildpaths QA check
once copied verbatim into the opencv-src package.

Generalize the existing sed-based rewrite to find and fix every
generated dispatch stub under ${B}/modules, instead of a hardcoded
two-file list, so any ISA/module combination is covered.

Backport of commit fdfca71954f5 from the blacksail branch, with the
same fix applied to the still-current 4.13.0 recipe on wrynose.

Signed-off-by: Primoz Fiser <primoz.fiser@norik.com>
---
 meta-oe/recipes-support/opencv/opencv_4.13.0.bb | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/meta-oe/recipes-support/opencv/opencv_4.13.0.bb b/meta-oe/recipes-support/opencv/opencv_4.13.0.bb
index 981b06e33b4a..4891ad9a5abf 100644
--- a/meta-oe/recipes-support/opencv/opencv_4.13.0.bb
+++ b/meta-oe/recipes-support/opencv/opencv_4.13.0.bb
@@ -213,10 +213,8 @@  do_install:append() {
         rm -rf ${D}${bindir}/setup_vars_opencv4.sh
     fi
 
-    for fn in arithm.vsx3.cpp convert.vsx3.cpp; do
-        if [ -f ${B}/modules/core/$fn ]; then
-            sed -i -e 's,${S},/usr/src/debug/${PN}/${PV},g' ${B}/modules/core/$fn
-        fi
+    find ${B}/modules -name "*.cpp" | xargs -r grep -l "${S}" | while read -r fn; do
+        sed -i -e 's,${S},/usr/src/debug/${PN}/${PV},g' "$fn"
     done
 
     if [ -d ${D}/${bindir}/shape ]; then