diff options
Diffstat (limited to 'data/_python-3.7.3/setup.patch')
-rw-r--r-- | data/_python-3.7.3/setup.patch | 179 |
1 files changed, 179 insertions, 0 deletions
diff --git a/data/_python-3.7.3/setup.patch b/data/_python-3.7.3/setup.patch new file mode 100644 index 000000000..6ac2390b7 --- /dev/null +++ b/data/_python-3.7.3/setup.patch @@ -0,0 +1,179 @@ +--- Python-3.7.3/setup.py 2019-03-25 20:21:05.000000000 +0000 ++++ Python-3.7.3+iPhone/setup.py 2019-04-11 20:54:37.306532874 +0000 +@@ -18,6 +18,9 @@ + + cross_compiling = "_PYTHON_HOST_PLATFORM" in os.environ + ++#if cross_compiling: ++# sys.platform = 'darwin' ++ + # Set common compiler and linker flags derived from the Makefile, + # reserved for building the interpreter and the stdlib modules. + # See bpo-21121 and bpo-35257 +@@ -98,7 +101,7 @@ + cflags = sysconfig.get_config_var('CFLAGS') + m = re.search(r'-isysroot\s+(\S+)', cflags) + if m is None: +- sysroot = '/' ++ sysroot = os.environ['PKG_ROOT'] or '/' + else: + sysroot = m.group(1) + return sysroot +@@ -107,7 +110,7 @@ + """ + Returns True if 'path' can be located in an OSX SDK + """ +- return ( (path.startswith('/usr/') and not path.startswith('/usr/local')) ++ return ( path.startswith('/usr/') + or path.startswith('/System/') + or path.startswith('/Library/') ) + +@@ -781,6 +784,9 @@ + + # readline + do_readline = self.compiler.find_library_file(lib_dirs, 'readline') ++ if cross_compiling: ++ # Just say yes to this check. ++ do_readline = True + readline_termcap_library = "" + curses_library = "" + # Cannot use os.popen here in py3k. +@@ -789,11 +795,11 @@ + os.makedirs(self.build_temp) + # Determine if readline is already linked against curses or tinfo. + if do_readline: +- if cross_compiling: ++ if cross_compiling and host_platform != 'darwin': + ret = os.system("%s -d %s | grep '(NEEDED)' > %s" \ + % (sysconfig.get_config_var('READELF'), + do_readline, tmpfile)) +- elif find_executable('ldd'): ++ elif find_executable('ldd') and host_platform != 'darwin': + ret = os.system("ldd %s > %s" % (do_readline, tmpfile)) + else: + ret = 256 +@@ -833,7 +839,7 @@ + # MacOSX 10.4 has a broken readline. Don't try to build + # the readline module unless the user has installed a fixed + # readline package +- if find_file('readline/rlconf.h', inc_dirs, []) is None: ++ if find_file('readline/rlconf.h', inc_dirs, []) is None and not cross_compiling: + do_readline = False + if do_readline: + if host_platform == 'darwin' and os_release < 9: +@@ -1346,6 +1352,9 @@ + curses_defines = [] + curses_includes = [] + panel_library = 'panel' ++ if cross_compiling: ++ # Default to ncurses here. ++ curses_library = curses_library or 'ncurses' + if curses_library == 'ncursesw': + curses_defines.append(('HAVE_NCURSESW', '1')) + if not cross_compiling: +@@ -1390,7 +1399,7 @@ + + # If the curses module is enabled, check for the panel module + if (module_enabled(exts, '_curses') and +- self.compiler.find_library_file(lib_dirs, panel_library)): ++ self.compiler.find_library_file(lib_dirs, panel_library)) or cross_compiling: + exts.append( Extension('_curses_panel', ['_curses_panel.c'], + include_dirs=curses_includes, + define_macros=curses_defines, +@@ -1412,22 +1421,24 @@ + # http://www.gzip.org/zlib/ + zlib_inc = find_file('zlib.h', [], inc_dirs) + have_zlib = False +- if zlib_inc is not None: +- zlib_h = zlib_inc[0] + '/zlib.h' +- version = '"0.0.0"' ++ if zlib_inc is not None or cross_compiling: ++# zlib_h = zlib_inc[0] + '/zlib.h' ++# version = '"0.0.0"' ++ version = '"1.1.3"' + version_req = '"1.1.3"' +- if host_platform == 'darwin' and is_macosx_sdk_path(zlib_h): +- zlib_h = os.path.join(macosx_sdk_root(), zlib_h[1:]) +- with open(zlib_h) as fp: +- while 1: +- line = fp.readline() +- if not line: +- break +- if line.startswith('#define ZLIB_VERSION'): +- version = line.split()[2] +- break +- if version >= version_req: +- if (self.compiler.find_library_file(lib_dirs, 'z')): ++# if host_platform == 'darwin' and is_macosx_sdk_path(zlib_h): ++# zlib_h = os.path.join(macosx_sdk_root(), zlib_h[1:]) ++# with open(zlib_h) as fp: ++# while 1: ++# line = fp.readline() ++# if not line: ++# break ++# if line.startswith('#define ZLIB_VERSION'): ++# version = line.split()[2] ++# break ++ if version >= version_req or cross_compiling: ++ # zlib is a default lib on iOS. ++ if (self.compiler.find_library_file(lib_dirs, 'z')) or cross_compiling: + if host_platform == "darwin": + zlib_extra_link_args = ('-Wl,-search_paths_first',) + else: +@@ -1459,7 +1470,8 @@ + extra_link_args = extra_link_args) ) + + # Gustavo Niemeyer's bz2 module. +- if (self.compiler.find_library_file(lib_dirs, 'bz2')): ++ if (self.compiler.find_library_file(lib_dirs, 'bz2')) or cross_compiling: ++ # BZ2 is in the iOS SDK + if host_platform == "darwin": + bz2_extra_link_args = ('-Wl,-search_paths_first',) + else: +@@ -1471,7 +1483,8 @@ + missing.append('_bz2') + + # LZMA compression support. +- if self.compiler.find_library_file(lib_dirs, 'lzma'): ++ if self.compiler.find_library_file(lib_dirs, 'lzma') or cross_compiling: ++ # LZMA is in the iOS SDK + exts.append( Extension('_lzma', ['_lzmamodule.c'], + libraries = ['lzma']) ) + else: +@@ -1631,11 +1644,12 @@ + + # Build the _uuid module if possible + uuid_incs = find_file("uuid.h", inc_dirs, ["/usr/include/uuid"]) +- if uuid_incs is not None: +- if self.compiler.find_library_file(lib_dirs, 'uuid'): +- uuid_libs = ['uuid'] +- else: +- uuid_libs = [] ++ if uuid_incs is not None or cross_compiling: ++ # uuid/uuid.h exists in the iOS SDK. ++# if self.compiler.find_library_file(lib_dirs, 'uuid'): ++# uuid_libs = ['uuid'] ++# else: ++ uuid_libs = [] + self.extensions.append(Extension('_uuid', ['_uuidmodule.c'], + libraries=uuid_libs, + include_dirs=uuid_incs)) +@@ -1926,6 +1940,9 @@ + + def configure_ctypes(self, ext): + if not self.use_system_libffi: ++ if cross_compiling: ++ return True ++ # Bypass the check, assume library path is correct + if host_platform == 'darwin': + return self.configure_ctypes_darwin(ext) + print('INFO: Could not locate ffi libs and/or headers') +@@ -1984,7 +2001,7 @@ + return + # OS X 10.5 comes with libffi.dylib; the include files are + # in /usr/include/ffi +- inc_dirs.append('/usr/include/ffi') ++ inc_dirs.append(sysroot + '/usr/include/ffi') + + ffi_inc = [sysconfig.get_config_var("LIBFFI_INCLUDEDIR")] + if not ffi_inc or ffi_inc[0] == '': |