blob: 0922a1ab6e0b700f72b44924c6e8b69eb69f153a [file] [log] [blame]
Patrick Williams7a3e72e2016-11-22 11:03:57 -06001inherit obmc-phosphor-utils
Matthew Barth89727852016-11-16 09:57:39 -06002inherit pythonnative
3
Patrick Williams163bb092016-11-22 13:27:02 -06004DEPENDS += "python"
5
Matthew Barth89727852016-11-16 09:57:39 -06006export BUILD_SYS
7export HOST_SYS
8export STAGING_INCDIR
9export STAGING_LIBDIR
10
Patrick Williams7a3e72e2016-11-22 11:03:57 -060011PYTHON_AUTOTOOLS_PACKAGE ?= "${PN}"
12
13python() {
14 for pkg in listvar_to_list(d, 'PYTHON_AUTOTOOLS_PACKAGE'):
15 set_append(d, 'FILES_%s' % pkg,
16 d.getVar('PYTHON_SITEPACKAGES_DIR', True))
17}
Patrick Williams75f63b92020-03-05 15:27:37 -060018
19# In order to facilitate packages that use python3native, but also
20# depend on python2 scripts we need to replace the #! to be nativepython
21# instead of just python. Without this, `which python` points to the
22# host's python, which is not the one where required modules would be
23# installed.
24do_install_append_class-native() {
25 for i in ${D}${bindir}/* ${D}${sbindir}/*; do
26 if [ -f "$i" ]; then
27 sed -i -e s:env\ python:env\ nativepython:g $i
28 fi
29 done
30}