ports/172090: [PATCH] databases/py-hiredis: Build and link against system/port hiredis.so (not WRKSRC/vendor)
Kubilay Kocak
koobs.freebsd at gmail.com
Wed Sep 26 12:30:17 UTC 2012
>Number: 172090
>Category: ports
>Synopsis: [PATCH] databases/py-hiredis: Build and link against system/port hiredis.so (not WRKSRC/vendor)
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Wed Sep 26 12:30:16 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator: Kubilay Kocak
>Release: FreeBSD 9.0-RELEASE-p3 amd64
>Organization:
>Environment:
System: FreeBSD freebsd-9-amd64 9.0-RELEASE-p3 FreeBSD 9.0-RELEASE-p3 #0: Sat Jul 7 21:26:56 EST
>Description:
The upstream distfile for this port bundles the hiredis source files in WRKSRC/vendor and doesnt actually build or link against the LIB_DEPENDS declared in the Makefile.
This PR patches setup.py to link against hiredis.so as installed by the databases/hiredis port.
The approach is:
- Remove the 'lib' section in setup.py that builds hiredis.so
- Point include_dirs to ${LOCALBASE} instead of WRKSRC/vendor
- Add library_dirs to 'ext' section to point it to where hiredis.so lives
While I'm here: whitespace alignment
====[QA]====
portlint: looks fine.
porttest: clean
redports: https://redports.org/buildarchive/20120925120310-64334/
confirm linking:
<snip>databases/py-hiredis/work/hiredis-0.1.1/build/lib.freebsd-9.0-RELEASE-p3-amd64-2.7/hiredis] ldd ./hiredis.so
./hiredis.so:
libhiredis.so.0.10 => /usr/local/lib/libhiredis.so.0.10 (0x801203000)
libc.so.7 => /lib/libc.so.7 (0x80084a000)
============
Added file(s):
- files/patch-setup.py
Port maintainer (gd at rambler-co.ru) is cc'd.
Generated with FreeBSD Port Tools 0.99_6 (mode: change, diff: ports)
>How-To-Repeat:
>Fix:
--- py27-hiredis-0.1.1.patch begins here ---
diff -ruN --exclude=CVS /usr/ports/databases/py-hiredis/Makefile ./Makefile
--- /usr/ports/databases/py-hiredis/Makefile 2012-06-05 12:35:55.000000000 +1000
+++ ./Makefile 2012-09-25 21:38:48.000000000 +1000
@@ -18,8 +18,8 @@
LIB_DEPENDS= hiredis:${PORTSDIR}/databases/hiredis
-USE_PYTHON= yes
-USE_PYDISTUTILS=yes
+USE_PYTHON= yes
+USE_PYDISTUTILS= yes
PLIST_FILES= %%PYTHON_SITELIBDIR%%/hiredis/__init__.py \
%%PYTHON_SITELIBDIR%%/hiredis/__init__.pyc \
@@ -30,4 +30,7 @@
%%PYTHON_SITELIBDIR%%/hiredis/version.pyo
PLIST_DIRS= %%PYTHON_SITELIBDIR%%/hiredis
+post-patch:
+ @${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|' ${WRKSRC}/${PYSETUP}
+
.include <bsd.port.mk>
diff -ruN --exclude=CVS /usr/ports/databases/py-hiredis/files/patch-setup.py ./files/patch-setup.py
--- /usr/ports/databases/py-hiredis/files/patch-setup.py 1970-01-01 10:00:00.000000000 +1000
+++ ./files/patch-setup.py 2012-09-25 21:54:09.000000000 +1000
@@ -0,0 +1,26 @@
+--- ./setup.py.orig 2012-04-18 04:54:11.000000000 +1000
++++ ./setup.py 2012-09-25 21:54:06.000000000 +1000
+@@ -20,13 +20,10 @@
+ if self.distribution.has_ext_modules():
+ self.run_command('build_ext')
+
+-lib = ("hiredis", {
+- "sources": ["vendor/hiredis/%s.c" % src for src in ("hiredis", "net", "sds")],
+- "include_dirs": ["vendor/hiredis"]})
+-
+ ext = Extension("hiredis.hiredis",
+ sources=glob.glob("src/*.c"),
+- include_dirs=["src", "vendor"],
++ include_dirs=["src", "%%LOCALBASE%%/include"],
++ library_dirs=["%%LOCALBASE%%/lib"],
+ libraries=["hiredis"])
+
+ setup(
+@@ -39,7 +36,6 @@
+ keywords=["Redis"],
+ license="BSD",
+ packages=["hiredis"],
+- libraries=[lib],
+ ext_modules=[ext],
+
+ # Override "install_lib" command
--- py27-hiredis-0.1.1.patch ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list