From: Denys Dmytriyenko <[email protected]>

Finding tar binary and using it's absolute path in the code doesn't work for
cross-compilation and causes "buildpaths" QA error.

Signed-off-by: Denys Dmytriyenko <[email protected]>
---
 ...-Hardcode-correct-path-to-tar-binary.patch | 34 +++++++++++++++++++
 .../recipes-sysrepo/sysrepo/sysrepo_git.bb    |  3 ++
 2 files changed, 37 insertions(+)
 create mode 100644 
meta-arago-extras/recipes-sysrepo/sysrepo/sysrepo/0001-Hardcode-correct-path-to-tar-binary.patch

diff --git 
a/meta-arago-extras/recipes-sysrepo/sysrepo/sysrepo/0001-Hardcode-correct-path-to-tar-binary.patch
 
b/meta-arago-extras/recipes-sysrepo/sysrepo/sysrepo/0001-Hardcode-correct-path-to-tar-binary.patch
new file mode 100644
index 00000000..daed8c26
--- /dev/null
+++ 
b/meta-arago-extras/recipes-sysrepo/sysrepo/sysrepo/0001-Hardcode-correct-path-to-tar-binary.patch
@@ -0,0 +1,34 @@
+From 367e806a9affbfa351fe799b200f2361eb9d7934 Mon Sep 17 00:00:00 2001
+From: Denys Dmytriyenko <[email protected]>
+Date: Mon, 15 Jul 2024 16:14:23 -0400
+Subject: [PATCH] Hardcode correct path to tar binary
+
+Otherwise the hostpath location gets embedded, which is incorrect for
+the target and trips the "buildpaths" QA error.
+
+Upstream-Status: Inappropriate [OE/crosscompile specific]
+
+Signed-off-by: Denys Dmytriyenko <[email protected]>
+---
+ CMakeLists.txt | 5 +----
+ 1 file changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 22c95420..2ba1f44e 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -402,10 +402,7 @@ check_symbol_exists(mkstemps "stdlib.h" SR_HAVE_MKSTEMPS)
+ unset(CMAKE_REQUIRED_DEFINITIONS)
+ 
+ # tar
+-find_program(TAR_BINARY "tar")
+-if(NOT TAR_BINARY)
+-    message(FATAL_ERROR "tar binary was not found.")
+-endif()
++set(TAR_BINARY "/usr/bin/tar")
+ 
+ # generate files
+ configure_file("${PROJECT_SOURCE_DIR}/src/config.h.in" 
"${PROJECT_BINARY_DIR}/config.h" ESCAPE_QUOTES @ONLY)
+-- 
+2.25.1
+
diff --git a/meta-arago-extras/recipes-sysrepo/sysrepo/sysrepo_git.bb 
b/meta-arago-extras/recipes-sysrepo/sysrepo/sysrepo_git.bb
index ae0e8a27..b893e281 100644
--- a/meta-arago-extras/recipes-sysrepo/sysrepo/sysrepo_git.bb
+++ b/meta-arago-extras/recipes-sysrepo/sysrepo/sysrepo_git.bb
@@ -5,6 +5,7 @@ LICENSE = "BSD-3-Clause"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=ef345f161efb68c3836e6f5648b2312f"
 
 SRC_URI = "git://github.com/sysrepo/sysrepo.git;protocol=https;branch=devel \
+           file://0001-Hardcode-correct-path-to-tar-binary.patch \
            ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', \
                 'file://sysrepo','', d)} \
            ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', \
@@ -32,6 +33,8 @@ SYSTEMD_PACKAGES = "${PN}"
 SYSTEMD_SERVICE:${PN} = "sysrepod.service"
 SYSTEMD_AUTO_ENABLE:${PN} = "disable"
 
+RDEPENDS:${PN} += "tar"
+
 do_install:append () {
     install -d ${D}${sysconfdir}/sysrepo/data/notifications
     install -d ${D}${sysconfdir}/sysrepo/yang
-- 
2.25.1



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


Reply via email to