46 lines
1.4 KiB
Bash
46 lines
1.4 KiB
Bash
# Maintainer: Daniel M. Capella <polyzen@archlinux.org>
|
|
|
|
pkgname=python-lsprotocol
|
|
_name=${pkgname#python-}
|
|
pkgver=2025.0.0
|
|
pkgrel=3
|
|
pkgdesc='Python types for Language Server Protocol'
|
|
arch=('any')
|
|
url=https://github.com/microsoft/lsprotocol
|
|
license=('MIT')
|
|
depends=('python-cattrs')
|
|
makedepends=('git' 'python-build' 'python-flit-core' 'python-installer')
|
|
checkdepends=('python-jsonschema' 'python-pyhamcrest' 'python-pytest')
|
|
source=("git+$url.git#tag=$pkgver")
|
|
b2sums=('ea9f4e871d68f62f174d2f8e2efad7bc6b9c4f54216022047e425531525c676577e4bdd657e8eaad86eea944ab6d996da5ae80badc929910b849b52c0ecd9bb2')
|
|
|
|
build() {
|
|
cd "$_name"/packages/python
|
|
python -m build --wheel --skip-dependency-check --no-isolation
|
|
}
|
|
|
|
check() {
|
|
cd "$_name"
|
|
pytest tests/python
|
|
}
|
|
|
|
package() {
|
|
cd "$_name"/packages/python
|
|
python -m installer --destdir="$pkgdir" dist/*.whl
|
|
|
|
# Symlink license file
|
|
local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
|
|
install -d "$pkgdir"/usr/share/licenses/$pkgname
|
|
ln -s "$site_packages"/"$_name"-$pkgver.dist-info/LICENSE \
|
|
"$pkgdir"/usr/share/licenses/$pkgname/LICENSE
|
|
}
|
|
|
|
source[0]="$_name.tar.xz"
|
|
b2sums[0]="SKIP"
|
|
source+=('cattrs-25.patch')
|
|
b2sums+=('2488085c60aa113192beb749e13703654fd8ec459013a94bbf855ec5b887986e7425cfea60e41ef88cfd98fbda6d3a57b775e944c1192bd5d9928cc96decaacf')
|
|
prepare(){
|
|
cd "$_name"
|
|
patch -p1 < $srcdir/cattrs-25.patch
|
|
}
|