diff mbox series

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

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

Commit Message

Ryan Eatmon July 21, 2024, 3:35 p.m. UTC
The final binary contains paths on the host system.  Replace the string
we want to remove with an equally sized replacement string that does
not contain the path.

Signed-off-by: Ryan Eatmon <reatmon@ti.com>
---
 meta-ti-extras/recipes-devtools/gdbc6x/gdbc6x_git.bb | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/meta-ti-extras/recipes-devtools/gdbc6x/gdbc6x_git.bb b/meta-ti-extras/recipes-devtools/gdbc6x/gdbc6x_git.bb
index 1f296dc5..6a497e0f 100644
--- a/meta-ti-extras/recipes-devtools/gdbc6x/gdbc6x_git.bb
+++ b/meta-ti-extras/recipes-devtools/gdbc6x/gdbc6x_git.bb
@@ -3,7 +3,7 @@  SECTION = "devel"
 LICENSE = "GPL-3.0-or-later"
 LIC_FILES_CHKSUM = "file://debian/copyright;md5=bf0fe2872eb3dfeebb2cbe38206fe81f"
 
-DEPENDS = "ncurses bison-native texinfo flex-native gettext"
+DEPENDS = "ncurses bison-native texinfo flex-native gettext perl-native"
 
 COMPATIBLE_MACHINE = "dra7xx"
 
@@ -21,6 +21,10 @@  inherit gettext
 
 CFLAGS += "-fcommon -fpermissive"
 
+# 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_configure () {
     cd ${S}
     ./configure --program-suffix=c6x --target=tic6x-elf-tirtos --host=${HOST_SYS} --prefix=${S}/install_gdb
@@ -33,6 +37,9 @@  do_install () {
     install -d ${D}${bindir}
     install -d ${D}${includedir}
     install -m 755  ${S}/install_gdb/bin/gdbc6x ${D}${bindir} 
+
+    perl -pi -e 's#${TMPDIR_FIX_SEARCH}#${TMPDIR_FIX_REPLACE}#g' ${D}${bindir}/gdbc6x
+
     cp -rf ${S}/install_gdb/include/* ${D}${includedir}
 
     install -d ${D}${sysconfdir}/init.d