From 488b4baac3a3a622a3cc892b82c48f5d2d3c544a Mon Sep 17 00:00:00 2001 From: Martin Jansa Date: Fri, 28 Jun 2019 16:48:29 +0000 Subject: [PATCH] ament.bbclass: use ARCH overrides to set PYTHON_SOABI instead of mapping based on MACHINE * to fix parsing the recipes with qemuarm Signed-off-by: Martin Jansa --- classes/ament.bbclass | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/classes/ament.bbclass b/classes/ament.bbclass index e49debb..54ed3e7 100644 --- a/classes/ament.bbclass +++ b/classes/ament.bbclass @@ -1,19 +1,10 @@ +PYTHON_SOABI_x86 = "i386-${TARGET_OS}-gnu" +PYTHON_SOABI_x86-64 = "x86_64-${TARGET_OS}-gnu" +PYTHON_SOABI_arm = "${TUNE_ARCH}-${TARGET_OS}${ARMPKGSFX_EABI}" +PYTHON_SOABI_aarch64 = "${TUNE_ARCH}-${TARGET_OS}${ARMPKGSFX_EABI}-gnu" -def ament__get_python_soabi(d): - machine = d.getVar('MACHINE', True) - pysoabi_prefix = 'cpython-' + d.getVar('PYTHON_BASEVERSION', True).replace('.', '') + d.getVar('PYTHON_ABI', True) - machine_pysoabi_map = { - 'qemux86': (d.getVar('QB_SYSTEM_NAME_x86', True) or '').rsplit('-')[-1] + '-${TARGET_OS}-gnu', - 'qemux86-64': (d.getVar('QB_SYSTEM_NAME_x86-64', True) or '').rsplit('-')[-1] + '-${TARGET_OS}-gnu', - 'qemuarm64': '${TUNE_ARCH}-${TARGET_OS}${ARMPKGSFX_EABI}-gnu', - 'raspberrypi3': '${TUNE_ARCH}-${TARGET_OS}${ARMPKGSFX_EABI}', - } - try: - return pysoabi_prefix + '-' + machine_pysoabi_map[machine] - except KeyError: - bb.fatal('Unknown MACHINE name: ' + machine + '; can not determine the PYTHON_SOABI value.') +EXTRA_OECMAKE_append = " -DBUILD_TESTING=OFF -DPYTHON_SOABI=${PYTHON_SOABI}" -EXTRA_OECMAKE_append = " -DBUILD_TESTING=OFF -DPYTHON_SOABI=${@ament__get_python_soabi(d)}" # XXX Without STAGING_DIR_HOST path included, rmw-implementation:do_configure() fails with: # # "Could not find ROS middleware implementation 'NOTFOUND'"