From b23c431831e8a663c415751759146e0050de5e2c Mon Sep 17 00:00:00 2001
From: Stefan Schmidt <stefan.schmidt@huawei.com>
Date: Fri, 28 May 2021 11:56:49 +0200
Subject: [PATCH] tf-a-tools: Add bbappend to fix native build on host without
 openssl-devel

The Makefile has some assumptions which result in a dependency on
openssl-devel on the host. The exact same problem was already fixed in
the meta-arm layer so we are simply going with the same sed solution and
add the native dependency on openssl.

https://git.yoctoproject.org/cgit/cgit.cgi/meta-arm/tree/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc#n162

Signed-off-by: Stefan Schmidt <stefan.schmidt@huawei.com>
---
 .../trusted-firmware-a/tf-a-tools_2.4.bbappend       | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 meta-ohos-staging/recipes-bsp/trusted-firmware-a/tf-a-tools_2.4.bbappend

diff --git a/meta-ohos-staging/recipes-bsp/trusted-firmware-a/tf-a-tools_2.4.bbappend b/meta-ohos-staging/recipes-bsp/trusted-firmware-a/tf-a-tools_2.4.bbappend
new file mode 100644
index 00000000..1da37b26
--- /dev/null
+++ b/meta-ohos-staging/recipes-bsp/trusted-firmware-a/tf-a-tools_2.4.bbappend
@@ -0,0 +1,12 @@
+DEPENDS += "openssl-native"
+
+EXTRA_OEMAKE += "OPENSSL_DIR=${STAGING_DIR_NATIVE}/${prefix_native}"
+
+do_compile() {
+    # These changes are needed to have the native tools compiling and executing properly
+    # https://git.yoctoproject.org/cgit/cgit.cgi/meta-arm/tree/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc#n162
+    sed -i '/^LDLIBS/ s,$, \$\{BUILD_LDFLAGS},' ${S}/tools/fiptool/Makefile
+    sed -i '/^INCLUDE_PATHS/ s,$, \$\{BUILD_CFLAGS},' ${S}/tools/fiptool/Makefile
+
+    oe_runmake certtool fiptool
+}
-- 
GitLab