python3-meson-python: New recipe
PATCH v2 1/2 python3-meson-python: New recipe
This python module adds support for a new PEP517 build backend used by recent versions of scikit-image, scipy and others.
Signed-off-by Zoltán Böszörményi <[email protected]>
--- .../python/python3-meson-python_0.13.1.bb | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 meta-python/recipes-devtools/python/python3-meson-python_0.13.1.bb
meta-python/recipes-devtools/python/python3-meson-python_0.13.1.bb new file +23 -0
@@ -0,0 +1,23 @@ +SUMMARY = "Meson Python build backend (PEP 517)" +HOMEPAGE = "https://github.com/mesonbuild/meson-python" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://LICENSE;md5=d580b27e67cc0892a5b005b0be114b60" + +DEPENDS = " \ + meson-native ninja-native patchelf-native \ + python3-pyproject-metadata-native \ +" + +PYPI_PACKAGE = "meson_python" + +inherit pypi python_mesonpy +SRC_URI[sha256sum] = "63b3170001425c42fa4cfedadb9051cbd28925ff8eed7c40d36ba0099e3c7618" + +DEPENDS:remove:class-native = "python3-meson-python-native" + +RDEPENDS:${PN} = " \ + meson ninja patchelf \ + python3-pyproject-metadata \ +" + +BBCLASSEXTEND = "native nativesdk"
Signature · 1 line
2.40.1
PATCH v2 2/2 python_mesonpy: New class
This is a new PEP517 compatible build class for python modules that use pyproject.toml and this:
[build-system]
build-backend = 'mesonpy'
The new class uses python3-meson-python-native.
Signed-off-by Zoltán Böszörményi <[email protected]>
--- meta-python/classes/python_mesonpy.bbclass | 52 ++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 meta-python/classes/python_mesonpy.bbclass
meta-python/classes/python_mesonpy.bbclass new file +52 -0
@@ -0,0 +1,52 @@ +# +# Copyright OpenEmbedded Contributors +# +# SPDX-License-Identifier: MIT +# + +inherit meson setuptools3-base python3targetconfig 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}" + +CONFIGURE_FILES = "pyproject.toml" + +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 pyx -> c -> so build leaves absolute build paths in the code +INSANE_SKIP:${PN} += "buildpaths" +INSANE_SKIP:${PN}-src += "buildpaths" + +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
Signature · 1 line
2.40.1