Skip to content

Commit 61b7210

Browse files
committed
[WIP] Test
1 parent e11d8ba commit 61b7210

File tree

1 file changed

+18
-11
lines changed

1 file changed

+18
-11
lines changed

from_cpython/setup.py

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -743,6 +743,10 @@ def detect_modules(self):
743743
missing.extend(['imageop'])
744744

745745
# readline
746+
# Pyston change: in some container system, the dependencies are provided by
747+
# LIBRARY_PATH env variable
748+
lib_dirs += os.getenv('LIBRARY_PATH', '').split(os.pathsep)
749+
746750
do_readline = self.compiler.find_library_file(lib_dirs, 'readline')
747751
readline_termcap_library = ""
748752
curses_library = ""
@@ -1402,13 +1406,16 @@ class db_found(Exception): pass
14021406
# provided by the ncurses library.
14031407
panel_library = 'panel'
14041408
curses_incs = None
1409+
# Pyston change: in some container system. The headfile are provided
1410+
# by CPATH env variable
1411+
inc_dirs += os.getenv('CPATH', '').split(os.pathsep)
14051412
if curses_library.startswith('ncurses'):
14061413
if curses_library == 'ncursesw':
14071414
# Bug 1464056: If _curses.so links with ncursesw,
14081415
# _curses_panel.so must link with panelw.
14091416
panel_library = 'panelw'
14101417
curses_libs = [curses_library]
1411-
curses_incs = find_file('curses.h', inc_dirs,
1418+
curses_incs = find_file('curses.h', [],
14121419
[os.path.join(d, 'ncursesw') for d in inc_dirs])
14131420
exts.append( Extension('_curses',
14141421
sources = map(relpath,
@@ -2075,8 +2082,9 @@ def configure_ctypes(self, ext):
20752082

20762083
srcdir = sysconfig.get_config_var('srcdir')
20772084
ffi_builddir = os.path.join(self.build_temp, 'libffi')
2078-
ffi_srcdir = os.path.abspath(os.path.join(srcdir, 'Modules',
2079-
'_ctypes', 'libffi'))
2085+
ffi_srcdir = os.path.abspath(os.path.join(srcdir, relpath("../../from_cpython/Modules/_ctypes/libffi")))
2086+
# ffi_srcdir = os.path.abspath(os.path.join(srcdir, 'Modules',
2087+
# '_ctypes', 'libffi'))
20802088
ffi_configfile = os.path.join(ffi_builddir, 'fficonfig.py')
20812089

20822090
from distutils.dep_util import newer_group
@@ -2088,8 +2096,10 @@ def configure_ctypes(self, ext):
20882096
ffi_configfile):
20892097
from distutils.dir_util import mkpath
20902098
mkpath(ffi_builddir)
2091-
config_args = [arg for arg in sysconfig.get_config_var("CONFIG_ARGS").split()
2092-
if (('--host=' in arg) or ('--build=' in arg))]
2099+
# Pyston change: we don't support config var yet
2100+
# config_args = [arg for arg in sysconfig.get_config_var("CONFIG_ARGS").split()
2101+
# if (('--host=' in arg) or ('--build=' in arg))]
2102+
config_args = []
20932103
if not self.verbose:
20942104
config_args.append("-q")
20952105

@@ -2176,12 +2186,9 @@ def detect_ctypes(self, inc_dirs, lib_dirs):
21762186
# in /usr/include/ffi
21772187
inc_dirs.append('/usr/include/ffi')
21782188

2179-
# Pyston change: still hard code the ffi include dir
2180-
# because we don't support this variable configuration in get_config_var yet
2181-
ffi_inc = ['/usr/include/x86_64-linux-gnu']
2182-
# ffi_inc = [sysconfig.get_config_var("LIBFFI_INCLUDEDIR")]
2183-
if not ffi_inc or ffi_inc[0] == '':
2184-
ffi_inc = find_file('ffi.h', [], inc_dirs)
2189+
ffi_inc = [sysconfig.get_config_var("LIBFFI_INCLUDEDIR")]
2190+
if not ffi_inc[0] or ffi_inc[0] == '':
2191+
ffi_inc = find_file('ffi.h', inc_dirs, inc_dirs)
21852192
if ffi_inc is not None:
21862193
ffi_h = ffi_inc[0] + '/ffi.h'
21872194
fp = open(ffi_h)

0 commit comments

Comments
 (0)