[oe] [meta-oe][PATCH] googletest: fix build with newer oe-core without python in HOSTTOOLS

Martin Jansa martin.jansa at gmail.com
Tue Dec 10 12:08:08 UTC 2019


Signed-off-by: Martin Jansa <Martin.Jansa at gmail.com>
---
 meta-oe/recipes-test/googletest/googletest_git.bb | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/meta-oe/recipes-test/googletest/googletest_git.bb b/meta-oe/recipes-test/googletest/googletest_git.bb
index b675ea0f32..354e7de337 100644
--- a/meta-oe/recipes-test/googletest/googletest_git.bb
+++ b/meta-oe/recipes-test/googletest/googletest_git.bb
@@ -21,3 +21,11 @@ ALLOW_EMPTY_${PN}-dbg = "1"
 RDEPENDS_${PN}-dev += "${PN}-staticdev"
 
 BBCLASSEXTEND = "native nativesdk"
+
+do_configure_prepend() {
+    # explicitly use python3
+    # the scripts are already python3 compatible since https://github.com/google/googletest/commit/d404af0d987a9c38cafce82a7e26ec8468c88361 and other fixes like this
+    # but since this oe-core change http://git.openembedded.org/openembedded-core/commit/?id=5f8f16b17f66966ae91aeabc23e97de5ecd17447
+    # there isn't python in HOSTTOOLS so "env python" fails
+    sed -i 's@^#!/usr/bin/env python$@#!/usr/bin/env python3 at g' ${S}/googlemock/scripts/*py ${S}/googlemock/scripts/generator/*py ${S}/googlemock/scripts/generator/cpp/*py ${S}/googlemock/test/*py ${S}/googletest/scripts/*py ${S}/googletest/test/*py
+}
-- 
2.20.1



More information about the Openembedded-devel mailing list