Index: head/devel/py-cffi/Makefile =================================================================== --- head/devel/py-cffi/Makefile (revision 378824) +++ head/devel/py-cffi/Makefile (revision 378825) @@ -1,26 +1,31 @@ # Created by: William Grzybowski # $FreeBSD$ PORTNAME= cffi PORTVERSION= 0.8.6 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= devel python MASTER_SITES= CHEESESHOP PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} MAINTAINER= wg@FreeBSD.org COMMENT= Foreign Function Interface for Python calling C code LICENSE= MIT LICENSE_FILE= ${WRKSRC}/LICENSE LIB_DEPENDS= libffi.so:${PORTSDIR}/devel/libffi RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pycparser>=2.10:${PORTSDIR}/devel/py-pycparser +TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pytest>0:${PORTSDIR}/devel/py-pytest CFLAGS+= -I${LOCALBASE}/include -Wl,-rpath,${LOCALBASE}/lib LDFLAGS+= -L${LOCALBASE}/lib USES= python USE_PYTHON= autoplist distutils + +regression-test: patch + cd ${WRKSRC} && ${PYTHON_CMD} ${PYDISTUTILS_SETUP} build_ext -i && + ${LOCALBASE}/bin/py.test .include Index: head/devel/py-cffi/files/patch-cffi_verifier.py =================================================================== --- head/devel/py-cffi/files/patch-cffi_verifier.py (nonexistent) +++ head/devel/py-cffi/files/patch-cffi_verifier.py (revision 378825) @@ -0,0 +1,68 @@ +# Backport: PR #56: Actually check if the file exists rather than assume it doesn't +# https://bitbucket.org/cffi/cffi/pull-request/56/ + +--- cffi/verifier.py.orig 2015-02-11 08:57:05 UTC ++++ cffi/verifier.py +@@ -1,7 +1,16 @@ +-import sys, os, binascii, imp, shutil ++import sys, os, binascii, imp, shutil, io + from . import __version__ + from . import ffiplatform + ++if sys.version_info >= (3,): ++ NativeIO = io.StringIO ++else: ++ class NativeIO(io.BytesIO): ++ def write(self, s): ++ if isinstance(s, unicode): ++ s = s.encode('ascii') ++ super(NativeIO, self).write(s) ++ + + class Verifier(object): + +@@ -118,19 +127,36 @@ class Verifier(object): + self._vengine.collect_types() + self._has_module = True + +- def _write_source(self, file=None): +- must_close = (file is None) +- if must_close: +- _ensure_dir(self.sourcefilename) +- file = open(self.sourcefilename, 'w') ++ def _write_source_to(self, file): + self._vengine._f = file + try: + self._vengine.write_source_to_f() + finally: + del self._vengine._f +- if must_close: +- file.close() +- if must_close: ++ ++ def _write_source(self, file=None): ++ if file is not None: ++ self._write_source_to(file) ++ else: ++ # Write our source file to an in memory file. ++ f = NativeIO() ++ self._write_source_to(f) ++ source_data = f.getvalue() ++ ++ # Determine if this matches the current file ++ if os.path.exists(self.sourcefilename): ++ with open(self.sourcefilename, "r") as fp: ++ needs_written = not (fp.read() == source_data) ++ else: ++ needs_written = True ++ ++ # Actually write the file out if it doesn't match ++ if needs_written: ++ _ensure_dir(self.sourcefilename) ++ with open(self.sourcefilename, "w") as fp: ++ fp.write(source_data) ++ ++ # Set this flag + self._has_source = True + + def _compile_module(self): Property changes on: head/devel/py-cffi/files/patch-cffi_verifier.py ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property