Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions pythonforandroid/recipes/python2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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')
Expand Down
11 changes: 11 additions & 0 deletions pythonforandroid/recipes/python2/patches/fix-ftime-removal.patch
Original file line number Diff line number Diff line change
@@ -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 <io.h>
#endif

+#undef HAVE_FTIME
#ifdef HAVE_FTIME
#include <sys/timeb.h>
#if !defined(MS_WINDOWS) && !defined(PYOS_OS2)