Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 6 Aug 2016 14:41:35 +0000 (UTC)
From:      Kubilay Kocak <koobs@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r419747 - head/devel/py-cffi
Message-ID:  <201608061441.u76EfZLw040948@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: koobs
Date: Sat Aug  6 14:41:34 2016
New Revision: 419747
URL: https://svnweb.freebsd.org/changeset/ports/419747

Log:
  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

Modified:
  head/devel/py-cffi/Makefile
  head/devel/py-cffi/distinfo

Modified: head/devel/py-cffi/Makefile
==============================================================================
--- head/devel/py-cffi/Makefile	Sat Aug  6 14:16:55 2016	(r419746)
+++ head/devel/py-cffi/Makefile	Sat Aug  6 14:41:34 2016	(r419747)
@@ -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>

Modified: head/devel/py-cffi/distinfo
==============================================================================
--- head/devel/py-cffi/distinfo	Sat Aug  6 14:16:55 2016	(r419746)
+++ head/devel/py-cffi/distinfo	Sat Aug  6 14:41:34 2016	(r419747)
@@ -1,3 +1,3 @@
-TIMESTAMP = 1463831192
+TIMESTAMP = 1469194464
 SHA256 (cffi-1.6.0.tar.gz) = a7f75c4ef2362c0a0e54657add0a6c509fecbfa3b3807bc0925f5cb1c9f927db
 SIZE (cffi-1.6.0.tar.gz) = 397024



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201608061441.u76EfZLw040948>