diff options
author | Maks Verver | 2025-01-03 18:39:58 +0100 |
---|---|---|
committer | Maks Verver | 2025-01-03 18:39:58 +0100 |
commit | ea1c5d602f5c239fa90799c9464feedb22dd3590 (patch) | |
tree | d4b87a73a589a15bd2c0cb952ef05c6177e51694 | |
download | aur-ea1c5d602f5c239fa90799c9464feedb22dd3590.tar.gz |
Add meson-python build backend for PyPy.
This is the PyPy equivalent of the meson-python package for CPython.
-rw-r--r-- | .SRCINFO | 22 | ||||
-rw-r--r-- | PKGBUILD | 41 | ||||
-rw-r--r-- | remove-meson-dependency.patch | 34 |
3 files changed, 97 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..d431a8e5f509 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,22 @@ +pkgbase = meson-pypy3 + pkgdesc = Meson PEP 517 Python build backend + pkgver = 0.17.1 + pkgrel = 1 + url = https://github.com/mesonbuild/meson-python + arch = any + groups = python-build-backend + license = MIT + makedepends = git + makedepends = ninja + makedepends = pypy3-build + makedepends = pypy3-installer + depends = meson + depends = patchelf + depends = pypy3 + depends = pypy3-packaging + depends = pypy3-pyproject-metadata + optdepends = python-colorama: colored output + source = git+https://github.com/mesonbuild/meson-python#tag=0.17.1 + sha256sums = aa4b6f8f90c6e5bdcb6991efdb4e1eed4b9bcc50583c9611375ee589696b5854 + +pkgname = meson-pypy3 diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..d900497cffea --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,41 @@ +# Maintainer: Maks Verver <maks@verver.ch> + +pkgname=meson-pypy3 +_name=meson-python +pkgver=0.17.1 +pkgrel=1 +pkgdesc='Meson PEP 517 Python build backend' +arch=(any) +url='https://github.com/mesonbuild/meson-python' +groups=(python-build-backend) +license=(MIT) +depends=(meson + patchelf + pypy3 + pypy3-packaging + pypy3-pyproject-metadata) +makedepends=(git + ninja + pypy3-build + pypy3-installer) +optdepends=('python-colorama: colored output') +source=(git+https://github.com/mesonbuild/$_name#tag=$pkgver + remove-meson-dependency.patch) +sha256sums=('aa4b6f8f90c6e5bdcb6991efdb4e1eed4b9bcc50583c9611375ee589696b5854' + 'e1c472dcee29d131a8e4e2b5724f97a2ca3394cbac30a6ba864a34d1b759ef1b') + +prepare() { + cd "$_name" + patch -i ../remove-meson-dependency.patch +} + +build() { + cd "$_name" + pypy3 -m build --wheel --no-isolation +} + +package() { + cd "$_name" + pypy3 -m installer --destdir="$pkgdir" dist/*.whl + install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname +} diff --git a/remove-meson-dependency.patch b/remove-meson-dependency.patch new file mode 100644 index 000000000000..30df9a175c7f --- /dev/null +++ b/remove-meson-dependency.patch @@ -0,0 +1,34 @@ +Removes the meson dependencies from pyproject.toml for the meson-pypy3 package. + +This dependency doesn't resolve, because meson is installed for CPython, not +PyPy, so the PyPy module tools do not know about it. This is not a problem +since the meson-pypy3 backend doesn't import meson directly, but instead invokes +the /usr/bin/meson script which runs under CPython. + +In short, meson-pypy3 only requires meson to be installed globally, not as a PyPy +package specifically, and since the PKGBUILD dependencies ensures that meson is +installed as a dependency, it's safe to remove it here. + + - Maks Verver. + + +--- pyproject.toml.orig 2025-01-03 18:12:19.369524633 +0100 ++++ pyproject.toml 2025-01-03 18:12:45.889803200 +0100 +@@ -6,8 +6,6 @@ + build-backend = 'mesonpy' + backend-path = ['.'] + requires = [ +- 'meson >= 0.63.3; python_version < "3.12"', +- 'meson >= 1.2.3; python_version >= "3.12"', + 'packaging >= 19.0', + 'pyproject-metadata >= 0.7.1', + 'tomli >= 1.0.0; python_version < "3.11"', +@@ -33,8 +31,6 @@ + ] + + dependencies = [ +- 'meson >= 0.63.3; python_version < "3.12"', +- 'meson >= 1.2.3; python_version >= "3.12"', + 'packaging >= 19.0', + 'pyproject-metadata >= 0.7.1', + 'tomli >= 1.0.0; python_version < "3.11"', |