aboutsummaryrefslogtreecommitdiffstats
path: root/community/py3-hiredis
diff options
context:
space:
mode:
Diffstat (limited to 'community/py3-hiredis')
-rw-r--r--community/py3-hiredis/APKBUILD35
-rw-r--r--community/py3-hiredis/hiredis-0.14-compat.patch31
-rw-r--r--community/py3-hiredis/system-hiredis.patch14
3 files changed, 80 insertions, 0 deletions
diff --git a/community/py3-hiredis/APKBUILD b/community/py3-hiredis/APKBUILD
new file mode 100644
index 0000000000..52de17544b
--- /dev/null
+++ b/community/py3-hiredis/APKBUILD
@@ -0,0 +1,35 @@
+# Maintainer: Eivind Uggedal <eu@eju.no>
+pkgname=py3-hiredis
+_pkgname=${pkgname#py3-}
+pkgver=1.0.1
+pkgrel=0
+pkgdesc="Python extension that wraps hiredis"
+url="https://github.com/redis/hiredis-py"
+arch="all"
+license="BSD-3-Clause"
+makedepends="python3-dev py3-setuptools hiredis-dev"
+source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz
+ system-hiredis.patch
+ hiredis-0.14-compat.patch"
+
+# keep these til after alpine v3.11
+provides="py-$_pkgname=$pkgver-r$pkgrel" # for backward compatibility
+replaces="py-$_pkgname" # for backward compatibility
+
+builddir="$srcdir"/$_pkgname-$pkgver
+
+build() {
+ python3 setup.py build
+}
+
+check() {
+ python3 test.py
+}
+
+package() {
+ python3 setup.py install --prefix=/usr --root="$pkgdir"
+}
+
+sha512sums="8aa5e29b09f42826d746857d55b8042b40ffa3977386b0f8b2ea1b2ede0c28337f3df4bbd177192d8873570810bc9d0987f1f2b29f094f27adaa4aaf409c3a6b hiredis-1.0.1.tar.gz
+4be1599851215547b4b994a966087024cc86b495dbfdcb9807dabcffb5505509f25398c55a07b2a8fb7221cf9c5d27738a38f8c87fe2e37d991a2de3cfa38451 system-hiredis.patch
+a066ceab985be6ae87f0c30b98a496e6929909ac5d94b21fac9544bc8f649b0c1f0b66760441a90dc8bc50f4d748775f3d3a042fe8a4b466b5371bfb49b16f7a hiredis-0.14-compat.patch"
diff --git a/community/py3-hiredis/hiredis-0.14-compat.patch b/community/py3-hiredis/hiredis-0.14-compat.patch
new file mode 100644
index 0000000000..86e0d3f585
--- /dev/null
+++ b/community/py3-hiredis/hiredis-0.14-compat.patch
@@ -0,0 +1,31 @@
+--- hiredis-1.0.0/src/reader.c
++++ hiredis-1.0.0_p/src/reader.c
+@@ -167,7 +167,7 @@
+ static void Reader_dealloc(hiredis_ReaderObject *self) {
+ // we don't need to free self->encoding as the buffer is managed by Python
+ // https://docs.python.org/3/c-api/arg.html#strings-and-buffers
+- redisReplyReaderFree(self->reader);
++ redisReaderFree(self->reader);
+ Py_XDECREF(self->protocolErrorClass);
+ Py_XDECREF(self->replyErrorClass);
+
+@@ -272,7 +272,7 @@
+ goto error;
+ }
+
+- redisReplyReaderFeed(self->reader, (char *)buf.buf + off, len);
++ redisReaderFeed(self->reader, (char *)buf.buf + off, len);
+ PyBuffer_Release(&buf);
+ Py_RETURN_NONE;
+
+@@ -291,8 +291,8 @@
+ return NULL;
+ }
+
+- if (redisReplyReaderGetReply(self->reader, (void**)&obj) == REDIS_ERR) {
+- errstr = redisReplyReaderGetError(self->reader);
++ if (redisReaderGetReply(self->reader, (void**)&obj) == REDIS_ERR) {
++ errstr = redisReaderGetError(self->reader);
+ /* protocolErrorClass might be a callable. call it, then use it's type */
+ err = createError(self->protocolErrorClass, errstr, strlen(errstr));
+ if (err != NULL) {
diff --git a/community/py3-hiredis/system-hiredis.patch b/community/py3-hiredis/system-hiredis.patch
new file mode 100644
index 0000000000..e5aaa28bc4
--- /dev/null
+++ b/community/py3-hiredis/system-hiredis.patch
@@ -0,0 +1,14 @@
+--- hiredis-1.0.0/setup.py
++++ hiredis-1.0.0_p/setup.py
+@@ -11,9 +11,8 @@
+ return module.__version__
+
+ ext = Extension("hiredis.hiredis",
+- sources=sorted(glob.glob("src/*.c") +
+- ["vendor/hiredis/%s.c" % src for src in ("read", "sds")]),
+- include_dirs=["vendor"])
++ sources=sorted(glob.glob("src/*.c")),
++ libraries=["hiredis"])
+
+ setup(
+ name="hiredis",