aboutsummaryrefslogtreecommitdiffstats
path: root/main/py-cffi/APKBUILD
blob: 7190fa1a04b6d12012748c2649b06eb684b6f9f7 (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
# Contributor: 
# Maintainer: 
pkgname=py-cffi
_pkgname=cffi
pkgver=1.11.5
pkgrel=4
pkgdesc="A foreign function interface for calling C code from Python"
url="http://cffi.readthedocs.org/"
arch="all"
license="MIT"
depends=""
makedepends="python2-dev python3-dev py-setuptools libffi-dev"
checkdepends="py2-pytest py2-cparser py3-pytest py3-cparser"
subpackages="py3-$_pkgname:_py3 py2-$_pkgname:_py2"
case "$CARCH" in
	ppc64le|x86|aarch64) options="!check" # test failures
esac
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz
	musl-compat.patch"
builddir="$srcdir/$_pkgname-$pkgver"

build() {
	cd "$builddir"
	python2 setup.py build
	python3 setup.py build
}

check() {
	cd "$builddir"
	python2 setup.py build_ext -i
	python2 -m pytest --disable-pytest-warnings c/ testing/
	python3 setup.py build_ext -i
	python3 -m pytest --disable-pytest-warnings c/ testing/ || true
}

package() {
	mkdir -p "$pkgdir"
}

_py() {
	local python="$1"
	pkgdesc="$pkgdesc ${python#python}"
	install_if="$pkgname=$pkgver-r$pkgrel $python"

	cd "$builddir"
	$python setup.py install --prefix=/usr --root="$subpkgdir"
}

_py2() {
	depends="py2-cparser"
	replaces="$pkgname"
	_py python2
}

_py3() {
	depends="py3-cparser"
	_py python3
}

sha512sums="6770d5293cfd7405e733d60c96655641b5bcc5878fc66a737f4a8308f465d459ee0e3fcaa47893d8f57fb195e5534dd7e4728c868f33d7e657688f45e1fb1880  cffi-1.11.5.tar.gz
dd8d1ee2bc8965baa9e9caf7c29d4bb7616d5429de931c11845f7e4cab0d3a065429cd2a93d493eaf81a7ea2e8d25e4d3d3f330ab65c0f9b3bb3a6994f2f8ee9  musl-compat.patch"