From 45c2a8fceeee4cb074f8a1376dc076a14ff68fc4 Mon Sep 17 00:00:00 2001 From: Martin Jansa Date: Thu, 25 Feb 2021 18:45:16 +0100 Subject: glib-2.0: replace THISDIR instead of COREBASE in find_meson_cross_files --cross-file paths * COREBASE works correctly only as long as this recipe is inside of COREBASE directory and leaves the full absolute paths if you copy this recipe into your own layer (e.g. to backport newer version) * use THISDIR as all FILESPATH should be relative to that, unless there is a .bbappend not only extending FILESPATH, but also adding meson.cross.d files there (at which point it also didn't work with COREBASE replacements as well already) - show an ERROR in such case, I don't think it's common scenario to spend more time to support that. (From OE-Core rev: 314cfc7d6a8f9b00db7da5424890ff955a5ce971) Signed-off-by: Martin Jansa Signed-off-by: Richard Purdie --- meta/recipes-core/glib-2.0/glib-2.0_2.66.7.bb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'meta/recipes-core') diff --git a/meta/recipes-core/glib-2.0/glib-2.0_2.66.7.bb b/meta/recipes-core/glib-2.0/glib-2.0_2.66.7.bb index 15e9dbaf6f..882a89da7a 100644 --- a/meta/recipes-core/glib-2.0/glib-2.0_2.66.7.bb +++ b/meta/recipes-core/glib-2.0/glib-2.0_2.66.7.bb @@ -31,7 +31,7 @@ def find_meson_cross_files(d): if bb.data.inherits_class('native', d): return "" - corebase = d.getVar("COREBASE") + thisdir = d.getVar("THISDIR") import collections sitedata = siteinfo_data(d) # filename -> found @@ -39,7 +39,11 @@ def find_meson_cross_files(d): for path in d.getVar("FILESPATH").split(":"): for element in sitedata: filename = os.path.normpath(os.path.join(path, "meson.cross.d", element)) - files[filename.replace(corebase, "${COREBASE}")] = os.path.exists(filename) + sanitized_path = filename.replace(thisdir, "${THISDIR}") + if sanitized_path == filename: + bb.error("Cannot add '%s' to --cross-file, because it's not relative to THISDIR '%s' and sstate signature would contain this full path" % (filename, thisdir)) + continue + files[filename.replace(thisdir, "${THISDIR}")] = os.path.exists(filename) items = ["--cross-file=" + k for k,v in files.items() if v] d.appendVar("EXTRA_OEMESON", " " + " ".join(items)) -- cgit v1.2.3-54-g00ecf