Files
poky/meta/classes-recipe/python_mesonpy.bbclass
Ross Burton 3ca199c5f8 classes/python_pep517: centralise shared inherits
For the build process to actually work some inherits are always needed:

- python3native for the python that is actually running build.
- setuptools3-base (badly named) defines how to build extensions and
  where to put modules.

Instead of inheriting these in every class, inherit them once in the
python_pep517 class.

(From OE-Core rev: 449b226aca6a5db378dc5576dde47499925dfb26)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-08-04 18:04:03 +01:00

47 lines
1.1 KiB
Plaintext

#
# Copyright OpenEmbedded Contributors
#
# SPDX-License-Identifier: MIT
#
inherit meson python_pep517
# meson_do_qa_configure does the wrong thing here because
# mesonpy runs "meson setup ..." in do_compile context.
# Make it a dummy function.
meson_do_qa_configure () {
:
}
# This prevents the meson error:
# ERROR: Got argument buildtype as both -Dbuildtype and --buildtype. Pick one.
MESONOPTS:remove = "--buildtype ${MESON_BUILDTYPE}"
DEPENDS += "python3-wheel-native python3-meson-python-native"
def mesonpy_get_args(d):
vars = ['MESONOPTS', 'MESON_CROSS_FILE', 'EXTRA_OEMESON']
varlist = []
for var in vars:
value = d.getVar(var)
vallist = value.split()
for elem in vallist:
varlist.append("-Csetup-args=" + elem)
return ' '.join(varlist)
PEP517_BUILD_OPTS = "-Cbuilddir='${B}' ${@mesonpy_get_args(d)}"
python_mesonpy_do_configure () {
python_pep517_do_configure
}
python_mesonpy_do_compile () {
python_pep517_do_compile
}
python_mesonpy_do_install () {
python_pep517_do_install
}
EXPORT_FUNCTIONS do_configure do_compile do_install