diff mbox series

[meta-ti,master] ti-ipc-rtos: Fix "buildpaths" QA error

Message ID 20240719231633.4202-1-reatmon@ti.com
State Rejected
Delegated to: Ryan Eatmon
Headers show
Series [meta-ti,master] ti-ipc-rtos: Fix "buildpaths" QA error | expand

Commit Message

Ryan Eatmon July 19, 2024, 11:16 p.m. UTC
The older TI compilers do not have a mechanism for replacing paths in
the obj files they create.  So replace the string we want to remove with
an equally sized replacement string that does not contain the path.

Additionally, fix the generated documentation to not contain the paths
as well.

Signed-off-by: Ryan Eatmon <reatmon@ti.com>
---
 meta-ti-extras/recipes-ti/ipc/ti-ipc-rtos_git.bb | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/meta-ti-extras/recipes-ti/ipc/ti-ipc-rtos_git.bb b/meta-ti-extras/recipes-ti/ipc/ti-ipc-rtos_git.bb
index 999993ea..00039213 100644
--- a/meta-ti-extras/recipes-ti/ipc/ti-ipc-rtos_git.bb
+++ b/meta-ti-extras/recipes-ti/ipc/ti-ipc-rtos_git.bb
@@ -2,7 +2,7 @@  require recipes-ti/ipc/ti-ipc.inc
 require recipes-ti/ipc/ti-ipc-common.inc
 require ti-ipc-rtos.inc
 
-DEPENDS = "ti-xdctools-native ti-sysbios doxygen-native zip-native"
+DEPENDS = "ti-xdctools-native ti-sysbios doxygen-native zip-native perl-native"
 
 PACKAGES =+ "${PN}-fw"
 FILES:${PN}-fw = "${nonarch_base_libdir}/firmware/*"
@@ -61,6 +61,10 @@  do_compile() {
   fi
 }
 
+# Variables to assist in searching/replacing the WORKDIR in binary files.
+TMPDIR_FIX_SEARCH = "${WORKDIR}"
+TMPDIR_FIX_REPLACE = "${@'_'*(len(d.getVar('WORKDIR'))-7)+"workdir"}"
+
 do_install() {
   CP_ARGS="-Prf --preserve=mode,timestamps --no-preserve=ownership"
   IPC_VERSION=`echo ${PV}${RELEASE_SUFFIX} | sed -e 's|\.|_|g'`
@@ -68,8 +72,14 @@  do_install() {
   install -d ${D}${IPC_INSTALL_DIR_RECIPE}
   cp ${CP_ARGS} ${IPC_PACKAGE_DIR}/* -d ${D}${IPC_INSTALL_DIR_RECIPE}
 
+  # Update doxygen generated documentation to remove build host paths
+  find ${D}${IPC_INSTALL_DIR_RECIPE} -type f -exec sed -i -e "s,${WORKDIR},,g" {} \;
+
   install -d ${D}${nonarch_base_libdir}/firmware/ipc
   cp ${CP_ARGS} ${S}/packages/ti/ipc/tests/bin/* ${D}${nonarch_base_libdir}/firmware/ipc || true
+
+  # Update compiled files to remove build host paths
+  find ${D}${nonarch_base_libdir}/firmware/ipc -type f -exec perl -pi -e 's#${TMPDIR_FIX_SEARCH}#${TMPDIR_FIX_REPLACE}#g' {} \;
 }
 
 KFDSPNUM = "0"