summaryrefslogtreecommitdiffstats
path: root/meta/recipes-kernel
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@gmail.com>2019-08-28 22:14:41 -0400
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-08-30 17:10:28 +0100
commite66d183b9e2cea67813b43bcb23622870102e9a3 (patch)
treea021689aeb0f30ddf699f9c9357b948915fcefb6 /meta/recipes-kernel
parent4c62122ecbf20f8f4057446aa74d2c7d089180d6 (diff)
downloadpoky-e66d183b9e2cea67813b43bcb23622870102e9a3.tar.gz
perf: change dependencies on python to python3
The upstream kernel can now handle python3 for the perf scripts, coupled with the impending EOL of python2, we switch the dependencies in perf (scripting) to python3. Outside of dependency changes, we also pass the following two variables to the perf build: PYTHON=python3 PYTHON_CONFIG=python3-config. To ensure that our python3 components are used. For configurations that disable perf scripting, there is no change in behaviour. [YOCTO #13358] (From OE-Core rev: 584af667e0000129bcb5c9e8108485f2f6590eaf) Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-kernel')
-rw-r--r--meta/recipes-kernel/perf/perf.bb19
1 files changed, 11 insertions, 8 deletions
diff --git a/meta/recipes-kernel/perf/perf.bb b/meta/recipes-kernel/perf/perf.bb
index 4e603f1a32..af0410c88d 100644
--- a/meta/recipes-kernel/perf/perf.bb
+++ b/meta/recipes-kernel/perf/perf.bb
@@ -13,7 +13,7 @@ PR = "r9"
13 13
14PACKAGECONFIG ??= "scripting tui libunwind" 14PACKAGECONFIG ??= "scripting tui libunwind"
15PACKAGECONFIG[dwarf] = ",NO_DWARF=1" 15PACKAGECONFIG[dwarf] = ",NO_DWARF=1"
16PACKAGECONFIG[scripting] = ",NO_LIBPERL=1 NO_LIBPYTHON=1,perl python" 16PACKAGECONFIG[scripting] = ",NO_LIBPERL=1 NO_LIBPYTHON=1,perl python3"
17# gui support was added with kernel 3.6.35 17# gui support was added with kernel 3.6.35
18# since 3.10 libnewt was replaced by slang 18# since 3.10 libnewt was replaced by slang
19# to cover a wide range of kernel we add both dependencies 19# to cover a wide range of kernel we add both dependencies
@@ -44,8 +44,8 @@ PROVIDES = "virtual/perf"
44inherit linux-kernel-base kernel-arch manpages 44inherit linux-kernel-base kernel-arch manpages
45 45
46# needed for building the tools/perf Python bindings 46# needed for building the tools/perf Python bindings
47inherit ${@bb.utils.contains('PACKAGECONFIG', 'scripting', 'pythonnative', '', d)} 47inherit ${@bb.utils.contains('PACKAGECONFIG', 'scripting', 'python3native', '', d)}
48inherit python-dir 48inherit python3-dir
49export PYTHON_SITEPACKAGES_DIR 49export PYTHON_SITEPACKAGES_DIR
50 50
51#kernel 3.1+ supports WERROR to disable warnings as errors 51#kernel 3.1+ supports WERROR to disable warnings as errors
@@ -94,6 +94,7 @@ EXTRA_OEMAKE += "\
94 'sharedir=${@os.path.relpath(datadir, prefix)}' \ 94 'sharedir=${@os.path.relpath(datadir, prefix)}' \
95 'mandir=${@os.path.relpath(mandir, prefix)}' \ 95 'mandir=${@os.path.relpath(mandir, prefix)}' \
96 'infodir=${@os.path.relpath(infodir, prefix)}' \ 96 'infodir=${@os.path.relpath(infodir, prefix)}' \
97 ${@bb.utils.contains('PACKAGECONFIG', 'scripting', 'PYTHON=python3 PYTHON_CONFIG=python3-config', '', d)} \
97" 98"
98 99
99# During do_configure, we might run a 'make clean'. That often breaks 100# During do_configure, we might run a 'make clean'. That often breaks
@@ -132,7 +133,7 @@ do_install() {
132 oe_runmake install 133 oe_runmake install
133 # we are checking for this make target to be compatible with older perf versions 134 # we are checking for this make target to be compatible with older perf versions
134 if ${@bb.utils.contains('PACKAGECONFIG', 'scripting', 'true', 'false', d)} && grep -q install-python_ext ${S}/tools/perf/Makefile*; then 135 if ${@bb.utils.contains('PACKAGECONFIG', 'scripting', 'true', 'false', d)} && grep -q install-python_ext ${S}/tools/perf/Makefile*; then
135 oe_runmake DESTDIR=${D} install-python_ext 136 oe_runmake DESTDIR=${D} install-python_ext
136 fi 137 fi
137} 138}
138 139
@@ -232,8 +233,10 @@ do_configure_prepend () {
232 fi 233 fi
233 234
234 # use /usr/bin/env instead of version specific python 235 # use /usr/bin/env instead of version specific python
235 for s in `find ${S}/tools/perf/scripts/python/ -name '*.py'`; do 236 for s in `find ${S}/tools/perf/ -name '*.py'`; do
236 sed -i 's,/usr/bin/python2,/usr/bin/env python,' "${s}" 237 sed -i 's,/usr/bin/python,/usr/bin/env python3,' "${s}"
238 sed -i 's,/usr/bin/python2,/usr/bin/env python3,' "${s}"
239 sed -i 's,/usr/bin/env python2,/usr/bin/env python3,' "${s}"
237 done 240 done
238 241
239 # unistd.h can be out of sync between libc-headers and the captured version in the perf source 242 # unistd.h can be out of sync between libc-headers and the captured version in the perf source
@@ -252,9 +255,9 @@ PACKAGES =+ "${PN}-archive ${PN}-tests ${PN}-perl ${PN}-python"
252 255
253RDEPENDS_${PN} += "elfutils bash" 256RDEPENDS_${PN} += "elfutils bash"
254RDEPENDS_${PN}-archive =+ "bash" 257RDEPENDS_${PN}-archive =+ "bash"
255RDEPENDS_${PN}-python =+ "bash python python-modules ${@bb.utils.contains('PACKAGECONFIG', 'audit', 'audit-python', '', d)}" 258RDEPENDS_${PN}-python =+ "bash python3 python3-modules ${@bb.utils.contains('PACKAGECONFIG', 'audit', 'audit-python3', '', d)}"
256RDEPENDS_${PN}-perl =+ "bash perl perl-modules" 259RDEPENDS_${PN}-perl =+ "bash perl perl-modules"
257RDEPENDS_${PN}-tests =+ "python" 260RDEPENDS_${PN}-tests =+ "python3"
258 261
259RSUGGESTS_SCRIPTING = "${@bb.utils.contains('PACKAGECONFIG', 'scripting', '${PN}-perl ${PN}-python', '',d)}" 262RSUGGESTS_SCRIPTING = "${@bb.utils.contains('PACKAGECONFIG', 'scripting', '${PN}-perl ${PN}-python', '',d)}"
260RSUGGESTS_${PN} += "${PN}-archive ${PN}-tests ${RSUGGESTS_SCRIPTING}" 263RSUGGESTS_${PN} += "${PN}-archive ${PN}-tests ${RSUGGESTS_SCRIPTING}"