aboutsummaryrefslogtreecommitdiffstats
path: root/community/py3-twisted/APKBUILD
blob: 7eee51e943b63b8fbbabcdd4a4282c3e93bab52d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=py3-twisted
_pkgname=Twisted
pkgver=19.10.0
pkgrel=0
pkgdesc="Asynchronous networking framework written in Python3"
url="http://twistedmatrix.com/"
arch="all"
license="MIT"
depends="python3 py3-cryptography py3-zope-interface py3-constantly py3-incremental py3-attrs
	py3-pyhamcrest py3-hyperlink py3-automat"
makedepends="libtirpc-dev py3-setuptools python3-dev cython"
checkdepends="xvfb-run py3-appdirs tzdata py3-asn1 py3-bcrypt"
subpackages="$pkgname-doc"
source="https://twistedmatrix.com/Releases/$_pkgname/${pkgver%.*}/$_pkgname-$pkgver.tar.bz2
	remove-locale-dependent-tests.patch
	disable-failing-test.patch
	fix-test-suite-python38.patch
	"
builddir="$srcdir"/"$_pkgname"-$pkgver

replaces="py-twisted" # Backwards compatibility
provides="py-twisted=$pkgver-r$pkgrel" # Backwards compatibility

prepare() {
	default_prepare
	# Remove tests that always fail due to our not-upstream testing procedure
	# these tests if invoking the Twisted binary and twisted.trial tests work
	rm -f src/twisted/test/test_main.py
	rm $(grep -lr "Generated by Cython" .)
}

build() {
	find -name '*.pyx' -exec cython {} \;
	CFLAGS="$CFLAGS $(pkgconf --cflags libtirpc)" python3 setup.py build
}

check() {
	PYTHONPATH="$(echo $PWD/build/lib.*)" xvfb-run python3 \
		-c 'from twisted.scripts.trial import run; run()' twisted
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"

	_mans="pyhtmlizer.1 trial.1 twistd.1"
	for _man in $_mans; do
		install -m644 -D "$builddir"/docs/core/man/$_man \
			"$pkgdir"/usr/share/man/man1/$_man
	done
}

doc() {
	replaces="py-twisted-doc" # Backwards compatibility
	default_doc
}

sha512sums="de8d7fd0b2081cebeff68b060c8469377011648bc563a94a993d3530fb007ed42c3a54925c9a10c465ee7a3065cc9108ace12d10d358223fab13494becb9ac4b  Twisted-19.10.0.tar.bz2
b8532d6ad572c7f13cddce35e2aa03d28b7e2b22ace7976e92e617aa26f15ea518f8cbd5efd560f841a585356323815d39257a49b39c9caae505ceff44c4435c  remove-locale-dependent-tests.patch
2bacc91852875fa0b090e0a685204846485b32e3c41a4b0b933c90cf6736ba1a34bd04c3151dae256a1b2046c757985952bb050565b8dcd428199a9f7ddbcfca  disable-failing-test.patch
0e0434c054f711ae4b4d2d29aed8c40f467610b6d0cdbf0525d8255147de30e46298f18df2ed3c2de5719a6c607a12c98ca70b9235fb0c8e64569a313df1b902  fix-test-suite-python38.patch"