Patrick Williams | 7a3e72e | 2016-11-22 11:03:57 -0600 | [diff] [blame] | 1 | inherit obmc-phosphor-utils |
Matthew Barth | 8972785 | 2016-11-16 09:57:39 -0600 | [diff] [blame] | 2 | inherit pythonnative |
| 3 | |
Patrick Williams | 163bb09 | 2016-11-22 13:27:02 -0600 | [diff] [blame] | 4 | DEPENDS += "python" |
| 5 | |
Matthew Barth | 8972785 | 2016-11-16 09:57:39 -0600 | [diff] [blame] | 6 | export BUILD_SYS |
| 7 | export HOST_SYS |
| 8 | export STAGING_INCDIR |
| 9 | export STAGING_LIBDIR |
| 10 | |
Patrick Williams | 7a3e72e | 2016-11-22 11:03:57 -0600 | [diff] [blame] | 11 | PYTHON_AUTOTOOLS_PACKAGE ?= "${PN}" |
| 12 | |
| 13 | python() { |
| 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 Williams | 75f63b9 | 2020-03-05 15:27:37 -0600 | [diff] [blame] | 18 | |
| 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. |
| 24 | do_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 | } |