1 From cc2ce6d8b6a3e6e2c8874896c10897034a80cd4f Mon Sep 17 00:00:00 2001
2 From: Alexander Kanavin <alex.kanavin@gmail.com>
3 Date: Thu, 10 Dec 2015 13:20:30 +0200
4 Subject: [PATCH] Don't search /usr and so on for libraries by default to avoid
7 Upstream-Status: Inappropriate (As the code stands, this is a hack)
8 Signed-off-by: Ross Burton <ross.burton@intel.com>
9 Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
11 numpy/distutils/system_info.py | 50 +++++-------------------------------------
12 1 file changed, 6 insertions(+), 44 deletions(-)
14 diff --git a/numpy/distutils/system_info.py b/numpy/distutils/system_info.py
15 index 9dd48e2..80e197a 100644
16 --- a/numpy/distutils/system_info.py
17 +++ b/numpy/distutils/system_info.py
18 @@ -204,51 +204,13 @@ if sys.platform == 'win32':
19 default_x11_lib_dirs = []
20 default_x11_include_dirs = []
22 - default_lib_dirs = libpaths(['/usr/local/lib', '/opt/lib', '/usr/lib',
23 - '/opt/local/lib', '/sw/lib'], platform_bits)
24 default_runtime_dirs = []
25 - default_include_dirs = ['/usr/local/include',
26 - '/opt/include', '/usr/include',
27 - # path of umfpack under macports
28 - '/opt/local/include/ufsparse',
29 - '/opt/local/include', '/sw/include',
30 - '/usr/include/suitesparse']
31 - default_src_dirs = ['.', '/usr/local/src', '/opt/src', '/sw/src']
33 - default_x11_lib_dirs = libpaths(['/usr/X11R6/lib', '/usr/X11/lib',
34 - '/usr/lib'], platform_bits)
35 - default_x11_include_dirs = ['/usr/X11R6/include', '/usr/X11/include',
38 - if os.path.exists('/usr/lib/X11'):
39 - globbed_x11_dir = glob('/usr/lib/*/libX11.so')
41 - x11_so_dir = os.path.split(globbed_x11_dir[0])[0]
42 - default_x11_lib_dirs.extend([x11_so_dir, '/usr/lib/X11'])
43 - default_x11_include_dirs.extend(['/usr/lib/X11/include',
44 - '/usr/include/X11'])
46 - import subprocess as sp
49 - # Explicitly open/close file to avoid ResourceWarning when
50 - # tests are run in debug mode Python 3.
51 - tmp = open(os.devnull, 'w')
52 - p = sp.Popen(["gcc", "-print-multiarch"], stdout=sp.PIPE,
54 - except (OSError, DistutilsError):
55 - # OSError if gcc is not installed, or SandboxViolation (DistutilsError
56 - # subclass) if an old setuptools bug is triggered (see gh-3160).
59 - triplet = str(p.communicate()[0].decode().strip())
60 - if p.returncode == 0:
61 - # gcc supports the "-print-multiarch" option
62 - default_x11_lib_dirs += [os.path.join("/usr/lib/", triplet)]
63 - default_lib_dirs += [os.path.join("/usr/lib/", triplet)]
67 + default_lib_dirs = libpaths(['/deadir/lib'], platform_bits)
68 + default_include_dirs = ['/deaddir/include']
69 + default_src_dirs = ['.', '/deaddir/src']
71 + default_x11_lib_dirs = libpaths(['/deaddir/lib'], platform_bits)
72 + default_x11_include_dirs = ['/deaddir/include']
74 if os.path.join(sys.prefix, 'lib') not in default_lib_dirs:
75 default_lib_dirs.insert(0, os.path.join(sys.prefix, 'lib'))