summaryrefslogtreecommitdiffstats
path: root/package/python-pyzmq/0002-replace-compile_and_run-with-compile_and_forget.patch
diff options
context:
space:
mode:
authorLionel Flandrin <lionel@svkt.org>2017-01-31 12:22:45 +0100
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>2017-02-01 22:11:58 +0100
commitc06aa42f7c1a0d22a3c816adacc25bb0b12d0179 (patch)
treef21d1c27b868483b1ca48b82f68d327b8c9daa07 /package/python-pyzmq/0002-replace-compile_and_run-with-compile_and_forget.patch
parentcee060e98e7681c81ced198f078ddc1e7881c9ee (diff)
downloadbuildroot-c06aa42f7c1a0d22a3c816adacc25bb0b12d0179.tar.gz
buildroot-c06aa42f7c1a0d22a3c816adacc25bb0b12d0179.zip
python-pyzmq: bump to version 16.0.2
Updated the zmq version detection patch to apply cleanly on 16.0.2. Added patch #2 to replace compile_and_run with compile_and_forget in the setup code: this function is only used to check for the availability of "sys/un.h" and we only need to compile the test code to make sure of that. This fixes the cross-compilation. Signed-off-by: Lionel Flandrin <lionel@svkt.org> Reviewed-by: Yegor Yefremov <yegorslists@googlemail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'package/python-pyzmq/0002-replace-compile_and_run-with-compile_and_forget.patch')
-rw-r--r--package/python-pyzmq/0002-replace-compile_and_run-with-compile_and_forget.patch76
1 files changed, 76 insertions, 0 deletions
diff --git a/package/python-pyzmq/0002-replace-compile_and_run-with-compile_and_forget.patch b/package/python-pyzmq/0002-replace-compile_and_run-with-compile_and_forget.patch
new file mode 100644
index 0000000000..278e939e0e
--- /dev/null
+++ b/package/python-pyzmq/0002-replace-compile_and_run-with-compile_and_forget.patch
@@ -0,0 +1,76 @@
+detect.py: replace compile_and_run with compile_and_forget
+
+This function is only used in setup.py to detect the availability of
+sys/un.h by compiling and running a small test program. Since we're
+cross-compiling we can't run the generated program, however if the
+header is missing the test will fail at the compilation step so
+running the test in unnecessary.
+
+Signed-off-by: Lionel Flandrin <lionel@svkt.org>
+---
+ buildutils/detect.py | 16 ++++++++--------
+ setup.py | 4 ++--
+ 2 files changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/buildutils/detect.py b/buildutils/detect.py
+index 7a6c115..9520da7 100644
+--- a/buildutils/detect.py
++++ b/buildutils/detect.py
+@@ -58,7 +58,7 @@ def test_compilation(cfile, compiler=None, **compiler_attrs):
+ cc.link_executable(objs, efile, extra_preargs=lpreargs)
+ return efile
+
+-def compile_and_run(basedir, src, compiler=None, **compiler_attrs):
++def compile_and_forget(basedir, src, compiler=None, **compiler_attrs):
+ if not os.path.exists(basedir):
+ os.makedirs(basedir)
+ cfile = pjoin(basedir, os.path.basename(src))
+@@ -66,16 +66,16 @@ def compile_and_run(basedir, src, compiler=None, **compiler_attrs):
+ try:
+ cc = get_compiler(compiler, **compiler_attrs)
+ efile = test_compilation(cfile, compiler=cc)
+- patch_lib_paths(efile, cc.library_dirs)
+- result = Popen(efile, stdout=PIPE, stderr=PIPE)
+- so, se = result.communicate()
+- # for py3k:
+- so = so.decode()
+- se = se.decode()
++ # patch_lib_paths(efile, cc.library_dirs)
++ # result = Popen(efile, stdout=PIPE, stderr=PIPE)
++ # so, se = result.communicate()
++ # # for py3k:
++ # so = so.decode()
++ # se = se.decode()
+ finally:
+ shutil.rmtree(basedir)
+
+- return result.returncode, so, se
++ return None
+
+
+ def detect_zmq(basedir, compiler=None, **compiler_attrs):
+diff --git a/setup.py b/setup.py
+index c3a2879..b8b0aaf 100755
+--- a/setup.py
++++ b/setup.py
+@@ -54,7 +54,7 @@ from buildutils import (
+ info, warn, fatal, debug, line, copy_and_patch_libzmq, localpath,
+ fetch_libzmq, stage_platform_hpp,
+ bundled_version, customize_mingw,
+- compile_and_run,
++ compile_and_forget,
+ patch_lib_paths,
+ )
+
+@@ -327,7 +327,7 @@ class Configure(build_ext):
+ except Exception:
+ pass
+ try:
+- compile_and_run(self.tempdir,
++ compile_and_forget(self.tempdir,
+ pjoin('buildutils', 'check_sys_un.c'),
+ **minus_zmq
+ )
+--
+2.11.0
+
OpenPOWER on IntegriCloud