dev-python/hiredis: Fix linking (#653790 by Ștefan Talpalaru)
authorPacho Ramos <pacho@gentoo.org>
Sun, 24 Jun 2018 13:12:16 +0000 (15:12 +0200)
committerPacho Ramos <pacho@gentoo.org>
Sun, 24 Jun 2018 13:14:09 +0000 (15:14 +0200)
Package-Manager: Portage-2.3.40, Repoman-2.3.9

dev-python/hiredis/files/hiredis-0.2.0-r1-system-libs.patch [new file with mode: 0644]
dev-python/hiredis/hiredis-0.2.0-r1.ebuild [new file with mode: 0644]

diff --git a/dev-python/hiredis/files/hiredis-0.2.0-r1-system-libs.patch b/dev-python/hiredis/files/hiredis-0.2.0-r1-system-libs.patch
new file mode 100644 (file)
index 0000000..19d4bd8
--- /dev/null
@@ -0,0 +1,26 @@
+diff -ur hiredis-0.2.0.orig/setup.py hiredis-0.2.0/setup.py
+--- hiredis-0.2.0.orig/setup.py        2015-04-03 16:08:45.000000000 +0200
++++ hiredis-0.2.0/setup.py     2018-04-22 16:57:15.966520939 +0200
+@@ -40,12 +40,11 @@
+ # 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 ("read", "sds")]})
+ ext = Extension("hiredis.hiredis",
+   sources=glob.glob("src/*.c"),
+-  include_dirs=["vendor"])
++  libraries=["hiredis"],
++)
+ setup(
+   name="hiredis",
+@@ -57,7 +56,6 @@
+   keywords=["Redis"],
+   license="BSD",
+   packages=["hiredis"],
+-  libraries=[lib],
+   ext_modules=[ext],
+   # Override "install_lib" command
diff --git a/dev-python/hiredis/hiredis-0.2.0-r1.ebuild b/dev-python/hiredis/hiredis-0.2.0-r1.ebuild
new file mode 100644 (file)
index 0000000..c3bd607
--- /dev/null
@@ -0,0 +1,27 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6} )
+
+inherit distutils-r1
+
+DESCRIPTION="Python extension that wraps hiredis"
+HOMEPAGE="https://github.com/pietern/hiredis-py"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~x86"
+IUSE=""
+
+DEPEND=">=dev-libs/hiredis-0.13.1"
+RDEPEND="${DEPEND}"
+
+PATCHES=( "${FILESDIR}"/${P}-r1-system-libs.patch )
+
+python_compile() {
+       python_is_python3 || local -x CFLAGS="${CFLAGS} -fno-strict-aliasing"
+
+       distutils-r1_python_compile
+}