diff mbox series

[4/5] perf: split scripting PACKAGECONFIG into perl and python

Message ID 20230822170018.315470-4-ross.burton@arm.com
State Accepted, archived
Commit af1511065120b12600e39725d8507fa2c018ae1b
Headers show
Series [1/5] perf: enable verbose feature detection | expand

Commit Message

Ross Burton Aug. 22, 2023, 5 p.m. UTC
From: Ross Burton <ross.burton@arm.com>

There's no reason for Python and Perl support to be tied together, so
split the PACKAGECONFIG into two.

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 meta/recipes-kernel/perf/perf.bb | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)
diff mbox series

Patch

diff --git a/meta/recipes-kernel/perf/perf.bb b/meta/recipes-kernel/perf/perf.bb
index 327934b72a7..f89ab20ca41 100644
--- a/meta/recipes-kernel/perf/perf.bb
+++ b/meta/recipes-kernel/perf/perf.bb
@@ -11,9 +11,10 @@  LICENSE = "GPL-2.0-only"
 
 PR = "r9"
 
-PACKAGECONFIG ??= "scripting tui libunwind libtraceevent"
+PACKAGECONFIG ??= "perl python tui libunwind libtraceevent"
 PACKAGECONFIG[dwarf] = ",NO_DWARF=1"
-PACKAGECONFIG[scripting] = ",NO_LIBPERL=1 NO_LIBPYTHON=1,perl python3 python3-setuptools-native"
+PACKAGECONFIG[perl] = ",NO_LIBPERL=1,perl"
+PACKAGECONFIG[python] = ",NO_LIBPYTHON=1,python3 python3-setuptools-native"
 # gui support was added with kernel 3.6.35
 # since 3.10 libnewt was replaced by slang
 # to cover a wide range of kernel we add both dependencies
@@ -51,7 +52,7 @@  PROVIDES = "virtual/perf"
 inherit linux-kernel-base kernel-arch manpages
 
 # needed for building the tools/perf Python bindings
-inherit ${@bb.utils.contains('PACKAGECONFIG', 'scripting', 'python3targetconfig', '', d)}
+inherit ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3targetconfig', '', d)}
 inherit python3-dir
 export PYTHON_SITEPACKAGES_DIR
 
@@ -61,7 +62,7 @@  export WERROR = "0"
 do_populate_lic[depends] += "virtual/kernel:do_shared_workdir"
 
 # needed for building the tools/perf Perl binding
-include ${@bb.utils.contains('PACKAGECONFIG', 'scripting', 'perf-perl.inc', '', d)}
+include ${@bb.utils.contains('PACKAGECONFIG', 'perl', 'perf-perl.inc', '', d)}
 
 inherit kernelsrc
 
@@ -107,7 +108,7 @@  EXTRA_OEMAKE += "\
     'sharedir=${@os.path.relpath(datadir, prefix)}' \
     'mandir=${@os.path.relpath(mandir, prefix)}' \
     'infodir=${@os.path.relpath(infodir, prefix)}' \
-    ${@bb.utils.contains('PACKAGECONFIG', 'scripting', 'PYTHON=python3 PYTHON_CONFIG=python3-config', '', d)} \
+    ${@bb.utils.contains('PACKAGECONFIG', 'python', 'PYTHON=python3 PYTHON_CONFIG=python3-config', '', d)} \
 "
 
 # During do_configure, we might run a 'make clean'. That often breaks
@@ -152,7 +153,7 @@  do_install() {
 	unset CFLAGS
 	oe_runmake install
 	# we are checking for this make target to be compatible with older perf versions
-	if ${@bb.utils.contains('PACKAGECONFIG', 'scripting', 'true', 'false', d)} && grep -q install-python_ext ${S}/tools/perf/Makefile*; then
+	if ${@bb.utils.contains('PACKAGECONFIG', 'python', 'true', 'false', d)} && grep -q install-python_ext ${S}/tools/perf/Makefile*; then
 	    oe_runmake DESTDIR=${D} install-python_ext
 	    if [ -e ${D}${libdir}/python*/site-packages/perf-*/SOURCES.txt ]; then
 		sed -i -e 's#${WORKDIR}##g' ${D}${libdir}/python*/site-packages/perf-*/SOURCES.txt
@@ -370,9 +371,10 @@  RDEPENDS:${PN}-python =+ "bash python3 python3-modules ${@bb.utils.contains('PAC
 RDEPENDS:${PN}-perl =+ "bash perl perl-modules"
 RDEPENDS:${PN}-tests =+ "python3 bash"
 
-RSUGGESTS_SCRIPTING = "${@bb.utils.contains('PACKAGECONFIG', 'scripting', '${PN}-perl ${PN}-python', '',d)}"
-RSUGGESTS:${PN} += "${PN}-archive ${PN}-tests ${RSUGGESTS_SCRIPTING}"
-
+RSUGGESTS:${PN} += "${PN}-archive ${PN}-tests \
+                    ${@bb.utils.contains('PACKAGECONFIG', 'perl', '${PN}-perl', '', d)} \
+                    ${@bb.utils.contains('PACKAGECONFIG', 'python', '${PN}-python', '', d)} \
+                    "
 FILES_SOLIBSDEV = ""
 FILES:${PN} += "${libexecdir}/perf-core ${exec_prefix}/libexec/perf-core ${libdir}/traceevent* ${libdir}/libperf-jvmti.so"
 FILES:${PN}-archive = "${libdir}/perf/perf-core/perf-archive"