aboutsummaryrefslogtreecommitdiffstats
path: root/community/py-msgpack
diff options
context:
space:
mode:
authorLeo <thinkabit.ukim@gmail.com>2019-05-03 12:06:14 -0300
committerprspkt <prspkt@protonmail.com>2019-05-06 14:33:53 +0300
commit2b17e52599512cd24c7ee55ec5a52c835e057617 (patch)
tree3619139733cfef5a7bb1a3233f3b200c2c98a787 /community/py-msgpack
parentcb7c14ad31c88070ff53fd7ea757085ecf788f09 (diff)
community/py-msgpack: use C extension and modernize
- Use C extension with Cython - Fix check - separate makedepends and checkdepends
Diffstat (limited to 'community/py-msgpack')
-rw-r--r--community/py-msgpack/APKBUILD24
1 files changed, 15 insertions, 9 deletions
diff --git a/community/py-msgpack/APKBUILD b/community/py-msgpack/APKBUILD
index bc0c6a426c7..569e9bdd163 100644
--- a/community/py-msgpack/APKBUILD
+++ b/community/py-msgpack/APKBUILD
@@ -3,30 +3,36 @@
pkgname=py-msgpack
_pkgname=msgpack-python
pkgver=0.6.1
-pkgrel=1
+pkgrel=2
pkgdesc="A Python module for MessagePack serialization/deserialization"
url="https://msgpack.org/"
arch="all"
license="Apache-2.0"
# Dependency (pluggy) to run test is not available
-options="!check"
depends=""
-makedepends="python2-dev python3-dev py-setuptools pytest py3-pytest"
+makedepends="python2-dev python3-dev py-setuptools py3-setuptools py-cython py3-cython"
+checkdepends="pytest py3-pytest"
subpackages="py3-${pkgname/py-/}:_py3 py2-${pkgname/py-/}:_py2"
source="$_pkgname-$pkgver.tar.gz::https://github.com/msgpack/msgpack-python/archive/v$pkgver.tar.gz"
builddir="$srcdir/msgpack-python-$pkgver"
build() {
- cd "$builddir"
python2 setup.py build
python3 setup.py build
}
-check() {
- cd "$builddir"
- pytest test
- pytest-3 test
-}
+check() {
+ local _pyarch
+
+ case "$CARCH" in
+ x86_64|aarch64) _pyarch="$CARCH" ;;
+ x86) _pyarch=i686 ;;
+ armhf|armv7) _pyarch=armv8l ;;
+ esac
+
+ env PYTHONPATH="${PWD}/build/lib.linux-$_pyarch-2.7" pytest test
+ env PYTHONPATH="${PWD}/build/lib.linux-$_pyarch-3.7" pytest-3 test
+}
package() {
mkdir -p "$pkgdir"