aboutsummaryrefslogtreecommitdiffstats
path: root/testing/py-axolotl/APKBUILD
blob: 67d1e234f8def6a6ff67c5311382f899c33a0843 (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
# Maintainer: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
pkgname=py-axolotl
_pkgname="python-${pkgname#py-}"
pkgver=0.1.42
pkgrel=0
pkgdesc="Python port of libsignal-protocol-java"
url="https://github.com/tgalal/python-axolotl"
arch="noarch"
license="GPL-3.0-only"
depends="py-crypto py-protobuf py-axolotl-curve25519"
makedepends="py-setuptools python2-dev python3-dev libressl-dev"
checkdepends="py-cryptography py-cparser"
subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3"
source="$pkgname-$pkgver.tar.gz::https://github.com/tgalal/$_pkgname/archive/$pkgver.tar.gz"
builddir="$srcdir"/$_pkgname-$pkgver

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

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

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

_py2() {
	depends="${depends//py-/py2-}"
	_py python2
}

_py3() {
	depends="${depends//py-/py3-}"
	_py python3
}

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

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

sha512sums="db9e1cfab87d690619a672b1782942a18b12b17af555959c17bcc3e2581e9c689c57becc0ea884a1129df9dace17684ba03de38b81f8c8c65cab27962ebdb6c5  py-axolotl-0.1.42.tar.gz"