44 lines
1.6 KiB
Bash

# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: Felix Yan <felixonmars@archlinux.org>
pkgname=python-xmlsec
pkgver=1.3.14
pkgrel=1
pkgdesc="Python bindings for the XML Security Library"
url="https://github.com/mehcode/python-xmlsec"
license=('MIT')
arch=(x86_64 powerpc64le powerpc64 powerpc riscv64)
depends=('glibc' 'libxml2' 'python-lxml' 'xmlsec')
makedepends=('git' 'python-build' 'python-installer' 'python-pkgconfig' 'python-setuptools-scm' 'python-wheel')
checkdepends=('python-hypothesis' 'python-pytest')
source=("git+https://github.com/mehcode/python-xmlsec.git#tag=$pkgver")
sha512sums=('809168e0b2501a3220640a2f092e38ee749636e4daeed5ba9eb247e0ef88aeedc3cd9c08d54db1a3a073303b940c592d4d0a9a6df4999fa55c2abf3745bc698d')
build() {
cd python-xmlsec
python -m build --wheel --no-isolation
}
check() {
local pytest_options=(
# https://github.com/xmlsec/python-xmlsec/issues/84
--deselect 'tests/test_doc_examples.py::test_doc_example[encrypt.py]'
--deselect 'tests/test_doc_examples.py::test_doc_example[sign.py]'
--deselect 'tests/test_doc_examples.py::test_doc_example[verify.py]'
# https://github.com/xmlsec/python-xmlsec/issues/244
--deselect tests/test_ds.py::TestSignContext::test_sign_case5
)
local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
cd $pkgname
python -m installer --destdir=test_dir dist/*.whl
export PYTHONPATH="test_dir/$site_packages:$PYTHONPATH"
pytest -vv "${pytest_options[@]}"
}
package() {
cd python-xmlsec
python -m installer --destdir="$pkgdir" dist/*.whl
install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
}