)
+@oe.spdx30.register(OE_SPDX_BASE + "recipe-extension")
+class OERecipeExtension(oe.spdx30.extension_Extension):
+ """
+ This extension is added to recipe software_Packages to indicate various
+ useful bits of information about the recipe
+ """
+
+ CLOSED = True
+
+ @classmethod
+ def _register_props(cls):
+ super()._register_props()
+ cls._add_property(
+ "is_native",
+ oe.spdx30.BooleanProp(),
+ OE_SPDX_BASE + "is-native",
+ max_count=1,
+ )
+
+
def spdxid_hash(*items):
h = hashlib.md5()
for i in items:
)
+def get_is_native(d):
+ return bb.data.inherits_class("native", d) or bb.data.inherits_class("cross", d)
+
+
def create_recipe_spdx(d):
deploydir = Path(d.getVar("SPDXRECIPEDEPLOY"))
deploy_dir_spdx = Path(d.getVar("DEPLOY_DIR_SPDX"))
)
)
+ if get_is_native(d):
+ ext = oe.sbom30.OERecipeExtension()
+ ext.is_native = True
+ recipe.extension.append(ext)
+
set_purls(recipe, (d.getVar("SPDX_PACKAGE_URLS") or "").split())
# TODO: This doesn't work before do_unpack because the license text has to
spdx_workdir = Path(d.getVar("SPDXWORK"))
include_sources = d.getVar("SPDX_INCLUDE_SOURCES") == "1"
pkg_arch = d.getVar("SSTATE_PKGARCH")
- is_native = bb.data.inherits_class("native", d) or bb.data.inherits_class(
- "cross", d
- )
+ is_native = get_is_native(d)
recipe, recipe_objset = load_recipe_spdx(d)
def create_package_spdx(d):
deploy_dir_spdx = Path(d.getVar("DEPLOY_DIR_SPDX"))
deploydir = Path(d.getVar("SPDXRUNTIMEDEPLOY"))
- is_native = bb.data.inherits_class("native", d) or bb.data.inherits_class(
- "cross", d
- )
providers = oe.spdx_common.collect_package_providers(d)
pkg_arch = d.getVar("SSTATE_PKGARCH")
- if is_native:
+ if get_is_native(d):
return
bb.build.exec_func("read_subpackage_metadata", d)