summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2015-11-19 14:31:33 -0500
committerMike Frysinger <vapier@gentoo.org>2015-11-19 14:40:49 -0500
commitbc2ac53cf53217339edc0b1f1f2009453d2b043b (patch)
treee579557c64fefa45303d98c17628702712b0c71a /dev-lang/python/files
parentapp-vim/salt-vim: new package (diff)
downloadgentoo-bc2ac53cf53217339edc0b1f1f2009453d2b043b.tar.gz
gentoo-bc2ac53cf53217339edc0b1f1f2009453d2b043b.tar.bz2
gentoo-bc2ac53cf53217339edc0b1f1f2009453d2b043b.zip
dev-lang/python: fix system libffi handling
Diffstat (limited to 'dev-lang/python/files')
-rw-r--r--dev-lang/python/files/python-2.7.10-system-libffi.patch36
1 files changed, 36 insertions, 0 deletions
diff --git a/dev-lang/python/files/python-2.7.10-system-libffi.patch b/dev-lang/python/files/python-2.7.10-system-libffi.patch
new file mode 100644
index 000000000000..0b49b794bd8d
--- /dev/null
+++ b/dev-lang/python/files/python-2.7.10-system-libffi.patch
@@ -0,0 +1,36 @@
+make sure we respect the system libffi setting in our build config.
+the compiler probing is fragile and can break in some situations.
+
+--- a/setup.py
++++ b/setup.py
+@@ -2069,7 +2069,7 @@ class PyBuildExt(build_ext):
+ return True
+
+ def detect_ctypes(self, inc_dirs, lib_dirs):
+- self.use_system_libffi = False
++ self.use_system_libffi = ('--with-system-ffi' in sysconfig.get_config_var("CONFIG_ARGS"))
+ include_dirs = []
+ extra_compile_args = []
+ extra_link_args = []
+@@ -2113,7 +2113,7 @@ class PyBuildExt(build_ext):
+ sources=['_ctypes/_ctypes_test.c'])
+ self.extensions.extend([ext, ext_test])
+
+- if not '--with-system-ffi' in sysconfig.get_config_var("CONFIG_ARGS"):
++ if not self.use_system_libffi:
+ return
+
+ if host_platform == 'darwin':
+@@ -2141,10 +2141,10 @@ class PyBuildExt(build_ext):
+ ffi_lib = lib_name
+ break
+
+- if ffi_inc and ffi_lib:
++ if ffi_inc:
+ ext.include_dirs.extend(ffi_inc)
++ if ffi_lib:
+ ext.libraries.append(ffi_lib)
+- self.use_system_libffi = True
+
+
+ class PyBuildInstall(install):