Prevent host paths from getting into target packages. Also prevents
buildpaths warnings for files:

| File /usr/lib/libopenvino.so in package openvino-inference-engine contains 
reference to TMPDIR [buildpaths]
| File /usr/lib/python3.10/site-packages/openvino/inference_engine/ie_api.so in 
package openvino-inference-engine-python3 contains reference to TMPDIR 
[buildpaths]
| File 
/usr/src/debug/openvino-inference-engine/2022.1-r0/build/src/plugins/intel_cpu/cross-compiled/proposal_imp_disp.cpp
 in package openvino-inference-engine-src contains reference to TMPDIR

Signed-off-by: Anuj Mittal <[email protected]>
---
 .../opencv/files/cython-cmake.patch           | 19 +++++++++++++++++++
 .../openvino-inference-engine_2022.1.bb       |  8 ++++++++
 2 files changed, 27 insertions(+)
 create mode 100644 
dynamic-layers/openembedded-layer/recipes-support/opencv/files/cython-cmake.patch

diff --git 
a/dynamic-layers/openembedded-layer/recipes-support/opencv/files/cython-cmake.patch
 
b/dynamic-layers/openembedded-layer/recipes-support/opencv/files/cython-cmake.patch
new file mode 100644
index 00000000..45ed0d27
--- /dev/null
+++ 
b/dynamic-layers/openembedded-layer/recipes-support/opencv/files/cython-cmake.patch
@@ -0,0 +1,19 @@
+Change the working directory to source to workaround cython
+embedding absolute path to the pyx file in output.
+
+Upstream-Status: Inappropriate [OE build specific]
+Signed-off-by: Anuj Mittal <[email protected]>
+
+diff --git 
a/src/bindings/python/src/compatibility/openvino/cmake/UseCython.cmake 
b/src/bindings/python/src/compatibility/openvino/cmake/UseCython.cmake
+index f14662ad50..8d199fe328 100644
+--- a/src/bindings/python/src/compatibility/openvino/cmake/UseCython.cmake
++++ b/src/bindings/python/src/compatibility/openvino/cmake/UseCython.cmake
+@@ -259,7 +259,7 @@ function( compile_pyx _name generated_file )
+   add_custom_command( OUTPUT ${_generated_file}
+     COMMAND ${CYTHON_EXECUTABLE}
+     ARGS ${cxx_arg} ${include_directory_arg} ${version_arg}
+-    ${annotate_arg} ${no_docstrings_arg} ${cython_debug_arg} ${CYTHON_FLAGS}
++    ${annotate_arg} ${no_docstrings_arg} ${cython_debug_arg} ${CYTHON_FLAGS} 
-w ${CMAKE_CURRENT_SOURCE_DIR}
+     --output-file  ${_generated_file} ${pyx_locations}
+     DEPENDS ${pyx_locations} ${pxd_dependencies} ${pxi_dependencies}
+     IMPLICIT_DEPENDS ${pyx_lang} ${c_header_dependencies}
diff --git 
a/dynamic-layers/openembedded-layer/recipes-support/opencv/openvino-inference-engine_2022.1.bb
 
b/dynamic-layers/openembedded-layer/recipes-support/opencv/openvino-inference-engine_2022.1.bb
index 5814380d..e4b0414b 100644
--- 
a/dynamic-layers/openembedded-layer/recipes-support/opencv/openvino-inference-engine_2022.1.bb
+++ 
b/dynamic-layers/openembedded-layer/recipes-support/opencv/openvino-inference-engine_2022.1.bb
@@ -17,6 +17,7 @@ SRC_URI = 
"git://github.com/openvinotoolkit/openvino.git;protocol=https;branch=r
            
git://github.com/openvinotoolkit/open_model_zoo.git;protocol=https;destsuffix=git/thirdparty/open_model_zoo;name=omz;branch=releases/2022/1
 \
            file://0001-inference-engine-use-system-installed-packages.patch \
            file://0002-inference-engine-installation-fixes.patch \
+           file://cython-cmake.patch \
            "
 
 SRCREV = "cdb9bec7210f8c24fde3e416c7ada820faaaa23e"
@@ -92,6 +93,11 @@ PACKAGECONFIG[python3] = "-DENABLE_PYTHON=ON 
-DPYTHON_LIBRARY=${PYTHON_LIBRARY}
 PACKAGECONFIG[vpu] = "-DENABLE_INTEL_MYRIAD=ON 
-DVPU_FIRMWARE_USB-MA2X8X_FILE=../mvnc/usb-ma2x8x.mvcmd 
-DVPU_FIRMWARE_PCIE-MA2X8X_FILE=../mvnc/pcie-ma2x8x.mvcmd,-DENABLE_INTEL_MYRIAD=OFF,,${PN}-vpu-firmware"
 PACKAGECONFIG[verbose] = "-DVERBOSE_BUILD=1,-DVERBOSE_BUILD=0"
 
+do_configure:prepend() {
+    # Dont set PROJECT_ROOT_DIR
+    sed -i -e 's:\${CMAKE_CURRENT_SOURCE_DIR}::;' ${S}/src/CMakeLists.txt
+}
+
 do_install:append() {
     if ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'true', 'false', d)}; 
then
         install -d ${D}${datadir}/openvino
@@ -108,6 +114,8 @@ do_install:append() {
 
     # Remove the samples source directory. We install the built samples.
     rm -rf ${D}/usr/samples
+
+    sed -i -e 's:^#include.*imp.hpp"$:#include 
"/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}/git/src/plugins/intel_cpu/src/nodes/proposal_imp.hpp":g;'
 ${B}/src/plugins/intel_cpu/cross-compiled/proposal_imp_disp.cpp
 }
 
 # Otherwise e.g. ros-openvino-toolkit-dynamic-vino-sample when using 
dldt-inference-engine uses dldt-inference-engine WORKDIR
-- 
2.35.3

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#7604): 
https://lists.yoctoproject.org/g/meta-intel/message/7604
Mute This Topic: https://lists.yoctoproject.org/mt/92667767/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-intel/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to