aboutsummaryrefslogtreecommitdiffstats
path: root/devel
diff options
context:
space:
mode:
authorkoobs <koobs@FreeBSD.org>2016-08-06 22:41:34 +0800
committerkoobs <koobs@FreeBSD.org>2016-08-06 22:41:34 +0800
commitc28e51e8d99cd8e02a26c709ee81ea0d66cc89b4 (patch)
tree10891dd5b23687e9c02fd7025d7b4a7be1a898e8 /devel
parentf8ac9b58f503b3b97a5f826e203ee4eb08d66709 (diff)
downloadfreebsd-ports-gnome-c28e51e8d99cd8e02a26c709ee81ea0d66cc89b4.tar.gz
freebsd-ports-gnome-c28e51e8d99cd8e02a26c709ee81ea0d66cc89b4.tar.zst
freebsd-ports-gnome-c28e51e8d99cd8e02a26c709ee81ea0d66cc89b4.zip
devel/py-cffi: Fix build warnings and test failures
CFLAGS contains -Wl,-rpath,${LOCALBASE}/lib, which causes the following warnings: warning: -Wl,-rpath,/usr/local/lib: 'linker' input unused It also causes many tests to fail due to the same warning: E VerificationError: CompileError: command 'cc' failed with exit status 1 cffi/ffiplatform.py:62: VerificationError ----------- Captured stderr call ---------- error: -Wl,-rpath,/usr/local/lib: 'linker' input unused Remove these (CFLAGS, LDFLAGS) unnecessary flags as cffi grabs compiler details from Python and links correctly to libffi/libpython without them. * Fix cffi0/test_ownlib to use ${CC} not a hardcoded gcc, unecessarily causing test failures. Conditionally add -Wno-shift-negative-value to CFLAGS to squash several more failures on FreeBSD 11+ [1] While I'm here: * Strip shared library * Report skipped tests during test runs Note: leftover test_array_type test failure is known [2] [1] https://bitbucket.org/cffi/cffi/issues/271 [2] https://bitbucket.org/cffi/cffi/issues/178 Reviewed by: wg (maintainer) Approved by: wg (maintainer) MFH: 2016Q3 Differential Revision: D7300
Diffstat (limited to 'devel')
-rw-r--r--devel/py-cffi/Makefile22
-rw-r--r--devel/py-cffi/distinfo2
2 files changed, 18 insertions, 6 deletions
diff --git a/devel/py-cffi/Makefile b/devel/py-cffi/Makefile
index 639c5bf40390..03dd11170ede 100644
--- a/devel/py-cffi/Makefile
+++ b/devel/py-cffi/Makefile
@@ -17,15 +17,27 @@ LIB_DEPENDS= libffi.so:devel/libffi
RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pycparser>=2.10:devel/py-pycparser
TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pytest>0:devel/py-pytest
-CFLAGS+= -I${LOCALBASE}/include -Wl,-rpath,${LOCALBASE}/lib
-LDFLAGS+= -L${LOCALBASE}/lib
-
+# Actually 2.6-2.7,3.2-3.5
USES= python
USE_PYTHON= autoplist distutils
+.include <bsd.port.pre.mk>
+
+.if ${OSVERSION} >= 1100000
+CFLAGS+= -Wno-shift-negative-value
+.endif
+
+# Tests assume gcc, and fail on pure clang systems
+# Fixed in https://bitbucket.org/cffi/cffi/issues/271
+post-patch:
+ ${REINPLACE_CMD} -e 's|gcc|${CC}|g' ${WRKSRC}/testing/cffi0/test_ownlib.py
+
+post-install:
+ ${STRIP_CMD} ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/_cffi_backend.so
+
do-test:
@(cd ${TEST_WRKSRC} && ${SETENV} ${MAKE_ENV} ${PYTHON_CMD} \
${PYDISTUTILS_SETUP} build_ext -i)
- @(cd ${TEST_WRKSRC} && ${SETENV} ${TEST_ENV} ${PYTHON_CMD} -m pytest)
+ @(cd ${TEST_WRKSRC} && ${SETENV} ${TEST_ENV} ${PYTHON_CMD} -m pytest -rs)
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
diff --git a/devel/py-cffi/distinfo b/devel/py-cffi/distinfo
index 3b6acaaf2b24..240a9845dd39 100644
--- a/devel/py-cffi/distinfo
+++ b/devel/py-cffi/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1463831192
+TIMESTAMP = 1469194464
SHA256 (cffi-1.6.0.tar.gz) = a7f75c4ef2362c0a0e54657add0a6c509fecbfa3b3807bc0925f5cb1c9f927db
SIZE (cffi-1.6.0.tar.gz) = 397024