diff options
-rw-r--r-- | community/py-lz4/01-system_lz4.patch | 36 | ||||
-rw-r--r-- | community/py-lz4/02-tests.patch | 24 | ||||
-rw-r--r-- | community/py-lz4/APKBUILD | 64 |
3 files changed, 40 insertions, 84 deletions
diff --git a/community/py-lz4/01-system_lz4.patch b/community/py-lz4/01-system_lz4.patch deleted file mode 100644 index 62a9c9dea9..0000000000 --- a/community/py-lz4/01-system_lz4.patch +++ /dev/null @@ -1,36 +0,0 @@ -Last-Update: 2014-08-10 -Forwarded: not-needed -Author: Dmitry Smirnov <onlyjob@member.fsf.org> -Description: un-bundle liblz4 and link to the system one - ---- a/setup.py -+++ b/setup.py -@@ -16,11 +16,11 @@ - packages=find_packages('src'), - package_dir={'': 'src'}, - ext_modules=[ - Extension('lz4', [ -- 'src/lz4.c', -- 'src/lz4hc.c', - 'src/python-lz4.c' -+ ], libraries=[ -+ "lz4", - ], extra_compile_args=[ - "-std=c99", - "-O3", - "-Wall", ---- a/src/python-lz4.c -+++ b/src/python-lz4.c -@@ -32,10 +32,10 @@ - #include <Python.h> - #include <stdlib.h> - #include <stdint.h> - #include <math.h> --#include "lz4.h" --#include "lz4hc.h" -+#include <lz4.h> -+#include <lz4hc.h> - #include "python-lz4.h" - - #define MAX(a, b) ((a) > (b) ? (a) : (b)) - diff --git a/community/py-lz4/02-tests.patch b/community/py-lz4/02-tests.patch deleted file mode 100644 index dc1cb06926..0000000000 --- a/community/py-lz4/02-tests.patch +++ /dev/null @@ -1,24 +0,0 @@ -Last-Update: 2014-08-10 -Origin: https://github.com/steeve/python-lz4/blob/master/tests/test.py -Forwarded: not-needed -Author: Dmitry Smirnov <onlyjob@member.fsf.org> -Description: add basic test - ---- /dev/null -+++ b/tests/test.py -@@ -0,0 +1,15 @@ -+import lz4 -+import sys -+ -+ -+import unittest -+import os -+ -+class TestLZ4(unittest.TestCase): -+ -+ def test_random(self): -+ DATA = os.urandom(128 * 1024) # Read 128kb -+ self.assertEqual(DATA, lz4.loads(lz4.dumps(DATA))) -+ -+if __name__ == '__main__': -+ unittest.main() diff --git a/community/py-lz4/APKBUILD b/community/py-lz4/APKBUILD index 91eb14d243..eeba813350 100644 --- a/community/py-lz4/APKBUILD +++ b/community/py-lz4/APKBUILD @@ -1,40 +1,56 @@ # Contributor: Stuart Cardall <developer@it-offshore.co.uk> # Maintainer: Stuart Cardall <developer@it-offshore.co.uk> pkgname=py-lz4 -pkgver=0.7.0 +pkgver=0.8.2 _pkgname=${pkgname#py-} pkgrel=0 pkgdesc="LZ4 Bindings for Python" url="https://pypi.python.org/pypi/lz4" -arch="all" +arch="noarch" license="BSD" -depends="python" -depends_dev="" -makedepends="python-dev py-setuptools lz4-dev" -install="" -subpackages="" -source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz - 01-system_lz4.patch - 02-tests.patch - " - -builddir="$srcdir"/$_pkgname-$pkgver +makedepends="python2-dev python3-dev py-setuptools lz4-dev" +subpackages="py3-${pkgname/py-/}:_py3 py2-${pkgname/py-/}:_py2 $pkgname-tests:_tests" +source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz" +builddir="$srcdir/$_pkgname-$pkgver" + build() { cd "$builddir" - python setup.py build || return 1 + python2 setup.py build || return 1 + python3 setup.py build || return 1 } package() { + mkdir -p "$pkgdir" +} + +_py() { + local python=$1 + pkgdesc="$pkgdesc ${python#python}" + depends="$python" + arch="all" + install_if="$pkgname=$pkgver-r$pkgrel $python" + cd "$builddir" - python setup.py install --prefix=/usr --root="$pkgdir" || return 1 + $python setup.py install --prefix=/usr --root="$subpkgdir" +} + +_py2() { + replaces="$pkgname" + _py python2 +} + +_py3() { + _py python3 +} + +_tests() { + pkgdesc="$pkgdesc (tests)" + arch="noarch" + + mkdir -p "$subpkgdir"/usr/share/$pkgname + mv "$builddir"/tests "$subpkgdir"/usr/share/$pkgname } -md5sums="e32842a49d5254f6918567197a704492 lz4-0.7.0.tar.gz -fda5c197a766d61d0b1ffcaaf54552e3 01-system_lz4.patch -cba5b0e90428e8451ddbc6f3ba480fbe 02-tests.patch" -sha256sums="cd225744298568fd217577fc14a326a24835412374dadb5060db48f1af43eb48 lz4-0.7.0.tar.gz -b6efbab93b4bbf69c5de40a61993a8ca332a4115e87448ad51907efd74bd5bbb 01-system_lz4.patch -f0573be2656fcad5afdb7ecb25d7ce939505cfcfc2c9ad9d9bde21c9af3151fe 02-tests.patch" -sha512sums="fd7adc4919e70259e5b23b15919c4932354a4518360315a8d6c15c58cdccf21257fb6069bdf20e86a2461f254b50f4abd7296330fd77647ecc2ca49500eedd11 lz4-0.7.0.tar.gz -8e30ebe4b0074195f66c9f174006b7730a2a172f76d863ad4dbf0c282f8dc342ecc6e33bf0e1f691bbdace9ef6a13969a3271f39fe8bdbe2f4234397ca1fc0b8 01-system_lz4.patch -68e84522478af8bdf741b45cdc4b4b4367fd7831452c8f0e5b127f58cc26e698e83931dc43d3016e2714d7497de7f6c112c720e379ce5c411b2f67e89b298ed8 02-tests.patch" +md5sums="50dc6c2cb99c43ce6ed95cf6ae965f0e lz4-0.8.2.tar.gz" +sha256sums="6bf49061d73d69c453e892ace4586b99ccffc7de558f921d18b9418235692ac7 lz4-0.8.2.tar.gz" +sha512sums="e516d5c3309f214fa422b040a0aacdda079395624dd4f5548ed7af637b1594012aac75b309cef260b41c10a623410f815fc089b54ca5d80955d5f2ead12841b1 lz4-0.8.2.tar.gz" |