diff mbox series

[meta-tensorflow] tensorflow-lite: package headers

Message ID 20250913173840.3216545-1-skandigraun@gmail.com
State New
Headers show
Series [meta-tensorflow] tensorflow-lite: package headers | expand

Commit Message

Gyorgy Sarvari Sept. 13, 2025, 5:38 p.m. UTC
The headers are not packages with tensorflow-lite, making it not easy to
compile any applications using them.

This patch copies the headers from the source and output folder to
the includedir.

The patch was derived from the content of a pre-compiled tflite package[1],
and from compilation error messages that were returned by rpicam-apps
recipe (which uses this recipe as an optional dependency)

[1]: https://github.com/prepkg/tensorflow-lite-raspberrypi/releases/tag/2.20.0

Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
---
 .../tensorflow/tensorflow-lite_2.19.0.bb      | 23 +++++++++++++++++++
 1 file changed, 23 insertions(+)
diff mbox series

Patch

diff --git a/recipes-framework/tensorflow/tensorflow-lite_2.19.0.bb b/recipes-framework/tensorflow/tensorflow-lite_2.19.0.bb
index 14a538a..786507e 100644
--- a/recipes-framework/tensorflow/tensorflow-lite_2.19.0.bb
+++ b/recipes-framework/tensorflow/tensorflow-lite_2.19.0.bb
@@ -114,6 +114,29 @@  do_install() {
         ${D}${datadir}/label_image
 
 
+    # install the headers also
+    cd ${S}
+    for header in `find ./tensorflow/lite -type f -name *.h`; do
+        install -D -m 0644 $header ${D}${includedir}/$header
+    done
+
+    for header in `find ./tensorflow/compiler/mlir -type f -name *.h`; do
+        install -D -m 0644 $header ${D}${includedir}/$header
+    done
+
+    for header in `find ./tensorflow/core/public -type f -name *.h`; do
+        install -D -m 0644 $header ${D}${includedir}/$header
+    done
+    cd -
+
+    cd ${WORKDIR}/bazel/output_base/external/flatbuffers/include
+    for header in `find ./flatbuffers -type f`; do
+        install -D -m 0644 $header ${D}${includedir}/$header
+    done
+    cd -
+
+    # header installation done
+
     #echo "Installing pip package"
     install -d ${D}/${PYTHON_SITEPACKAGES_DIR}
     ${STAGING_BINDIR_NATIVE}/pip3 install --disable-pip-version-check -v \