diff --git a/pythonforandroid/recipes/python2/__init__.py b/pythonforandroid/recipes/python2/__init__.py index a0806f994e..9e33de90a7 100644 --- a/pythonforandroid/recipes/python2/__init__.py +++ b/pythonforandroid/recipes/python2/__init__.py @@ -11,7 +11,7 @@ class Python2Recipe(Recipe): url = 'http://python.org/ftp/python/{version}/Python-{version}.tar.bz2' name = 'python2' - depends = ['hostpython2'] + depends = ['hostpython2'] conflicts = ['python3'] def prebuild_armeabi(self): @@ -39,6 +39,9 @@ def prebuild_armeabi(self): self.apply_patch(join('patches', 'fix-configure-darwin.patch')) self.apply_patch(join('patches', 'fix-distutils-darwin.patch')) + if self.ctx.android_api > 19: + self.apply_patch(join('patches', 'fix-ftime-removal.patch')) + shprint(sh.touch, join(build_dir, '.patched')) def build_armeabi(self): @@ -125,7 +128,7 @@ def do_python_build(self): _env=env) except sh.ErrorReturnCode_2: print('First python2 make failed. This is expected, trying again.') - + print('Second install (expected to work)') shprint(sh.touch, 'python.exe', 'python') diff --git a/pythonforandroid/recipes/python2/patches/fix-ftime-removal.patch b/pythonforandroid/recipes/python2/patches/fix-ftime-removal.patch new file mode 100644 index 0000000000..5d79a1dc12 --- /dev/null +++ b/pythonforandroid/recipes/python2/patches/fix-ftime-removal.patch @@ -0,0 +1,11 @@ +diff -u -r Python-2.7.2.orig/Modules/timemodule.c Python-2.7.2/Modules/timemodule.c +--- Python-2.7.2.orig/Modules/timemodule.c 2011-06-11 15:46:27.000000000 +0000 ++++ Python-2.7.2/Modules/timemodule.c 2015-09-11 10:37:36.708661691 +0000 +@@ -27,6 +27,7 @@ + #include + #endif + ++#undef HAVE_FTIME + #ifdef HAVE_FTIME + #include + #if !defined(MS_WINDOWS) && !defined(PYOS_OS2)