From ce192383d5ace25f50462341165340052097108a Mon Sep 17 00:00:00 2001 From: Hongxu Jia Date: Tue, 29 Oct 2024 22:07:44 -0700 Subject: create-spdx-{2.2,3.0}: support SPDX include source for work-share directory Originally, while SPDX_INCLUDE_SOURCES = "1" [1], there is bug in scan for gcc, libgcc in which the sources locates in work-share directory. Copy source from ${WORKDIR} to ${SPDXWORK} did not satisfy the situation while ${S} was not included in ${WORKDIR} This commit aim to support SPDX include source for work-share directory 1. If is_work_shared_spdx, Copy source from ${S} to ${SPDXWORK}, normally the dest dir in ${SPDXWORK} has the same basename dir of ${S}; but for kernel source, rename basename dir 'kernel-source' to ${BP} (${BPN}-${PV}) 2. For SPDX source copy, do hard link copy to save copy time 3. Move do_patch to no work shared situation along with do_unpack 4. Tweak task do_create_spdx dependencies to assure the patched source in work share is ready for SPDX source copy 5. Remove bb.data.inherits_class('kernel', d) from is_work_shared_spdx, the kernel source locates in 'work-shared', test kernel.bbclass is not necessary [1] https://docs.yoctoproject.org/dev/ref-manual/variables.html#term-SPDX_INCLUDE_SOURCES (From OE-Core rev: 64454b1956a9b50d6c89a3f3d7c594c1272cb289) Signed-off-by: Hongxu Jia Reviewed-by: Joshua Watt Signed-off-by: Mathieu Dubois-Briand Signed-off-by: Richard Purdie --- meta/classes/spdx-common.bbclass | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'meta/classes/spdx-common.bbclass') diff --git a/meta/classes/spdx-common.bbclass b/meta/classes/spdx-common.bbclass index ad02da5cd6..d3cdc8b6ce 100644 --- a/meta/classes/spdx-common.bbclass +++ b/meta/classes/spdx-common.bbclass @@ -57,6 +57,15 @@ def create_spdx_source_deps(d): if oe.spdx_common.has_task(d, "do_shared_workdir"): deps.append("%s:do_shared_workdir" % pn) + # For gcc-source-${PV} source code + if oe.spdx_common.has_task(d, "do_preconfigure"): + deps.append("%s:do_preconfigure" % pn) + elif oe.spdx_common.has_task(d, "do_patch"): + deps.append("%s:do_patch" % pn) + # For gcc-cross-x86_64 source code + elif oe.spdx_common.has_task(d, "do_configure"): + deps.append("%s:do_configure" % pn) + return " ".join(deps) -- cgit v1.2.3-54-g00ecf