1 # Maintainer: Felix Yan <felixonmars@archlinux.org>
2 # Contributor: Ionut Biru <ibiru@archlinux.org>
3 # Contributor: Juergen Hoetzel <juergen@archlinux.org>
4 # Contributor: Douglas Soares de Andrade <douglas@archlinux.org>
9 pkgdesc="Asynchronous networking framework written in Python"
11 url="https://twistedmatrix.com/"
13 depends=('python-zope-interface' 'python-constantly' 'python-incremental' 'python-automat'
14 'python-hyperlink' 'python-attrs' 'python-typing_extensions')
15 makedepends=('python-setuptools')
16 optdepends=('python-pyopenssl: for TLS client hostname verification'
17 'python-service-identity: for TLS client hostname verification'
18 'python-idna: for TLS client hostname verification'
19 'python-cryptography: for using conch'
20 'python-pyasn1: for using conch'
21 'python-appdirs: for using conch'
22 'python-bcrypt: for using conch'
23 'python-h2: for http2 support'
24 'python-priority: for http2 support'
25 'python-pyserial: for serial support'
26 'tk: for using tkconch')
27 checkdepends=('python-pyhamcrest' 'subversion' 'xorg-server-xvfb' 'tk' 'openssh' 'git' 'gtk3'
28 'python-gobject' 'python-subunit' 'python-h2' 'python-priority' 'python-cryptography'
29 'python-idna' 'python-pyasn1' 'python-pyserial' 'python-bcrypt'
30 'python-cython-test-exception-raiser' 'python-pyopenssl')
31 # Conflicts with the command line tools used to be provided by the python2 package.
32 conflicts=("python2-twisted<=20.3.0-3")
33 source=("https://github.com/twisted/twisted/archive/twisted-$pkgver.tar.gz"
35 sha512sums=('a946769a6bc6c72af26e7763b9e0675788f134b4d005ea89d935da1b1d5f60d92c84fdb2615e442e7da2b98291ee8a63d5236ec7ba72ef04ad3f847b092feecb'
36 '5402256d06cbee74d575bdc57b8a3df2224aad531b083050c7a4e66e61b6ed2610e13de6a4346719318c076cabffce473e5dd0e14638cee6fd1cf930a50608c5')
39 cd twisted-twisted-$pkgver
40 # Avoid currentThread() DeprecationWarning (breaks tests in other packages)
41 # Related upstream PR: https://github.com/twisted/twisted/pull/1671
42 patch -Np1 -i ../python310.patch
44 sed -i 's/, < 4.0//;s/, < 2.0//' setup.cfg
48 cd twisted-twisted-$pkgver
53 export LC_CTYPE=en_US.UTF-8
55 # tests use the underlying function from the 'python -m twisted.trial' module, to prevent loading system entry points
56 PYTHONPATH="$srcdir/twisted-twisted-$pkgver/build/lib" xvfb-run python -c 'from twisted.scripts.trial import run; run()' twisted || echo "Tests failed"
60 cd twisted-twisted-$pkgver
61 python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1
62 install -D -m644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE