[OE-core] [PATCH 2/4] linux-tools: don't build perf when GPLv3 in INCOMPATIBLE_LICENSE
Richard Purdie
richard.purdie at linuxfoundation.org
Wed Jan 25 12:31:19 UTC 2012
On Tue, 2012-01-24 at 15:26 -0800, Joshua Lock wrote:
> As binutils is required by perf to build and is GPLv3 licensed adding
> GPLv3 to INCOMPATIBLE_LICENSE will cause linux-yocto to be skipped.
>
> Long term we should look at moving perf to a separate recipe but as a
> short term solution this patch will ensure that when GPLv3 is in
> INCOMPATIBLE_LICENSE perf is not built and it's dependencies are not
> added to build.
>
> Fixes [YOCTO #1880]
>
> Signed-off-by: Joshua Lock <josh at linux.intel.com>
> ---
> meta/recipes-kernel/linux/linux-tools.inc | 20 ++++++++++++++++++--
> meta/recipes-kernel/linux/linux-yocto_2.6.37.bb | 2 +-
> meta/recipes-kernel/linux/linux-yocto_3.0.bb | 2 +-
> 3 files changed, 20 insertions(+), 4 deletions(-)
>
> diff --git a/meta/recipes-kernel/linux/linux-tools.inc b/meta/recipes-kernel/linux/linux-tools.inc
> index aa45dba..69e68c0 100644
> --- a/meta/recipes-kernel/linux/linux-tools.inc
> +++ b/meta/recipes-kernel/linux/linux-tools.inc
> @@ -1,5 +1,18 @@
> # included by kernel recipes if they want to build/provide
> # perf functionality from their tree.
> +
> +# perf requires binutils which is GPLv3 licensed, don't prevent the entire kernel
> +# being built if GPLv3 is in INCOMPATIBLE_LICENSE
> +python () {
> + d.setVar("BUILDPERF", "yes")
> + d.setVar("PERFDEPENDS", "virtual/${MLPREFIX}libc:do_populate_sysroot ${MLPREFIX}elfutils:do_populate_sysroot ${MLPREFIX}binutils:do_populate_sysroot")
> +
> + if ((d.getVar("INCOMPATIBLE_LICENSE", True) or "").find("GPLv3") != -1):
> + # GPLv3, drop perf
> + d.setVar("BUILDPERF", "no")
> + d.setVar("PERFDEPENDS", "")
> +}
> +
Can we make this a little neater, something like:
BUILDPERF = "yes"
BUILDPERF_libc-uclib = "no"
PERFDEPENDS = "virtual/${MLPREFIX}libc:do_populate_sysroot ${MLPREFIX}elfutils:do_populate_sysroot ${MLPREFIX}binutils:do_populate_sysroot"
PERFDEPENDS_libc-uclibc = ""
Then just have the if statement in the anonymous python and drop the
do_compile_perf_libc-uclibc and PERFDEPENDS_libc-uclibc.
This also makes it easy for an external recipe to just disable this
code.
Cheers,
Richard
More information about the Openembedded-core
mailing list