560606989eece47c00e2749eecd046dd874ff982
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / python-pyzmq / 0001-use-buildroot-zmq-version-instead-of-detect.patch
1 detect.py: fix the ZMQ version check to the ZMQ version of the buildroot
2
3 The setup.py script tries to compile a test C program and runs it, to
4 retrieve a version string for the installed ZMQ library, but if the cross
5 compiler links it together, the result cannot be run on the host, due to
6 different architectures and libraries.
7
8 And if the host compiler would compile/link it, it would not link with the
9 library version inside buildroot but with the library from the host, possibly returning a wrong version number.
10
11 Instead of trying to run the compiled test program to get the version
12 dynamically, return the version of the buildroot environment.
13
14 Signed-off-by: Michael Rommel <rommel@layer-7.net>
15
16 --- pyzmq-13.0.2/buildutils/detect.py.orig      2013-08-10 00:49:28.242557978 +0200
17 +++ pyzmq-13.0.2/buildutils/detect.py   2013-08-10 00:44:35.197572704 +0200
18 @@ -119,15 +119,17 @@ def detect_zmq(basedir, compiler=None, *
19              
20      efile = test_compilation(cfile, compiler=compiler, **compiler_attrs)
21      
22 -    result = Popen(efile, stdout=PIPE, stderr=PIPE)
23 -    so, se = result.communicate()
24 +    # result = Popen(efile, stdout=PIPE, stderr=PIPE)
25 +    # so, se = result.communicate()
26      # for py3k:
27 -    so = so.decode()
28 -    se = se.decode()
29 -    if result.returncode:
30 -        msg = "Error running version detection script:\n%s\n%s" % (so,se)
31 -        logging.error(msg)
32 -        raise IOError(msg)
33 +    #so = so.decode()
34 +    #se = se.decode()
35 +    #if result.returncode:
36 +    #    msg = "Error running version detection script:\n%s\n%s" % (so,se)
37 +    #    logging.error(msg)
38 +    #    raise IOError(msg)
39 +
40 +    so = "vers: ##ZEROMQ_VERSION##"
41  
42      handlers = {'vers':  lambda val: tuple(int(v) for v in val.split('.'))}
43