diff options
author | Eivind Uggedal <eu@eju.no> | 2019-05-12 19:01:36 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2019-08-21 14:04:42 +0000 |
commit | 06b2c874a9dc365e2190c60bb93ea7a6f27fc72c (patch) | |
tree | efcd3729521313a6ff9e44fc2f807f986d0145b2 /main | |
parent | de4dad0b9450b25c3a13f7eeff38c914b2721ead (diff) | |
download | aports-06b2c874a9dc365e2190c60bb93ea7a6f27fc72c.tar.bz2 aports-06b2c874a9dc365e2190c60bb93ea7a6f27fc72c.tar.xz |
main/py3-hiredis: update to 1.0.0, py3 only, adopt
* Drop py2 version
* Adopt package (again)
* Modernize
* Add python3 support
* Run tests
* Patch to work with system hiredis 0.14
Diffstat (limited to 'main')
-rw-r--r-- | main/py-hiredis/APKBUILD | 44 | ||||
-rw-r--r-- | main/py-hiredis/system-hiredis.patch | 39 | ||||
-rw-r--r-- | main/py3-hiredis/APKBUILD | 37 | ||||
-rw-r--r-- | main/py3-hiredis/hiredis-0.14-compat.patch | 31 | ||||
-rw-r--r-- | main/py3-hiredis/system-hiredis.patch | 14 |
5 files changed, 82 insertions, 83 deletions
diff --git a/main/py-hiredis/APKBUILD b/main/py-hiredis/APKBUILD deleted file mode 100644 index 765d4c15ea..0000000000 --- a/main/py-hiredis/APKBUILD +++ /dev/null @@ -1,44 +0,0 @@ -# Maintainer: -pkgname=py-hiredis -_pkgname=${pkgname#py-} -pkgver=0.1.4 -pkgrel=2 -pkgdesc="Python extension that wraps hiredis" -url="https://github.com/redis/hiredis-py" -arch="all" -license="BSD" -depends="python2" -depends_dev="" -makedepends="python2-dev py-setuptools hiredis-dev" -install="" -subpackages="" -source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz - system-hiredis.patch" - -_builddir="$srcdir"/$_pkgname-$pkgver -prepare() { - local i - cd "$_builddir" - for i in $source; do - case $i in - *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;; - esac - done -} - -build() { - cd "$_builddir" - python2 setup.py build || return 1 -} - -package() { - cd "$_builddir" - python2 setup.py install --prefix=/usr --root="$pkgdir" || return 1 -} - -md5sums="8e253ef6021a7b5dc95b389a01e0e233 hiredis-0.1.4.tar.gz -3cb7a0662f3627bb3943b5b0f00090d2 system-hiredis.patch" -sha256sums="eb78e5b2f9f3b5f460b1da24b2d5e6179b3f918295697f8e3a71e982619d1a11 hiredis-0.1.4.tar.gz -45de7d65538e01a521e9f4adc76ae90d3518211726d49fddf1a0c7ff8fd2c853 system-hiredis.patch" -sha512sums="8767c836a845b5bd8a07dec33d0e27522d8c0b888bcd912eebf701a3826a59bf7b24cee26bfac33a19079e94f62ef1b823ab4ace505e5a146a33d676d7168693 hiredis-0.1.4.tar.gz -4b39b75777f1955d17312841aaf602a9d97c6618f8dd81bbc3cc40ab2a5b91ecb7830e633dcbb029c47cc89f3a0e871189fd30edf7dfe3dec482d82898768e01 system-hiredis.patch" diff --git a/main/py-hiredis/system-hiredis.patch b/main/py-hiredis/system-hiredis.patch deleted file mode 100644 index 57dc709b99..0000000000 --- a/main/py-hiredis/system-hiredis.patch +++ /dev/null @@ -1,39 +0,0 @@ ---- a/setup.py -+++ b/setup.py -@@ -21,27 +21,9 @@ class install_lib(_install_lib.install_lib): - if self.distribution.has_ext_modules(): - self.run_command('build_ext') - --# To link the extension with the C library, distutils passes the "-lLIBRARY" --# option to the linker. This makes it go through its library search path. If it --# finds a shared object of the specified library in one of the system-wide --# library paths, it will dynamically link it. --# --# We want the linker to statically link the version of hiredis that is included --# with hiredis-py. However, the linker may pick up the shared library version --# of hiredis, if it is available through one of the system-wide library paths. --# To prevent this from happening, we use an obfuscated library name such that --# the only version the linker will be able to find is the right version. --# --# This is a terrible hack, but patching distutils to do the right thing for all --# supported Python versions is worse... --# --# Also see: https://github.com/pietern/hiredis-py/issues/15 --lib = ("hiredis_for_hiredis_py", { -- "sources": ["vendor/hiredis/%s.c" % src for src in ("hiredis", "net", "sds")]}) -- - ext = Extension("hiredis.hiredis", - sources=glob.glob("src/*.c"), -- include_dirs=["vendor"]) -+ libraries=["hiredis"]) - - setup( - name="hiredis", -@@ -53,7 +35,6 @@ setup( - keywords=["Redis"], - license="BSD", - packages=["hiredis"], -- libraries=[lib], - ext_modules=[ext], - - # Override "install_lib" command diff --git a/main/py3-hiredis/APKBUILD b/main/py3-hiredis/APKBUILD new file mode 100644 index 0000000000..b52e3b5598 --- /dev/null +++ b/main/py3-hiredis/APKBUILD @@ -0,0 +1,37 @@ +# Maintainer: Eivind Uggedal <eu@eju.no> +pkgname=py3-hiredis +_pkgname=${pkgname#py3-} +pkgver=1.0.0 +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() { + cd "$builddir" + python3 setup.py build +} + +check() { + cd "$builddir" + python3 test.py +} + +package() { + python3 setup.py install --prefix=/usr --root="$pkgdir" +} + +sha512sums="2dfe124977770431cfd77bd3c6d22fd6dcafdd69da3016d5459bf697668682e809f2c3a8b8b41e95c884a297e5f74e0163e43b05c808cb866e2317357fba11ff hiredis-1.0.0.tar.gz +4be1599851215547b4b994a966087024cc86b495dbfdcb9807dabcffb5505509f25398c55a07b2a8fb7221cf9c5d27738a38f8c87fe2e37d991a2de3cfa38451 system-hiredis.patch +a066ceab985be6ae87f0c30b98a496e6929909ac5d94b21fac9544bc8f649b0c1f0b66760441a90dc8bc50f4d748775f3d3a042fe8a4b466b5371bfb49b16f7a hiredis-0.14-compat.patch" diff --git a/main/py3-hiredis/hiredis-0.14-compat.patch b/main/py3-hiredis/hiredis-0.14-compat.patch new file mode 100644 index 0000000000..86e0d3f585 --- /dev/null +++ b/main/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/main/py3-hiredis/system-hiredis.patch b/main/py3-hiredis/system-hiredis.patch new file mode 100644 index 0000000000..e5aaa28bc4 --- /dev/null +++ b/main/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", |