--- PKGBUILD 2023-04-15 10:53:55.451373551 +0200 +++ PKGBUILD 2023-04-15 12:41:57.804723992 +0200 @@ -3,33 +3,46 @@ pkgname=magic-wormhole pkgver=0.12.0 -pkgrel=8 +pkgrel=9 pkgdesc="Securely transfer data between computers" arch=('any') url="https://github.com/magic-wormhole/magic-wormhole" +_gitcommit=52ee3ce1050213934e536b91e14356f17532081d license=('MIT') depends=('python-click' 'python-cffi' 'python-autobahn' 'python-tqdm' 'python-hkdf' 'python-pynacl' 'python-spake2' 'python-humanize' 'python-idna' 'python-service-identity' 'python-txtorcon' - 'python-pyopenssl' 'python-setuptools') + 'python-pyopenssl') +makedepends=('git' 'python-build' 'python-installer' 'python-wheel' 'python-setuptools') checkdepends=('python-mock' 'python-magic-wormhole-transit-relay' 'python-magic-wormhole-mailbox-server') -source=(${pkgname}-${pkgver}.tar.gz::"https://github.com/magic-wormhole/magic-wormhole/archive/refs/tags/${pkgver}.tar.gz") -sha512sums=('141244e746b0718f2c9417e8f7de6a714b0feb051aea8c7950ea0d1bc5d2e24e922bed29544fe76aa61b06aa2ce2b5f330824017af8c6030813415e6c004c716') +source=(${pkgname}::"git+${url}#commit=${_gitcommit}") +sha512sums=('SKIP') + +prepare() { + cd "${pkgname}" + git cherry-pick -n bc6537e758774207aec8b1ea18cd89f2a02849ca # test_cli: ignore deprecation noise for py2.7/py3.5 so tests won't fail + git cherry-pick -n e6f9e058c844b83f94e2d1c97a868f9a3b8123ad # fix test +} + +pkgver() { + cd ${pkgbase} + git describe --tags --match "$pkgver" +} build() { - cd "${pkgname}-${pkgver}" - python setup.py build + cd "${pkgname}" + python -m build --wheel } check() { - cd "${pkgname}-${pkgver}" - python setup.py test + cd "${pkgname}/src" + python -m unittest discover wormhole.test "test_*" "$PWD" } package() { - cd "${pkgname}-${pkgver}" - python setup.py install --root="${pkgdir}/" --optimize=1 --skip-build + cd "${pkgname}" + python -m installer --destdir="${pkgdir}/" dist/*.whl install -vDm 644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE install -vDm 644 docs/*.md -t "${pkgdir}/usr/share/doc/${pkgname}" install -vDm 644 docs/wormhole.1 -t "${pkgdir}/usr/share/man/man1"