diff options
author | Ross Burton <ross.burton@intel.com> | 2014-01-28 17:31:55 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-01-28 17:56:50 +0000 |
commit | 9febe2d184ef76b7cacace15cbe17968e8c37617 (patch) | |
tree | 0293abc4ce7a45c8a90213e0f2df131d95fcff89 /meta/recipes-devtools/python/python-numpy | |
parent | e6ade33a6f52434e884dd97549b8ac731347d9ad (diff) | |
download | openembedded-core-9febe2d184ef76b7cacace15cbe17968e8c37617.tar.gz openembedded-core-9febe2d184ef76b7cacace15cbe17968e8c37617.tar.bz2 openembedded-core-9febe2d184ef76b7cacace15cbe17968e8c37617.zip |
python-numpy: don't search host directories for libraries
The build process hard-codes searches of various directories in /usr when
looking for libraries, delete this to avoid host contamination.
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/python/python-numpy')
-rw-r--r-- | meta/recipes-devtools/python/python-numpy/no-host-paths.patch | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python-numpy/no-host-paths.patch b/meta/recipes-devtools/python/python-numpy/no-host-paths.patch new file mode 100644 index 0000000000..0efb01a6bb --- /dev/null +++ b/meta/recipes-devtools/python/python-numpy/no-host-paths.patch @@ -0,0 +1,57 @@ +Don't search /usr and so on for libraries by default to avoid host contamination. + +Upstream-Status: Inapproprite (As the code stands, this is a hack) +Signed-off-by: Ross Burton <ross.burton@intel.com> + +diff --git a/numpy/distutils/system_info.py b/numpy/distutils/system_info.py +index bac90fb..a63d796 100644 +--- a/numpy/distutils/system_info.py ++++ b/numpy/distutils/system_info.py +@@ -191,41 +191,12 @@ if sys.platform == 'win32': + default_x11_lib_dirs = [] + default_x11_include_dirs = [] + else: +- default_lib_dirs = libpaths(['/usr/local/lib', '/opt/lib', '/usr/lib', +- '/opt/local/lib', '/sw/lib'], platform_bits) +- default_include_dirs = ['/usr/local/include', +- '/opt/include', '/usr/include', +- # path of umfpack under macports +- '/opt/local/include/ufsparse', +- '/opt/local/include', '/sw/include', +- '/usr/include/suitesparse'] +- default_src_dirs = ['.', '/usr/local/src', '/opt/src', '/sw/src'] +- +- default_x11_lib_dirs = libpaths(['/usr/X11R6/lib', '/usr/X11/lib', +- '/usr/lib'], platform_bits) +- default_x11_include_dirs = ['/usr/X11R6/include', '/usr/X11/include', +- '/usr/include'] +- +- if os.path.exists('/usr/lib/X11'): +- globbed_x11_dir = glob('/usr/lib/*/libX11.so') +- if globbed_x11_dir: +- x11_so_dir = os.path.split(globbed_x11_dir[0])[0] +- default_x11_lib_dirs.extend([x11_so_dir, '/usr/lib/X11']) +- default_x11_include_dirs.extend(['/usr/lib/X11/include', +- '/usr/include/X11']) +- +- import subprocess as sp +- try: +- p = sp.Popen(["gcc", "-print-multiarch"], stdout=sp.PIPE, +- stderr=open(os.devnull, 'w')) +- except OSError: +- pass # gcc is not installed +- else: +- triplet = str(p.communicate()[0].decode().strip()) +- if p.returncode == 0: +- # gcc supports the "-print-multiarch" option +- default_x11_lib_dirs += [os.path.join("/usr/lib/", triplet)] +- default_lib_dirs += [os.path.join("/usr/lib/", triplet)] ++ default_lib_dirs = libpaths(['/deadir/lib'], platform_bits) ++ default_include_dirs = ['/deaddir/include'] ++ default_src_dirs = ['.', '/deaddir/src'] ++ ++ default_x11_lib_dirs = libpaths(['/deaddir/lib'], platform_bits) ++ default_x11_include_dirs = ['/deaddir/include'] + + if os.path.join(sys.prefix, 'lib') not in default_lib_dirs: + default_lib_dirs.insert(0, os.path.join(sys.prefix, 'lib')) |