summaryrefslogtreecommitdiff
path: root/package/python-netifaces/python-netifaces-fix-cross-build.patch
diff options
context:
space:
mode:
authorYegor Yefremov <yegorslists@googlemail.com>2012-01-04 12:30:05 +0100
committerPeter Korsgaard <jacmet@sunsite.dk>2012-01-07 21:00:33 +0100
commit221d609bcf6baed80ac07230e80da49d1522e069 (patch)
tree2e8e6ba39f9377e167e0595bb79ebffe3b2b4630 /package/python-netifaces/python-netifaces-fix-cross-build.patch
parente64b34e957522c355ed77f6356666862c99a1b96 (diff)
New package: python-netifaces
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Diffstat (limited to 'package/python-netifaces/python-netifaces-fix-cross-build.patch')
-rw-r--r--package/python-netifaces/python-netifaces-fix-cross-build.patch54
1 files changed, 54 insertions, 0 deletions
diff --git a/package/python-netifaces/python-netifaces-fix-cross-build.patch b/package/python-netifaces/python-netifaces-fix-cross-build.patch
new file mode 100644
index 000000000..5a11b6195
--- /dev/null
+++ b/package/python-netifaces/python-netifaces-fix-cross-build.patch
@@ -0,0 +1,54 @@
+fix cross-compilation issues:
+
+- don't execute cross-compiled binaries
+- pass LDFLAGS to linker
+
+Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
+---
+ setup.py | 19 +++++++------------
+ 1 file changed, 7 insertions(+), 12 deletions(-)
+
+Index: b/setup.py
+===================================================================
+--- a/setup.py
++++ b/setup.py
+@@ -67,17 +67,8 @@
+ libraries=libraries,
+ debug=self.debug)
+ if execute:
+- abspath = os.path.abspath(os.path.join(self.build_temp,
+- 'conftest'))
+- pipe = os.popen(abspath, 'r')
+- result = pipe.read().strip()
+- status = pipe.close()
+- if status is None:
+- status = 0
+- if result == '':
+- result = True
+- if status != 0:
+- result = False
++ # cross-compiled code can't be executed
++ result = True
+
+ finally:
+ os.dup2(mystdout, 1)
+@@ -89,6 +80,10 @@
+ return result
+
+ def check_requirements(self):
++ # get library dirs
++ if os.environ.has_key('LDFLAGS'):
++ lib_dirs = os.environ['LDFLAGS']
++
+ # Load the cached config data from a previous run if possible; compiling
+ # things to test for features is slow
+ cache_file = os.path.join(self.build_temp, 'config.cache')
+@@ -356,7 +351,7 @@
+ in optional_headers]),
+ 'sockaddr': sockaddr }
+
+- if self.test_build(testrig, execute=False):
++ if self.test_build(testrig, execute=False, library_dirs = [lib_dirs]):
+ result.append(sockaddr)
+
+ if result: