Skip to contentSkip to conversation

Move "mesonpy" support to oe-core

PATCH New Tim Orling 1 participant 3 messages Feb 19, 2024 Arm/Amlogic Meson SoC support

lore
Share & tools
lore

Tim Orling

author
#0 lore raw

cover Move "mesonpy" support to oe-core

The "mesonpy" PEP-517 build backend is declared by python3-numpy in pyproject.toml, so it is time to move this to oe-core.

This should not be build-tested/merged until the move to oe-core is complete:
https://patchwork.yoctoproject.org/project/oe-core/patch/[email protected]/

This is part of a larger effort to replace usage of setuptools3.bbclass in favor of the various python_*.bbclass PEP-517 build backends.

The following changes since commit a6c4624a684f7d5a2dbd21acbe74ecf611f4f839:

ot-br-posix: Limit vla-cxx-extension option to clang >= 18 (2024-02-10 23:47:57 -0800)

are available in the Git repository at:

https://git.openembedded.org/meta-openembedded-contrib timo/move_python_mesonpy
https://git.openembedded.org/meta-openembedded-contrib/log/?h=timo/move_python_mesonpy

Tim Orling (2):
python_mesonpy.bbclass: move to oe-core
python3-meson-python: move to oe-core

 meta-python/classes/python_mesonpy.bbclass    | 52 -------------------
 .../python/python3-meson-python_0.15.0.bb     | 23 --------
 2 files changed, 75 deletions(-)
 delete mode 100644 meta-python/classes/python_mesonpy.bbclass
 delete mode 100644 meta-python/recipes-devtools/python/python3-meson-python_0.15.0.bb
Signature · 1 line
2.34.1
author
#1 lore raw

PATCH 1/2 python_mesonpy.bbclass: move to oe-core

This is now the declared PEP-517 build-backend for python3-numpy

Move the support into oe-core

---
 meta-python/classes/python_mesonpy.bbclass | 52 ----------------------
 1 file changed, 52 deletions(-)
 delete mode 100644 meta-python/classes/python_mesonpy.bbclass
meta-python/classes/python_mesonpy.bbclass deleted +0 -52
deleted file mode 100644
index 131fa74bed..0000000000
@@ -1,52 +0,0 @@
-#
-# 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.34.1
author
#2 lore raw

PATCH 2/2 python3-meson-python: move to oe-core

In reply to Tim Orling

As part of the move of python_mesonpy.bbclass to oe-core.

python3-numpy in oe-core declares "mesonpy" as the build-backend in pyproject.toml.

This is part of an overall move to replace usage of setuptools3.bbclass.

---
 .../python/python3-meson-python_0.15.0.bb     | 23 -------------------
 1 file changed, 23 deletions(-)
 delete mode 100644 meta-python/recipes-devtools/python/python3-meson-python_0.15.0.bb
meta-python/recipes-devtools/python/python3-meson-python_0.15.0.bb deleted +0 -23
deleted file mode 100644
index c4b01a3832..0000000000
@@ -1,23 +0,0 @@
-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] = "fddb73eecd49e89c1c41c87937cd89c2d0b65a1c63ba28238681d4bd9484d26f"
-
-DEPENDS:remove:class-native = "python3-meson-python-native"
-
-RDEPENDS:${PN} = " \
-	meson ninja patchelf \
-	python3-pyproject-metadata \
-"
-
-BBCLASSEXTEND = "native nativesdk"
Signature · 1 line
2.34.1