# Maintainer: fossdd <fossdd@pwned.life>
pkgname=py3-meson-python
pkgver=0.17.1
pkgrel=0
pkgdesc="Meson PEP 517 Python build backend"
url="https://github.com/mesonbuild/meson-python"
arch="noarch"
license="MIT"
depends="
	meson
	py3-pyproject-metadata
	python3
	"
checkdepends="
	cython
	git
	patchelf
	py3-pytest
	py3-pytest-mock
	py3-wheel
	python3-dev
	"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/mesonbuild/meson-python/archive/refs/tags/$pkgver.tar.gz"
builddir="$srcdir/meson-python-$pkgver"

build() {
	abuild-meson . output
	meson compile -C output
}

check() {
	# these require pip
	pytest \
		--deselect tests/conftest.py \
		--deselect tests/test_pep518.py \
		--deselect tests/test_editable.py::test_editable_rebuild \
		--deselect tests/test_editable.py::test_editable_verbose \
		-k 'not test_user_args'
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
	python3 -m compileall "$pkgdir"/usr/lib
}

sha512sums="
bd5f4c807468b81b3630eeb6973c2a574473c22298eb2c43d30b67b7503ce77fd79d4509a8f1b0186197622d281279a9c3aa5d9d1c2286d46b7aea1ff2461ae5  py3-meson-python-0.17.1.tar.gz
"
