diff options
author | Eivind Uggedal <eivind@uggedal.com> | 2014-05-23 11:02:21 +0000 |
---|---|---|
committer | Eivind Uggedal <eivind@uggedal.com> | 2014-05-23 11:02:30 +0000 |
commit | 228856dd755b1f1209d2e317cf247bd38304fab9 (patch) | |
tree | c71e8a69088d7b8e7df576d75194344746658dc0 | |
parent | 1181bcc1cec305fe05dd5a6934396f3c957a57b6 (diff) | |
download | aports-228856dd755b1f1209d2e317cf247bd38304fab9.tar.bz2 aports-228856dd755b1f1209d2e317cf247bd38304fab9.tar.xz |
py-hiredis: new aport
-rw-r--r-- | testing/py-hiredis/APKBUILD | 44 | ||||
-rw-r--r-- | testing/py-hiredis/system-hiredis.patch | 39 |
2 files changed, 83 insertions, 0 deletions
diff --git a/testing/py-hiredis/APKBUILD b/testing/py-hiredis/APKBUILD new file mode 100644 index 0000000000..a97d6e8b9e --- /dev/null +++ b/testing/py-hiredis/APKBUILD @@ -0,0 +1,44 @@ +# Maintainer: Eivind Uggedal <eivind@uggedal.com> +pkgname=py-hiredis +_pkgname=${pkgname#py-} +pkgver=0.1.3 +pkgrel=0 +pkgdesc="Python extension that wraps hiredis" +url="https://github.com/redis/hiredis-py" +arch="all" +license="BSD" +depends="python" +depends_dev="" +makedepends="python-dev py-setuptools hiredis-dev" +install="" +subpackages="" +source="http://pypi.python.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" + python setup.py build || return 1 +} + +package() { + cd "$_builddir" + python setup.py install --prefix=/usr --root="$pkgdir" || return 1 +} + +md5sums="69a66903399d6a1e69f3a62e11d34d26 hiredis-0.1.3.tar.gz +3cb7a0662f3627bb3943b5b0f00090d2 system-hiredis.patch" +sha256sums="77b7b31fb81d74d356206fae891a18d6095279611bc1d93e927900208173fca1 hiredis-0.1.3.tar.gz +45de7d65538e01a521e9f4adc76ae90d3518211726d49fddf1a0c7ff8fd2c853 system-hiredis.patch" +sha512sums="ee69dc66ba3778f206ae628a2e720b217653dbdc43c45f60965284a5cf0a67cef0bfe2e159639c5250a2f7452e5b1f929024bf92f3f13a68f0f1335f477c1848 hiredis-0.1.3.tar.gz +4b39b75777f1955d17312841aaf602a9d97c6618f8dd81bbc3cc40ab2a5b91ecb7830e633dcbb029c47cc89f3a0e871189fd30edf7dfe3dec482d82898768e01 system-hiredis.patch" diff --git a/testing/py-hiredis/system-hiredis.patch b/testing/py-hiredis/system-hiredis.patch new file mode 100644 index 0000000000..57dc709b99 --- /dev/null +++ b/testing/py-hiredis/system-hiredis.patch @@ -0,0 +1,39 @@ +--- 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 |