1 # Maintainer: Jonas Witschel <diabonas@archlinux.org>
4 _tag=ebf792a233a50d639b13e5f7c9a1c1fe988e7476 # git rev-parse "$pkgver"
6 pkgdesc='WeeChat Matrix protocol script written in Python'
8 url='https://github.com/poljar/weechat-matrix'
10 depends=('python' 'python-atomicwrites' 'python-attrs' 'python-cachetools' 'python-logbook' 'python-matrix-nio'
11 'python-olm' 'python-peewee' 'python-pygments' 'python-pyopenssl' 'python-webcolors' 'weechat')
12 makedepends=('git' 'python-build' 'python-installer' 'python-poetry-core')
13 checkdepends=('python-hypothesis' 'python-pytest')
14 optdepends=('python-aiohttp: matrix_sso_helper support'
15 'python-magic: matrix_upload support'
16 'python-requests: matrix_decrypt and matrix_upload support'
17 'xdg-utils: default plumber for matrix_decrypt')
18 install='weechat-matrix.install'
20 "git+$url.git?signed#tag=$_tag"
21 0001-Switch-to-correct-build-system-definition.patch
24 '65be133214b4497fead85e718d3dc57502063f4411c759d878e7132b2cb49befe5515714edda188169710c246537d893611aa8ef6faeaeab23762302e6e783b6')
25 validpgpkeys=('689A3B5BC6560AB4C99A2A0581314DA807EF4E22') # Damir Jelić (poljar) <poljar@termina.org.uk>
29 git describe | sed 's/\([^-]*-\)g/r\1/;s/-/./g'
33 # fix PEP517 build-system definition: https://github.com/poljar/weechat-matrix/pull/340/files
34 patch -Np1 -d $pkgname -i ../0001-Switch-to-correct-build-system-definition.patch
37 sed -ri 's|#!/usr/bin/env( -S)? python3|#!/usr/bin/python3|' contrib/*.py
39 # Remove unnecessary dependency version pinning
40 sed -i 's/= "^[0-9.]*"/= "*"/' pyproject.toml
42 # SSLContext.set_npn_protocols broken in Python 3.10
43 # (https://github.com/poljar/weechat-matrix/issues/308)
44 git cherry-pick --no-commit 4e585d5f4628e6fbeba9ec4560b440d731e076f5
49 python -m build --wheel --no-isolation --skip-dependency-check
59 python -m installer --destdir="$pkgdir" dist/*.whl
60 install -Dm755 main.py "$pkgdir/usr/share/weechat/python/weechat-matrix.py"
61 for _script in matrix_decrypt matrix_sso_helper matrix_upload
63 install -Dm755 "contrib/$_script.py" "$pkgdir/usr/bin/$_script"
65 install -Dm644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname"