Python 3.9.6 #11

Merged
akinwale merged 13 commits from python39 into master 2021-08-21 11:30:13 +02:00
18 changed files with 1161 additions and 24 deletions
Showing only changes of commit ea58057ee0 - Show all commits

853
output.diff Normal file
View file

@ -0,0 +1,853 @@
diff --git a/recipes/python3crystax/__init__.py b/recipes/python3crystax/__init__.py
index b8d06c6..71e20aa 100644
--- a/recipes/python3crystax/__init__.py
+++ b/recipes/python3crystax/__init__.py
@@ -170,7 +170,28 @@ class Python3Recipe(TargetPythonRecipe):
def prebuild_arch(self, arch):
super(Python3Recipe, self).prebuild_arch(arch)
if self.version == '3.6' or self.version == '3.7' or self.version == '3.9':
- Python3Recipe.patches = ['patch_python3.6.patch', 'remove_android_api_check.patch', 'selectors.patch']
+ Python3Recipe.patches = [
+ 'patch/patch_python3.6.patch',
+ 'patch/remove_android_api_check.patch',
+ 'patch/selectors.patch'
+ ]
+
+ if self.version == '3.9':
+ Python3Recipe.patches = [
+ 'patch/remove_android_api_check.patch',
+ 'patch/patch_python3.9.patch',
+ 'patch/platlibdir.patch',
+ 'patch/strdup.patch',
+
+ # from https://github.com/kivy/python-for-android/blob/develop/pythonforandroid/recipes/python3/__init__.py#L63
+ 'patch/pyconfig_detection.patch',
+ 'patch/reproducible-buildinfo.diff',
+ 'patch/py3.8.1.patch'
+ ]
+
+ if sh.which('lld') is not None:
+ Python3Recipe.patches += ['patch/py3.8.1_fix_cortex_a8.patch']
+
build_dir = self.get_build_dir(arch.arch)
# copy bundled libffi to _ctypes
diff --git a/recipes/python3crystax/android.mk.3.7 b/recipes/python3crystax/android.mk.3.7
deleted file mode 100644
index 47d7b6b..0000000
--- a/recipes/python3crystax/android.mk.3.7
+++ /dev/null
@@ -1,194 +0,0 @@
-LOCAL_SRC_FILES := config.c \
- $(MY_PYTHON_SRC_ROOT)/Python/asdl.c \
- $(MY_PYTHON_SRC_ROOT)/Python/ast.c \
- $(MY_PYTHON_SRC_ROOT)/Python/ast_opt.c \
- $(MY_PYTHON_SRC_ROOT)/Python/ast_unparse.c \
- $(MY_PYTHON_SRC_ROOT)/Python/bltinmodule.c \
- $(MY_PYTHON_SRC_ROOT)/Python/bootstrap_hash.c \
- $(MY_PYTHON_SRC_ROOT)/Python/ceval.c \
- $(MY_PYTHON_SRC_ROOT)/Python/codecs.c \
- $(MY_PYTHON_SRC_ROOT)/Python/compile.c \
- $(MY_PYTHON_SRC_ROOT)/Python/context.c \
- $(MY_PYTHON_SRC_ROOT)/Python/dtoa.c \
- $(MY_PYTHON_SRC_ROOT)/Python/dup2.c \
- $(MY_PYTHON_SRC_ROOT)/Python/dynamic_annotations.c \
- $(MY_PYTHON_SRC_ROOT)/Python/dynload_shlib.c \
- $(MY_PYTHON_SRC_ROOT)/Python/errors.c \
- $(MY_PYTHON_SRC_ROOT)/Python/fileutils.c \
- $(MY_PYTHON_SRC_ROOT)/Python/formatter_unicode.c \
- $(MY_PYTHON_SRC_ROOT)/Python/frozen.c \
- $(MY_PYTHON_SRC_ROOT)/Python/frozenmain.c \
- $(MY_PYTHON_SRC_ROOT)/Python/future.c \
- $(MY_PYTHON_SRC_ROOT)/Python/getargs.c \
- $(MY_PYTHON_SRC_ROOT)/Python/getcompiler.c \
- $(MY_PYTHON_SRC_ROOT)/Python/getcopyright.c \
- $(MY_PYTHON_SRC_ROOT)/Python/getopt.c \
- $(MY_PYTHON_SRC_ROOT)/Python/getplatform.c \
- $(MY_PYTHON_SRC_ROOT)/Python/getversion.c \
- $(MY_PYTHON_SRC_ROOT)/Python/graminit.c \
- $(MY_PYTHON_SRC_ROOT)/Python/hamt.c \
- $(MY_PYTHON_SRC_ROOT)/Python/import.c \
- $(MY_PYTHON_SRC_ROOT)/Python/importdl.c \
- $(MY_PYTHON_SRC_ROOT)/Python/marshal.c \
- $(MY_PYTHON_SRC_ROOT)/Python/modsupport.c \
- $(MY_PYTHON_SRC_ROOT)/Python/mysnprintf.c \
- $(MY_PYTHON_SRC_ROOT)/Python/mystrtoul.c \
- $(MY_PYTHON_SRC_ROOT)/Python/pathconfig.c \
- $(MY_PYTHON_SRC_ROOT)/Python/peephole.c \
- $(MY_PYTHON_SRC_ROOT)/Python/pyarena.c \
- $(MY_PYTHON_SRC_ROOT)/Python/pyctype.c \
- $(MY_PYTHON_SRC_ROOT)/Python/pyfpe.c \
- $(MY_PYTHON_SRC_ROOT)/Python/pyhash.c \
- $(MY_PYTHON_SRC_ROOT)/Python/pylifecycle.c \
- $(MY_PYTHON_SRC_ROOT)/Python/pymath.c \
- $(MY_PYTHON_SRC_ROOT)/Python/pystate.c \
- $(MY_PYTHON_SRC_ROOT)/Python/pystrcmp.c \
- $(MY_PYTHON_SRC_ROOT)/Python/pystrhex.c \
- $(MY_PYTHON_SRC_ROOT)/Python/pystrtod.c \
- $(MY_PYTHON_SRC_ROOT)/Python/Python-ast.c \
- $(MY_PYTHON_SRC_ROOT)/Python/pythonrun.c \
- $(MY_PYTHON_SRC_ROOT)/Python/pytime.c \
- $(MY_PYTHON_SRC_ROOT)/Python/strdup.c \
- $(MY_PYTHON_SRC_ROOT)/Python/structmember.c \
- $(MY_PYTHON_SRC_ROOT)/Python/symtable.c \
- $(MY_PYTHON_SRC_ROOT)/Python/sysmodule.c \
- $(MY_PYTHON_SRC_ROOT)/Python/thread.c \
- $(MY_PYTHON_SRC_ROOT)/Python/traceback.c \
- $(MY_PYTHON_SRC_ROOT)/Python/_warnings.c \
- \
- $(MY_PYTHON_SRC_ROOT)/Parser/acceler.c \
- $(MY_PYTHON_SRC_ROOT)/Parser/bitset.c \
- $(MY_PYTHON_SRC_ROOT)/Parser/firstsets.c \
- $(MY_PYTHON_SRC_ROOT)/Parser/grammar.c \
- $(MY_PYTHON_SRC_ROOT)/Parser/grammar1.c \
- $(MY_PYTHON_SRC_ROOT)/Parser/listnode.c \
- $(MY_PYTHON_SRC_ROOT)/Parser/metagrammar.c \
- $(MY_PYTHON_SRC_ROOT)/Parser/myreadline.c \
- $(MY_PYTHON_SRC_ROOT)/Parser/node.c \
- $(MY_PYTHON_SRC_ROOT)/Parser/parser.c \
- $(MY_PYTHON_SRC_ROOT)/Parser/parsetok.c \
- $(MY_PYTHON_SRC_ROOT)/Parser/tokenizer.c \
- \
- $(MY_PYTHON_SRC_ROOT)/Objects/abstract.c \
- $(MY_PYTHON_SRC_ROOT)/Objects/accu.c \
- $(MY_PYTHON_SRC_ROOT)/Objects/boolobject.c \
- $(MY_PYTHON_SRC_ROOT)/Objects/bytearrayobject.c \
- $(MY_PYTHON_SRC_ROOT)/Objects/bytes_methods.c \
- $(MY_PYTHON_SRC_ROOT)/Objects/bytesobject.c \
- $(MY_PYTHON_SRC_ROOT)/Objects/call.c \
- $(MY_PYTHON_SRC_ROOT)/Objects/capsule.c \
- $(MY_PYTHON_SRC_ROOT)/Objects/cellobject.c \
- $(MY_PYTHON_SRC_ROOT)/Objects/classobject.c \
- $(MY_PYTHON_SRC_ROOT)/Objects/codeobject.c \
- $(MY_PYTHON_SRC_ROOT)/Objects/complexobject.c \
- $(MY_PYTHON_SRC_ROOT)/Objects/descrobject.c \
- $(MY_PYTHON_SRC_ROOT)/Objects/dictobject.c \
- $(MY_PYTHON_SRC_ROOT)/Objects/enumobject.c \
- $(MY_PYTHON_SRC_ROOT)/Objects/exceptions.c \
- $(MY_PYTHON_SRC_ROOT)/Objects/fileobject.c \
- $(MY_PYTHON_SRC_ROOT)/Objects/floatobject.c \
- $(MY_PYTHON_SRC_ROOT)/Objects/frameobject.c \
- $(MY_PYTHON_SRC_ROOT)/Objects/funcobject.c \
- $(MY_PYTHON_SRC_ROOT)/Objects/genobject.c \
- $(MY_PYTHON_SRC_ROOT)/Objects/iterobject.c \
- $(MY_PYTHON_SRC_ROOT)/Objects/listobject.c \
- $(MY_PYTHON_SRC_ROOT)/Objects/longobject.c \
- $(MY_PYTHON_SRC_ROOT)/Objects/memoryobject.c \
- $(MY_PYTHON_SRC_ROOT)/Objects/methodobject.c \
- $(MY_PYTHON_SRC_ROOT)/Objects/moduleobject.c \
- $(MY_PYTHON_SRC_ROOT)/Objects/namespaceobject.c \
- $(MY_PYTHON_SRC_ROOT)/Objects/object.c \
- $(MY_PYTHON_SRC_ROOT)/Objects/obmalloc.c \
- $(MY_PYTHON_SRC_ROOT)/Objects/odictobject.c \
- $(MY_PYTHON_SRC_ROOT)/Objects/rangeobject.c \
- $(MY_PYTHON_SRC_ROOT)/Objects/setobject.c \
- $(MY_PYTHON_SRC_ROOT)/Objects/sliceobject.c \
- $(MY_PYTHON_SRC_ROOT)/Objects/structseq.c \
- $(MY_PYTHON_SRC_ROOT)/Objects/tupleobject.c \
- $(MY_PYTHON_SRC_ROOT)/Objects/typeobject.c \
- $(MY_PYTHON_SRC_ROOT)/Objects/unicodectype.c \
- $(MY_PYTHON_SRC_ROOT)/Objects/unicodeobject.c \
- $(MY_PYTHON_SRC_ROOT)/Objects/weakrefobject.c \
- \
- $(MY_PYTHON_SRC_ROOT)/Modules/_abc.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/arraymodule.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/_asynciomodule.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/atexitmodule.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/audioop.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/binascii.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/_bisectmodule.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/_bz2module.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/cmathmodule.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/_codecsmodule.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/_collectionsmodule.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/_contextvarsmodule.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/_csv.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/_datetimemodule.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/errnomodule.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/faulthandler.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/fcntlmodule.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/_functoolsmodule.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/gcmodule.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/getbuildinfo.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/getpath.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/hashtable.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/_heapqmodule.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/itertoolsmodule.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/_json.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/_localemodule.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/_lsprof.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/main.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/_math.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/mathmodule.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/md5module.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/mmapmodule.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/_opcode.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/_operator.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/ossaudiodev.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/parsermodule.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/_pickle.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/posixmodule.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/_posixsubprocess.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/pwdmodule.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/_queuemodule.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/_randommodule.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/resource.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/rotatingtree.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/selectmodule.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/sha1module.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/sha256module.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/sha512module.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/signalmodule.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/socketmodule.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/_sre.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/_stat.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/_struct.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/symtablemodule.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/termios.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/_testbuffer.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/_testimportmultiple.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/_testmultiphase.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/_threadmodule.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/timemodule.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/_tracemalloc.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/unicodedata.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/_weakref.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/xxlimited.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/xxmodule.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/xxsubtype.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/zipimport.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/zlibmodule.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/cjkcodecs/_codecs_cn.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/cjkcodecs/_codecs_hk.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/cjkcodecs/_codecs_iso2022.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/cjkcodecs/_codecs_jp.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/cjkcodecs/_codecs_kr.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/cjkcodecs/_codecs_tw.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/cjkcodecs/multibytecodec.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/_io/_iomodule.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/_io/textio.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/_io/iobase.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/_io/bufferedio.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/_io/stringio.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/_io/bytesio.c \
- $(MY_PYTHON_SRC_ROOT)/Modules/_io/fileio.c
diff --git a/recipes/python3crystax/config.c.3.7 b/recipes/python3crystax/config.c.3.7
deleted file mode 100644
index c7cbbc3..0000000
--- a/recipes/python3crystax/config.c.3.7
+++ /dev/null
@@ -1,142 +0,0 @@
-#include <Python.h>
-
-extern PyObject* PyInit_posix(void);
-extern PyObject* PyInit_pwd(void);
-extern PyObject* PyInit_fcntl(void);
-extern PyObject* PyInit__posixsubprocess(void);
-extern PyObject* PyInit_termios(void);
-extern PyObject* PyInit_audioop(void);
-extern PyObject* PyInit__locale(void);
-extern PyObject* PyInit_array(void);
-extern PyObject* PyInit_binascii(void);
-extern PyObject* PyInit_cmath(void);
-extern PyObject* PyInit_errno(void);
-extern PyObject* PyInit_faulthandler(void);
-extern PyObject* PyInit__tracemalloc(void);
-extern PyObject* PyInit_gc(void);
-extern PyObject* PyInit_math(void);
-extern PyObject* PyInit__md5(void);
-extern PyObject* PyInit__operator(void);
-extern PyObject* PyInit__signal(void);
-extern PyObject* PyInit__sha1(void);
-extern PyObject* PyInit__sha256(void);
-extern PyObject* PyInit__sha512(void);
-extern PyObject* PyInit_time(void);
-extern PyObject* PyInit__thread(void);
-extern PyObject* PyInit__codecs(void);
-extern PyObject* PyInit__weakref(void);
-extern PyObject* PyInit_xxsubtype(void);
-extern PyObject* PyInit_zipimport(void);
-extern PyObject* PyInit__random(void);
-extern PyObject* PyInit_itertools(void);
-extern PyObject* PyInit__collections(void);
-extern PyObject* PyInit__heapq(void);
-extern PyObject* PyInit__bisect(void);
-extern PyObject* PyInit__symtable(void);
-extern PyObject* PyInit_mmap(void);
-extern PyObject* PyInit__csv(void);
-extern PyObject* PyInit__sre(void);
-extern PyObject* PyInit_parser(void);
-extern PyObject* PyInit__struct(void);
-extern PyObject* PyInit__datetime(void);
-extern PyObject* PyInit__functools(void);
-extern PyObject* PyInit__json(void);
-extern PyObject* PyInit_zlib(void);
-extern PyObject* PyInit__multibytecodec(void);
-extern PyObject* PyInit__codecs_cn(void);
-extern PyObject* PyInit__codecs_hk(void);
-extern PyObject* PyInit__codecs_iso2022(void);
-extern PyObject* PyInit__codecs_jp(void);
-extern PyObject* PyInit__codecs_kr(void);
-extern PyObject* PyInit__codecs_tw(void);
-extern PyObject* PyInit__winapi(void);
-extern PyObject* PyInit__lsprof(void);
-extern PyObject* PyInit__ast(void);
-extern PyObject* PyInit__io(void);
-extern PyObject* PyInit__pickle(void);
-extern PyObject* PyInit_atexit(void);
-extern PyObject* _PyWarnings_Init(void);
-extern PyObject* PyInit__string(void);
-extern PyObject* PyInit__stat(void);
-extern PyObject* PyInit__opcode(void);
-extern PyObject* PyMarshal_Init(void);
-extern PyObject* PyInit__imp(void);
-
-struct _inittab _PyImport_Inittab[] = {
- {"posix", PyInit_posix},
- {"pwd", PyInit_pwd},
- {"fcntl", PyInit_fcntl},
- {"_posixsubprocess", PyInit__posixsubprocess},
- {"termios", PyInit_termios},
- {"audioop", PyInit_audioop},
- {"_locale", PyInit__locale},
- {"array", PyInit_array},
- {"_ast", PyInit__ast},
- {"binascii", PyInit_binascii},
- {"cmath", PyInit_cmath},
- {"errno", PyInit_errno},
- {"faulthandler", PyInit_faulthandler},
- {"gc", PyInit_gc},
- {"math", PyInit_math},
- {"_operator", PyInit__operator},
- {"_signal", PyInit__signal},
- {"_md5", PyInit__md5},
- {"_sha1", PyInit__sha1},
- {"_sha256", PyInit__sha256},
- {"_sha512", PyInit__sha512},
- {"time", PyInit_time},
- {"_thread", PyInit__thread},
- {"_tracemalloc", PyInit__tracemalloc},
- {"_codecs", PyInit__codecs},
- {"_weakref", PyInit__weakref},
- {"_random", PyInit__random},
- {"_bisect", PyInit__bisect},
- {"_heapq", PyInit__heapq},
- {"_lsprof", PyInit__lsprof},
- {"itertools", PyInit_itertools},
- {"_collections", PyInit__collections},
- {"_symtable", PyInit__symtable},
- {"mmap", PyInit_mmap},
- {"_csv", PyInit__csv},
- {"_sre", PyInit__sre},
- {"parser", PyInit_parser},
- {"_struct", PyInit__struct},
- {"_datetime", PyInit__datetime},
- {"_functools", PyInit__functools},
- {"_json", PyInit__json},
-
- {"xxsubtype", PyInit_xxsubtype},
- {"zipimport", PyInit_zipimport},
- {"zlib", PyInit_zlib},
-
- /* CJK codecs */
- {"_multibytecodec", PyInit__multibytecodec},
- {"_codecs_cn", PyInit__codecs_cn},
- {"_codecs_hk", PyInit__codecs_hk},
- {"_codecs_iso2022", PyInit__codecs_iso2022},
- {"_codecs_jp", PyInit__codecs_jp},
- {"_codecs_kr", PyInit__codecs_kr},
- {"_codecs_tw", PyInit__codecs_tw},
-
- /* This module "lives in" with marshal.c */
- {"marshal", PyMarshal_Init},
-
- /* This lives it with import.c */
- {"_imp", PyInit__imp},
-
- /* These entries are here for sys.builtin_module_names */
- {"builtins", NULL},
- {"sys", NULL},
- {"_warnings", _PyWarnings_Init},
- {"_string", PyInit__string},
-
- {"_io", PyInit__io},
- {"_pickle", PyInit__pickle},
- {"atexit", PyInit_atexit},
- {"_stat", PyInit__stat},
- {"_opcode", PyInit__opcode},
-
- /* Sentinel */
- {0, 0}
-};
-
diff --git a/recipes/python3crystax/interpreter.c.3.7 b/recipes/python3crystax/interpreter.c.3.7
deleted file mode 100644
index daf2c52..0000000
--- a/recipes/python3crystax/interpreter.c.3.7
+++ /dev/null
@@ -1,199 +0,0 @@
-#include <stdio.h>
-#include <limits.h>
-#include <unistd.h>
-#include <string.h>
-#include <dlfcn.h>
-#include <wchar.h>
-#include <locale.h>
-#include <stdlib.h>
-
-#define PYTHON3_STDLIB_REL_PATH "stdlib.zip"
-#define PYTHON3_MODULES_REL_PATH "modules"
-#define PYTHON3_DLL_REL_PATH "libpython3.7m.so"
-
-#define SYS_PATH_BUFFER_SIZE (2*(PATH_MAX + 1))
-
-static char NULL_PTR_STR[] = "NULL";
-
-static void GetExecutablePath(char* path)
-{
- int size = readlink("/proc/self/exe", path, PATH_MAX);
- if (size < 0)
- size = 0;
- path[size] = 0;
-}
-
-static void GetRelativePathFormat(char* base, char* fmt)
-{
- unsigned idx;
- char *p, *end;
- end = strrchr(base, '/');
- for (idx = 0, p = base; *p; ++p, ++idx)
- {
- fmt[idx] = *p;
- if (p == end)
- break;
- }
- fmt[++idx] = '%';
- fmt[++idx] = 's';
- fmt[++idx] = 0;
-}
-
-typedef void (*Py_SetProgramNamePtr)(wchar_t*);
-typedef void (*Py_SetPathPtr)(const wchar_t*);
-typedef int (*Py_MainPtr)(int, wchar_t**);
-typedef void* (*PyMem_RawMallocPtr)(size_t);
-typedef void (*PyMem_RawFreePtr)(void*);
-typedef wchar_t* (*Py_DecodeLocalePtr)(const char*, size_t*);
-
-
-int main(int argc, char** argv)
-{
- char executable[PATH_MAX + 1] = {0};
- char pthfmt[PATH_MAX + 1] = {0};
- char corepath[PATH_MAX + 1] = {0};
- char stdlibpath[PATH_MAX + 1] = {0};
- char modpath[PATH_MAX + 1] = {0};
- char syspath[SYS_PATH_BUFFER_SIZE] = {0};
- void* core = 0;
- int retcode = 126;
- int i;
-
- Py_SetProgramNamePtr Py_SetProgramName = 0;
- Py_SetPathPtr Py_SetPath = 0;
- Py_MainPtr Py_Main = 0;
- PyMem_RawMallocPtr PyMem_RawMalloc = 0;
- PyMem_RawFreePtr PyMem_RawFree = 0;
- Py_DecodeLocalePtr Py_DecodeLocale = 0;
-
- GetExecutablePath(executable);
- GetRelativePathFormat(executable, pthfmt);
-
- snprintf(corepath, PATH_MAX, pthfmt, PYTHON3_DLL_REL_PATH);
- snprintf(stdlibpath, PATH_MAX, pthfmt, PYTHON3_STDLIB_REL_PATH);
- snprintf(modpath, PATH_MAX, pthfmt, PYTHON3_MODULES_REL_PATH);
- snprintf(syspath, SYS_PATH_BUFFER_SIZE-1, "%s:%s", stdlibpath, modpath);
-
- core = dlopen(corepath, RTLD_LAZY);
- if (core == 0)
- {
- const char* lasterr = dlerror();
- if (lasterr == 0)
- lasterr = NULL_PTR_STR;
- fprintf(stderr, "Fatal Python error: cannot load library: '%s', dlerror: %s\n", corepath, lasterr);
- goto exit;
- }
-
- Py_SetProgramName = (Py_SetProgramNamePtr)dlsym(core, "Py_SetProgramName");
- if (Py_SetProgramName == 0)
- {
- const char* lasterr = dlerror();
- if (lasterr == 0)
- lasterr = NULL_PTR_STR;
- fprintf(stderr, "Fatal Python error: cannot load symbol: '%s' from library '%s', dlerror: %s\n", "Py_SetProgramName", corepath, lasterr);
- goto exit;
- }
-
- Py_SetPath = (Py_SetPathPtr)dlsym(core, "Py_SetPath");
- if (Py_SetPath == 0)
- {
- const char* lasterr = dlerror();
- if (lasterr == 0)
- lasterr = NULL_PTR_STR;
- fprintf(stderr, "Fatal Python error: cannot load symbol: '%s' from library '%s', dlerror: %s\n", "Py_SetPath", corepath, lasterr);
- goto exit;
- }
-
- Py_Main = (Py_MainPtr)dlsym(core, "Py_Main");
- if (Py_Main == 0)
- {
- const char* lasterr = dlerror();
- if (lasterr == 0)
- lasterr = NULL_PTR_STR;
- fprintf(stderr, "Fatal Python error: cannot load symbol: '%s' from library '%s', dlerror: %s\n", "Py_Main", corepath, lasterr);
- goto exit;
- }
-
- PyMem_RawMalloc = (PyMem_RawMallocPtr)dlsym(core, "PyMem_RawMalloc");
- if (PyMem_RawMalloc == 0)
- {
- const char* lasterr = dlerror();
- if (lasterr == 0)
- lasterr = NULL_PTR_STR;
- fprintf(stderr, "Fatal Python error: cannot load symbol: '%s' from library '%s', dlerror: %s\n", "PyMem_RawMalloc", corepath, lasterr);
- goto exit;
- }
-
- PyMem_RawFree = (PyMem_RawFreePtr)dlsym(core, "PyMem_RawFree");
- if (PyMem_RawFree == 0)
- {
- const char* lasterr = dlerror();
- if (lasterr == 0)
- lasterr = NULL_PTR_STR;
- fprintf(stderr, "Fatal Python error: cannot load symbol: '%s' from library '%s', dlerror: %s\n", "PyMem_RawFree", corepath, lasterr);
- goto exit;
- }
-
- Py_DecodeLocale = (Py_DecodeLocalePtr)dlsym(core, "Py_DecodeLocale");
- if (Py_DecodeLocale == 0)
- {
- const char* lasterr = dlerror();
- if (lasterr == 0)
- lasterr = NULL_PTR_STR;
- fprintf(stderr, "Fatal Python error: cannot load symbol: '%s' from library '%s', dlerror: %s\n", "Py_DecodeLocale", corepath, lasterr);
- goto exit;
- }
-
- wchar_t* executable_w = Py_DecodeLocale(executable, 0);
- if (executable_w == 0)
- {
- fprintf(stderr, "Fatal Python error: unable to decode executable path: '%s'\n", executable);
- goto exit;
- }
-
- wchar_t* syspath_w = Py_DecodeLocale(syspath, 0);
- if (syspath_w == 0)
- {
- fprintf(stderr, "Fatal Python error: unable to decode syspath: '%s'\n", syspath);
- goto exit;
- }
-
- wchar_t** argv_copy = (wchar_t **)PyMem_RawMalloc(sizeof(wchar_t*)*(argc+1));
- wchar_t** argv_copy2 = (wchar_t **)PyMem_RawMalloc(sizeof(wchar_t*)*(argc+1));
-
- char* oldloc = strdup(setlocale(LC_ALL, 0));
- setlocale(LC_ALL, "");
- for (i = 0; i < argc; ++i)
- {
- argv_copy[i] = Py_DecodeLocale(argv[i], 0);
- if (argv_copy[i] == 0)
- {
- free(oldloc);
- fprintf(stderr, "Fatal Python error: unable to decode the command line argument #%i\n", i + 1);
- goto exit;
- }
- argv_copy2[i] = argv_copy[i];
- }
- argv_copy2[argc] = argv_copy[argc] = 0;
- setlocale(LC_ALL, oldloc);
- free(oldloc);
-
- Py_SetProgramName(executable_w);
- Py_SetPath(syspath_w);
- retcode = Py_Main(argc, argv_copy);
-
- PyMem_RawFree(executable_w);
- PyMem_RawFree(syspath_w);
- for (i = 0; i < argc; i++)
- {
- PyMem_RawFree(argv_copy2[i]);
- }
- PyMem_RawFree(argv_copy);
- PyMem_RawFree(argv_copy2);
-
-exit:
- if (core != 0)
- dlclose(core);
-
- return retcode;
-}
diff --git a/recipes/python3crystax/patch_python3.6.patch b/recipes/python3crystax/patch_python3.6.patch
deleted file mode 100644
index 4402d1b..0000000
--- a/recipes/python3crystax/patch_python3.6.patch
+++ /dev/null
@@ -1,89 +0,0 @@
-diff --git a/Modules/expat/xmlparse.c b/Modules/expat/xmlparse.c
---- a/Modules/expat/xmlparse.c
-+++ b/Modules/expat/xmlparse.c
-@@ -84,6 +84,8 @@
- # define LOAD_LIBRARY_SEARCH_SYSTEM32 0x00000800
- #endif
-
-+#define XML_POOR_ENTROPY 1
-+
- #if !defined(HAVE_GETRANDOM) && !defined(HAVE_SYSCALL_GETRANDOM) \
- && !defined(HAVE_ARC4RANDOM_BUF) && !defined(HAVE_ARC4RANDOM) \
- && !defined(XML_DEV_URANDOM) \
-diff --git a/Modules/getpath.c b/Modules/getpath.c
---- a/Modules/getpath.c
-+++ b/Modules/getpath.c
-@@ -101,8 +101,35 @@
- #endif
-
-
--#if !defined(PREFIX) || !defined(EXEC_PREFIX) || !defined(VERSION) || !defined(VPATH)
--#error "PREFIX, EXEC_PREFIX, VERSION, and VPATH must be constant defined"
-+ /* These variables were set this way in old versions of Python, but
-+ changed somewhere between 3.5.0 and 3.5.3. Here we just force
-+ the old way again. A better solution would be to work out where
-+ they should be defined, and make the CrystaX build scripts do
-+ so. */
-+
-+/* #if !defined(PREFIX) || !defined(EXEC_PREFIX) || !defined(VERSION) || !defined(VPATH) */
-+/* #error "PREFIX, EXEC_PREFIX, VERSION, and VPATH must be constant defined" */
-+/* #endif */
-+
-+#ifndef VERSION
-+#define VERSION "2.1"
-+#endif
-+
-+#ifndef VPATH
-+#define VPATH "."
-+#endif
-+
-+#ifndef PREFIX
-+# define PREFIX "/usr/local"
-+#endif
-+
-+#ifndef EXEC_PREFIX
-+#define EXEC_PREFIX PREFIX
-+#endif
-+
-+#ifndef PYTHONPATH
-+#define PYTHONPATH PREFIX "/lib/python" VERSION ":" \
-+ EXEC_PREFIX "/lib/python" VERSION "/lib-dynload"
- #endif
-
- #ifndef LANDMARK
-diff --git a/Modules/timemodule.c b/Modules/timemodule.c
---- a/Modules/timemodule.c
-+++ b/Modules/timemodule.c
-@@ -358,18 +358,20 @@ time_gmtime(PyObject *self, PyObject *args)
- #endif
- }
-
--#ifndef HAVE_TIMEGM
--static time_t
--timegm(struct tm *p)
--{
-- /* XXX: the following implementation will not work for tm_year < 1970.
-- but it is likely that platforms that don't have timegm do not support
-- negative timestamps anyways. */
-- return p->tm_sec + p->tm_min*60 + p->tm_hour*3600 + p->tm_yday*86400 +
-- (p->tm_year-70)*31536000 + ((p->tm_year-69)/4)*86400 -
-- ((p->tm_year-1)/100)*86400 + ((p->tm_year+299)/400)*86400;
--}
--#endif
-+/* In the Android build, HAVE_TIMEGM apparently should be defined but isn't. A better fix would be to work out why and fix that. */
-+
-+/* #ifndef HAVE_TIMEGM */
-+/* static time_t */
-+/* timegm(struct tm *p) */
-+/* { */
-+/* /\* XXX: the following implementation will not work for tm_year < 1970. */
-+/* but it is likely that platforms that don't have timegm do not support */
-+/* negative timestamps anyways. *\/ */
-+/* return p->tm_sec + p->tm_min*60 + p->tm_hour*3600 + p->tm_yday*86400 + */
-+/* (p->tm_year-70)*31536000 + ((p->tm_year-69)/4)*86400 - */
-+/* ((p->tm_year-1)/100)*86400 + ((p->tm_year+299)/400)*86400; */
-+/* } */
-+/* #endif */
-
- PyDoc_STRVAR(gmtime_doc,
- "gmtime([seconds]) -> (tm_year, tm_mon, tm_mday, tm_hour, tm_min,\n\
diff --git a/recipes/python3crystax/remove_android_api_check.patch b/recipes/python3crystax/remove_android_api_check.patch
deleted file mode 100644
index 55613b6..0000000
--- a/recipes/python3crystax/remove_android_api_check.patch
+++ /dev/null
@@ -1,42 +0,0 @@
---- a/configure 2018-10-20 07:04:19.000000000 +0100
-+++ b/configure 2018-12-17 08:26:38.713933919 +0100
-@@ -5650,34 +5650,6 @@
- #endif
- EOF
-
--if $CPP $CPPFLAGS conftest.c >conftest.out 2>/dev/null; then
-- ANDROID_API_LEVEL=`sed -n -e '/__ANDROID_API__/d' -e 's/^android_api = //p' conftest.out`
-- _arm_arch=`sed -n -e '/__ARM_ARCH/d' -e 's/^arm_arch = //p' conftest.out`
-- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ANDROID_API_LEVEL" >&5
--$as_echo "$ANDROID_API_LEVEL" >&6; }
-- if test -z "$ANDROID_API_LEVEL"; then
-- echo 'Fatal: you must define __ANDROID_API__'
-- exit 1
-- fi
--
--cat >>confdefs.h <<_ACEOF
--#define ANDROID_API_LEVEL $ANDROID_API_LEVEL
--_ACEOF
--
--
-- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the Android arm ABI" >&5
--$as_echo_n "checking for the Android arm ABI... " >&6; }
-- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_arm_arch" >&5
--$as_echo "$_arm_arch" >&6; }
-- if test "$_arm_arch" = 7; then
-- BASECFLAGS="${BASECFLAGS} -mfloat-abi=softfp -mfpu=vfpv3-d16"
-- LDFLAGS="${LDFLAGS} -march=armv7-a -Wl,--fix-cortex-a8"
-- fi
--else
-- { $as_echo "$as_me:${as_lineno-$LINENO}: result: not Android" >&5
--$as_echo "not Android" >&6; }
--fi
--rm -f conftest.c conftest.out
-
- # Check for unsupported systems
- case $ac_sys_system/$ac_sys_release in
-@@ -18383,4 +18355,3 @@
- echo "" >&6
- echo "" >&6
- fi
--
diff --git a/recipes/python3crystax/selectors.patch b/recipes/python3crystax/selectors.patch
deleted file mode 100644
index 89e4966..0000000
--- a/recipes/python3crystax/selectors.patch
+++ /dev/null
@@ -1,15 +0,0 @@
---- a/Lib/selectors.py 2018-06-27 00:39:50.000000000 +0100
-+++ b/Lib/selectors.py 2018-10-28 17:39:46.027757518 +0100
-@@ -599,9 +599,9 @@
- # Choose the best implementation, roughly:
- # epoll|kqueue|devpoll > poll > select.
- # select() also can't accept a FD > FD_SETSIZE (usually around 1024)
--if 'KqueueSelector' in globals():
-- DefaultSelector = KqueueSelector
--elif 'EpollSelector' in globals():
-+#if 'KqueueSelector' in globals():
-+# DefaultSelector = KqueueSelector
-+if 'EpollSelector' in globals():
- DefaultSelector = EpollSelector
- elif 'DevpollSelector' in globals():
- DefaultSelector = DevpollSelector
diff --git a/scripts/build-target-python.sh b/scripts/build-target-python.sh
index 0656a98..d821c96 100755
--- a/scripts/build-target-python.sh
+++ b/scripts/build-target-python.sh
@@ -350,7 +350,11 @@ build_python_for_abi ()
echo " --with-threads \\"
echo " --enable-ipv6 \\"
echo " --with-computed-gotos \\"
- echo " --without-ensurepip"
+ echo " ac_cv_file__dev_ptmx=yes \\"
+ echo " ac_cv_file__dev_ptc=no \\"
+ echo " --without-ensurepip \\"
+ echo " ac_cv_little_endian_double=yes \\"
+ echo " --exec-prefix=/usr/local"
fi
} >$CONFIGURE_WRAPPER
fail_panic "Can't create configure wrapper"
@@ -382,8 +386,8 @@ build_python_for_abi ()
if [ "$PYTHON_MAJOR_VERSION" = "2" ]; then
local PYTHON_CORE_MODULE_NAME='python'"$PYTHON_ABI"
else
- local PYTHON_CORE_MODULE_NAME='python'"$PYTHON_ABI"'m'
- local PYTHON_SOABI='cpython-'"$PYTHON_ABI"'m'
+ local PYTHON_CORE_MODULE_NAME='python'"$PYTHON_ABI"
+ local PYTHON_SOABI='cpython-'"$PYTHON_ABI"
fi
{
echo 'LOCAL_PATH := $(call my-dir)'
@@ -391,6 +395,8 @@ build_python_for_abi ()
echo "LOCAL_MODULE := $PYTHON_CORE_MODULE_NAME"
echo "MY_PYTHON_SRC_ROOT := $PYTHON_SRCDIR"
echo 'LOCAL_C_INCLUDES := $(MY_PYTHON_SRC_ROOT)/Include'
+ echo 'LOCAL_C_INCLUDES += $(MY_PYTHON_SRC_ROOT)/Include/internal'
+ echo 'LOCAL_C_INCLUDES += $(MY_PYTHON_SRC_ROOT)/Include/cpython'
if [ "$PYTHON_MAJOR_VERSION" = "2" ]; then
echo "LOCAL_CFLAGS := -DPy_BUILD_CORE -DPy_ENABLE_SHARED -DPLATFORM=\\\"linux\\\""
else
@@ -951,6 +957,64 @@ build_python_for_abi ()
log "Install python$PYTHON_ABI-$ABI module 'unicodedata' in $PYBIN_INSTALLDIR_MODULES"
run cp -p -T $OBJDIR_UNICODEDATA/libunicodedata.so $PYBIN_INSTALLDIR_MODULES/unicodedata.so
fail_panic "Can't install python$PYTHON_ABI-$ABI module 'unicodedata' in $PYBIN_INSTALLDIR_MODULES"
+
+# _json speedups
+ local BUILDDIR_JSON="$BUILDDIR/json"
+ local OBJDIR_JSON="$BUILDDIR_JSON/obj/local/$ABI"
+
+ run mkdir -p "$BUILDDIR_JSON/jni"
+ fail_panic "Can't create directory: $BUILDDIR_JSON/jni"
+
+ {
+ echo 'LOCAL_PATH := $(call my-dir)'
+ echo 'include $(CLEAR_VARS)'
+ echo 'LOCAL_MODULE := _json'
+ echo "MY_PYTHON_SRC_ROOT := $PYTHON_SRCDIR"
+ echo 'LOCAL_SRC_FILES := \'
+ echo ' $(MY_PYTHON_SRC_ROOT)/Modules/_json.c'
+ echo 'LOCAL_STATIC_LIBRARIES := python_shared'
+ echo 'LOCAL_C_INCLUDES := $(MY_PYTHON_SRC_ROOT)/Include/internal'
+ echo 'LOCAL_C_FLAGS := -DPy_BUILD_CORE_MODULE'
+ echo 'include $(BUILD_SHARED_LIBRARY)'
+ echo "\$(call import-module,python/$PYTHON_ABI)"
+ } >$BUILDDIR_JSON/jni/Android.mk
+ fail_panic "Can't generate $BUILDDIR_JSON/jni/Android.mk"
+
+ run $NDK_DIR/ndk-build -C $BUILDDIR_JSON -j$NUM_JOBS APP_ABI=$ABI V=1
+ fail_panic "Can't build python$PYTHON_ABI-$ABI module '_json'"
+
+ log "Install python$PYTHON_ABI-$ABI module '_json' in $PYBIN_INSTALLDIR_MODULES"
+ run cp -p -T $OBJDIR_JSON/lib_json.so $PYBIN_INSTALLDIR_MODULES/_json.so
+ fail_panic "Can't install python$PYTHON_ABI-$ABI module '_json' in $PYBIN_INSTALLDIR_MODULES"
+
+# _pickle accelerator
+ local BUILDDIR_PICKLE="$BUILDDIR/pickle"
+ local OBJDIR_PICKLE="$BUILDDIR_PICKLE/obj/local/$ABI"
+
+ run mkdir -p "$BUILDDIR_PICKLE/jni"
+ fail_panic "Can't create directory: $BUILDDIR_PICKLE/jni"
+
+ {
+ echo 'LOCAL_PATH := $(call my-dir)'
+ echo 'include $(CLEAR_VARS)'
+ echo 'LOCAL_MODULE := _pickle'
+ echo "MY_PYTHON_SRC_ROOT := $PYTHON_SRCDIR"
+ echo 'LOCAL_SRC_FILES := \'
+ echo ' $(MY_PYTHON_SRC_ROOT)/Modules/_pickle.c'
+ echo 'LOCAL_STATIC_LIBRARIES := python_shared'
+ echo 'LOCAL_C_INCLUDES := $(MY_PYTHON_SRC_ROOT)/Include/internal'
+ echo 'LOCAL_C_FLAGS := -DPy_BUILD_CORE_MODULE'
+ echo 'include $(BUILD_SHARED_LIBRARY)'
+ echo "\$(call import-module,python/$PYTHON_ABI)"
+ } >$BUILDDIR_PICKLE/jni/Android.mk
+ fail_panic "Can't generate $BUILDDIR_PICKLE/jni/Android.mk"
+
+ run $NDK_DIR/ndk-build -C $BUILDDIR_PICKLE -j$NUM_JOBS APP_ABI=$ABI V=1
+ fail_panic "Can't build python$PYTHON_ABI-$ABI module '_pickle'"
+
+ log "Install python$PYTHON_ABI-$ABI module '_pickle' in $PYBIN_INSTALLDIR_MODULES"
+ run cp -p -T $OBJDIR_PICKLE/lib_pickle.so $PYBIN_INSTALLDIR_MODULES/_pickle.so
+ fail_panic "Can't install python$PYTHON_ABI-$ABI module '_pickle' in $PYBIN_INSTALLDIR_MODULES"
}
if [ -n "$PACKAGE_DIR" ]; then

View file

@ -6,9 +6,7 @@ from os.path import join
class PyjniusRecipe(CythonRecipe):
# "6553ad4" is one commit after last release (1.2.0)
# it fixes method resolution, required for resolving requestPermissions()
version = '6553ad4'
version = '1.3.0'
url = 'https://github.com/kivy/pyjnius/archive/{version}.zip'
name = 'pyjnius'
depends = [('genericndkbuild', 'sdl2', 'sdl'), 'six']

View file

@ -170,7 +170,28 @@ class Python3Recipe(TargetPythonRecipe):
def prebuild_arch(self, arch):
super(Python3Recipe, self).prebuild_arch(arch)
if self.version == '3.6' or self.version == '3.7' or self.version == '3.9':
Python3Recipe.patches = ['patch_python3.6.patch', 'remove_android_api_check.patch', 'selectors.patch']
Python3Recipe.patches = [
'patch/patch_python3.6.patch',
'patch/remove_android_api_check.patch',
'patch/selectors.patch'
]
if self.version == '3.9':
Python3Recipe.patches = [
'patch/remove_android_api_check.patch',
'patch/patch_python3.9.patch',
'patch/platlibdir.patch',
'patch/strdup.patch',
# from https://github.com/kivy/python-for-android/blob/develop/pythonforandroid/recipes/python3/__init__.py#L63
'patch/pyconfig_detection.patch',
'patch/reproducible-buildinfo.diff',
'patch/py3.8.1.patch'
]
if sh.which('lld') is not None:
Python3Recipe.patches += ['patch/py3.8.1_fix_cortex_a8.patch']
build_dir = self.get_build_dir(arch.arch)
# copy bundled libffi to _ctypes

View file

@ -27,14 +27,17 @@ LOCAL_SRC_FILES := config.c \
$(MY_PYTHON_SRC_ROOT)/Python/getversion.c \
$(MY_PYTHON_SRC_ROOT)/Python/graminit.c \
$(MY_PYTHON_SRC_ROOT)/Python/hamt.c \
$(MY_PYTHON_SRC_ROOT)/Python/hashtable.c \
$(MY_PYTHON_SRC_ROOT)/Python/import.c \
$(MY_PYTHON_SRC_ROOT)/Python/importdl.c \
$(MY_PYTHON_SRC_ROOT)/Python/initconfig.c \
$(MY_PYTHON_SRC_ROOT)/Python/marshal.c \
$(MY_PYTHON_SRC_ROOT)/Python/modsupport.c \
$(MY_PYTHON_SRC_ROOT)/Python/mysnprintf.c \
$(MY_PYTHON_SRC_ROOT)/Python/mystrtoul.c \
$(MY_PYTHON_SRC_ROOT)/Python/pathconfig.c \
$(MY_PYTHON_SRC_ROOT)/Python/peephole.c \
$(MY_PYTHON_SRC_ROOT)/Python/preconfig.c \
$(MY_PYTHON_SRC_ROOT)/Python/pyarena.c \
$(MY_PYTHON_SRC_ROOT)/Python/pyctype.c \
$(MY_PYTHON_SRC_ROOT)/Python/pyfpe.c \
@ -57,17 +60,18 @@ LOCAL_SRC_FILES := config.c \
$(MY_PYTHON_SRC_ROOT)/Python/_warnings.c \
\
$(MY_PYTHON_SRC_ROOT)/Parser/acceler.c \
$(MY_PYTHON_SRC_ROOT)/Parser/bitset.c \
$(MY_PYTHON_SRC_ROOT)/Parser/firstsets.c \
$(MY_PYTHON_SRC_ROOT)/Parser/grammar.c \
$(MY_PYTHON_SRC_ROOT)/Parser/grammar1.c \
$(MY_PYTHON_SRC_ROOT)/Parser/listnode.c \
$(MY_PYTHON_SRC_ROOT)/Parser/metagrammar.c \
$(MY_PYTHON_SRC_ROOT)/Parser/myreadline.c \
$(MY_PYTHON_SRC_ROOT)/Parser/node.c \
$(MY_PYTHON_SRC_ROOT)/Parser/parser.c \
$(MY_PYTHON_SRC_ROOT)/Parser/parsetok.c \
$(MY_PYTHON_SRC_ROOT)/Parser/token.c \
$(MY_PYTHON_SRC_ROOT)/Parser/tokenizer.c \
$(MY_PYTHON_SRC_ROOT)/Parser/pegen/parse.c \
$(MY_PYTHON_SRC_ROOT)/Parser/pegen/parse_string.c \
$(MY_PYTHON_SRC_ROOT)/Parser/pegen/peg_api.c \
$(MY_PYTHON_SRC_ROOT)/Parser/pegen/pegen.c \
\
$(MY_PYTHON_SRC_ROOT)/Objects/abstract.c \
$(MY_PYTHON_SRC_ROOT)/Objects/accu.c \
@ -90,6 +94,8 @@ LOCAL_SRC_FILES := config.c \
$(MY_PYTHON_SRC_ROOT)/Objects/frameobject.c \
$(MY_PYTHON_SRC_ROOT)/Objects/funcobject.c \
$(MY_PYTHON_SRC_ROOT)/Objects/genobject.c \
$(MY_PYTHON_SRC_ROOT)/Objects/genericaliasobject.c \
$(MY_PYTHON_SRC_ROOT)/Objects/interpreteridobject.c \
$(MY_PYTHON_SRC_ROOT)/Objects/iterobject.c \
$(MY_PYTHON_SRC_ROOT)/Objects/listobject.c \
$(MY_PYTHON_SRC_ROOT)/Objects/longobject.c \
@ -100,6 +106,7 @@ LOCAL_SRC_FILES := config.c \
$(MY_PYTHON_SRC_ROOT)/Objects/object.c \
$(MY_PYTHON_SRC_ROOT)/Objects/obmalloc.c \
$(MY_PYTHON_SRC_ROOT)/Objects/odictobject.c \
$(MY_PYTHON_SRC_ROOT)/Objects/picklebufobject.c \
$(MY_PYTHON_SRC_ROOT)/Objects/rangeobject.c \
$(MY_PYTHON_SRC_ROOT)/Objects/setobject.c \
$(MY_PYTHON_SRC_ROOT)/Objects/sliceobject.c \
@ -131,10 +138,8 @@ LOCAL_SRC_FILES := config.c \
$(MY_PYTHON_SRC_ROOT)/Modules/gcmodule.c \
$(MY_PYTHON_SRC_ROOT)/Modules/getbuildinfo.c \
$(MY_PYTHON_SRC_ROOT)/Modules/getpath.c \
$(MY_PYTHON_SRC_ROOT)/Modules/hashtable.c \
$(MY_PYTHON_SRC_ROOT)/Modules/_heapqmodule.c \
$(MY_PYTHON_SRC_ROOT)/Modules/itertoolsmodule.c \
$(MY_PYTHON_SRC_ROOT)/Modules/_json.c \
$(MY_PYTHON_SRC_ROOT)/Modules/_localemodule.c \
$(MY_PYTHON_SRC_ROOT)/Modules/_lsprof.c \
$(MY_PYTHON_SRC_ROOT)/Modules/main.c \
@ -146,7 +151,6 @@ LOCAL_SRC_FILES := config.c \
$(MY_PYTHON_SRC_ROOT)/Modules/_operator.c \
$(MY_PYTHON_SRC_ROOT)/Modules/ossaudiodev.c \
$(MY_PYTHON_SRC_ROOT)/Modules/parsermodule.c \
$(MY_PYTHON_SRC_ROOT)/Modules/_pickle.c \
$(MY_PYTHON_SRC_ROOT)/Modules/posixmodule.c \
$(MY_PYTHON_SRC_ROOT)/Modules/_posixsubprocess.c \
$(MY_PYTHON_SRC_ROOT)/Modules/pwdmodule.c \
@ -176,7 +180,6 @@ LOCAL_SRC_FILES := config.c \
$(MY_PYTHON_SRC_ROOT)/Modules/xxlimited.c \
$(MY_PYTHON_SRC_ROOT)/Modules/xxmodule.c \
$(MY_PYTHON_SRC_ROOT)/Modules/xxsubtype.c \
$(MY_PYTHON_SRC_ROOT)/Modules/zipimport.c \
$(MY_PYTHON_SRC_ROOT)/Modules/zlibmodule.c \
$(MY_PYTHON_SRC_ROOT)/Modules/cjkcodecs/_codecs_cn.c \
$(MY_PYTHON_SRC_ROOT)/Modules/cjkcodecs/_codecs_hk.c \

View file

@ -26,7 +26,6 @@ extern PyObject* PyInit__thread(void);
extern PyObject* PyInit__codecs(void);
extern PyObject* PyInit__weakref(void);
extern PyObject* PyInit_xxsubtype(void);
extern PyObject* PyInit_zipimport(void);
extern PyObject* PyInit__random(void);
extern PyObject* PyInit_itertools(void);
extern PyObject* PyInit__collections(void);
@ -40,7 +39,6 @@ extern PyObject* PyInit_parser(void);
extern PyObject* PyInit__struct(void);
extern PyObject* PyInit__datetime(void);
extern PyObject* PyInit__functools(void);
extern PyObject* PyInit__json(void);
extern PyObject* PyInit_zlib(void);
extern PyObject* PyInit__multibytecodec(void);
extern PyObject* PyInit__codecs_cn(void);
@ -53,7 +51,6 @@ extern PyObject* PyInit__winapi(void);
extern PyObject* PyInit__lsprof(void);
extern PyObject* PyInit__ast(void);
extern PyObject* PyInit__io(void);
extern PyObject* PyInit__pickle(void);
extern PyObject* PyInit_atexit(void);
extern PyObject* _PyWarnings_Init(void);
extern PyObject* PyInit__string(void);
@ -103,10 +100,8 @@ struct _inittab _PyImport_Inittab[] = {
{"_struct", PyInit__struct},
{"_datetime", PyInit__datetime},
{"_functools", PyInit__functools},
{"_json", PyInit__json},
{"xxsubtype", PyInit_xxsubtype},
{"zipimport", PyInit_zipimport},
{"zlib", PyInit_zlib},
/* CJK codecs */
@ -131,7 +126,6 @@ struct _inittab _PyImport_Inittab[] = {
{"_string", PyInit__string},
{"_io", PyInit__io},
{"_pickle", PyInit__pickle},
{"atexit", PyInit_atexit},
{"_stat", PyInit__stat},
{"_opcode", PyInit__opcode},

View file

@ -9,7 +9,7 @@
#define PYTHON3_STDLIB_REL_PATH "stdlib.zip"
#define PYTHON3_MODULES_REL_PATH "modules"
#define PYTHON3_DLL_REL_PATH "libpython3.7m.so"
#define PYTHON3_DLL_REL_PATH "libpython3.9.so"
#define SYS_PATH_BUFFER_SIZE (2*(PATH_MAX + 1))

View file

@ -0,0 +1,93 @@
--- a/Modules/expat/xmlparse.c 2021-06-28 09:26:18.000000000 +0100
+++ b/Modules/expat/xmlparse.c 2021-08-20 10:19:38.946990574 +0100
@@ -89,6 +89,8 @@
# define LOAD_LIBRARY_SEARCH_SYSTEM32 0x00000800
#endif
+#define XML_POOR_ENTROPY 1
+
#if ! defined(HAVE_GETRANDOM) && ! defined(HAVE_SYSCALL_GETRANDOM) \
&& ! defined(HAVE_ARC4RANDOM_BUF) && ! defined(HAVE_ARC4RANDOM) \
&& ! defined(XML_DEV_URANDOM) && ! defined(_WIN32)
diff --git a/Modules/getpath.c b/Modules/getpath.c
--- a/Modules/getpath.c 2021-06-28 09:26:18.000000000 +0100
+++ b/Modules/getpath.c 2021-08-20 10:29:27.000481395 +0100
@@ -103,10 +103,39 @@
extern "C" {
#endif
+/*
+ These variables were set this way in older versions of Python, but
+ changed from 3.5.1 and 3.5.2.
+ https://github.com/python/cpython/commit/f5854148138280c69fdc9d350636dc2140d57753
+ Here we just the old way again. A better solution would be to work
+ out where they should be defined, and make the CrystaX build scripts do so.
+*/
-#if (!defined(PREFIX) || !defined(EXEC_PREFIX) \
- || !defined(VERSION) || !defined(VPATH))
-#error "PREFIX, EXEC_PREFIX, VERSION and VPATH macros must be defined"
+/*
+ * #if (!defined(PREFIX) || !defined(EXEC_PREFIX) \
+ * || !defined(VERSION) || !defined(VPATH))
+ * #error "PREFIX, EXEC_PREFIX, VERSION and VPATH macros must be defined"
+ * #endif
+ */
+#ifndef VERSION
+#define VERSION "2.1"
+#endif
+
+#ifndef VPATH
+#define VPATH "."
+#endif
+
+#ifndef PREFIX
+# define PREFIX "/usr/local"
+#endif
+
+#ifndef EXEC_PREFIX
+#define EXEC_PREFIX PREFIX
+#endif
+
+#ifndef PYTHONPATH
+#define PYTHONPATH PREFIX "/lib/python" VERSION ":" \
+ EXEC_PREFIX "/lib/python" VERSION "/lib-dynload"
#endif
#ifndef LANDMARK
diff --git a/Modules/timemodule.c b/Modules/timemodule.c
--- a/Modules/timemodule.c
+++ b/Modules/timemodule.c
@@ -358,18 +358,20 @@ time_gmtime(PyObject *self, PyObject *args)
#endif
}
-#ifndef HAVE_TIMEGM
-static time_t
-timegm(struct tm *p)
-{
- /* XXX: the following implementation will not work for tm_year < 1970.
- but it is likely that platforms that don't have timegm do not support
- negative timestamps anyways. */
- return p->tm_sec + p->tm_min*60 + p->tm_hour*3600 + p->tm_yday*86400 +
- (p->tm_year-70)*31536000 + ((p->tm_year-69)/4)*86400 -
- ((p->tm_year-1)/100)*86400 + ((p->tm_year+299)/400)*86400;
-}
-#endif
+/* In the Android build, HAVE_TIMEGM apparently should be defined but isn't. A better fix would be to work out why and fix that. */
+
+/* #ifndef HAVE_TIMEGM */
+/* static time_t */
+/* timegm(struct tm *p) */
+/* { */
+/* /\* XXX: the following implementation will not work for tm_year < 1970. */
+/* but it is likely that platforms that don't have timegm do not support */
+/* negative timestamps anyways. *\/ */
+/* return p->tm_sec + p->tm_min*60 + p->tm_hour*3600 + p->tm_yday*86400 + */
+/* (p->tm_year-70)*31536000 + ((p->tm_year-69)/4)*86400 - */
+/* ((p->tm_year-1)/100)*86400 + ((p->tm_year+299)/400)*86400; */
+/* } */
+/* #endif */
PyDoc_STRVAR(gmtime_doc,
"gmtime([seconds]) -> (tm_year, tm_mon, tm_mday, tm_hour, tm_min,\n\

View file

@ -0,0 +1,11 @@
--- a/Python/initconfig.c 2021-06-28 09:26:18.000000000 +0100
+++ b/Python/initconfig.c 2021-08-20 12:03:57.319576456 +0100
@@ -25,7 +25,7 @@
#endif
#ifndef PLATLIBDIR
-# error "PLATLIBDIR macro must be defined"
+# define PLATLIBDIR "/usr/lib"
#endif

View file

@ -0,0 +1,42 @@
diff --git a/Lib/ctypes/util.py b/Lib/ctypes/util.py
index 97973bc..053c231 100644
--- a/Lib/ctypes/util.py
+++ b/Lib/ctypes/util.py
@@ -67,6 +67,13 @@ if os.name == "nt":
return fname
return None
+# This patch overrides the find_library to look in the right places on
+# Android
+if True:
+ from android._ctypes_library_finder import find_library as _find_lib
+ def find_library(name):
+ return _find_lib(name)
+
elif os.name == "posix" and sys.platform == "darwin":
from ctypes.macholib.dyld import dyld_find as _dyld_find
def find_library(name):
diff --git a/configure b/configure
index 0914e24..dd00812 100755
--- a/configure
+++ b/configure
@@ -18673,4 +18673,3 @@ if test "$Py_OPT" = 'false' -a "$Py_DEBUG" != 'true'; then
echo "" >&6
echo "" >&6
fi
-
diff --git a/setup.py b/setup.py
index 20d7f35..af15cc2 100644
--- a/setup.py
+++ b/setup.py
@@ -1501,7 +1501,9 @@ class PyBuildExt(build_ext):
if zlib_inc is not None:
zlib_h = zlib_inc[0] + '/zlib.h'
version = '"0.0.0"'
- version_req = '"1.1.3"'
+ # version_req = '"1.1.3"'
+ version_req = '"{}"'.format(
+ os.environ.get('ZLIB_VERSION', '1.1.3'))
if MACOS and is_macosx_sdk_path(zlib_h):
zlib_h = os.path.join(macosx_sdk_root(), zlib_h[1:])
with open(zlib_h) as fp:

View file

@ -0,0 +1,15 @@
This patch removes --fix-cortex-a8 from the linker flags in order to support linking
with lld, as lld does not support this flag (https://github.com/android-ndk/ndk/issues/766).
diff --git a/configure b/configure
index 0914e24..7517168 100755
--- a/configure
+++ b/configure
@@ -5642,7 +5642,7 @@ $as_echo_n "checking for the Android arm ABI... " >&6; }
$as_echo "$_arm_arch" >&6; }
if test "$_arm_arch" = 7; then
BASECFLAGS="${BASECFLAGS} -mfloat-abi=softfp -mfpu=vfpv3-d16"
- LDFLAGS="${LDFLAGS} -march=armv7-a -Wl,--fix-cortex-a8"
+ LDFLAGS="${LDFLAGS} -march=armv7-a"
fi
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: not Android" >&5

View file

@ -0,0 +1,13 @@
diff -Nru Python-3.8.2/Lib/site.py Python-3.8.2-new/Lib/site.py
--- Python-3.8.2/Lib/site.py 2020-04-28 12:48:38.000000000 -0700
+++ Python-3.8.2-new/Lib/site.py 2020-04-28 12:52:46.000000000 -0700
@@ -487,7 +487,8 @@
if key == 'include-system-site-packages':
system_site = value.lower()
elif key == 'home':
- sys._home = value
+ # this is breaking pyconfig.h path detection with venv
+ print('Ignoring "sys._home = value" override')
sys.prefix = sys.exec_prefix = site_prefix

View file

@ -0,0 +1,13 @@
# DP: Build getbuildinfo.o with DATE/TIME values when defined
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -785,6 +785,8 @@ Modules/getbuildinfo.o: $(PARSER_OBJS) \
-DGITVERSION="\"`LC_ALL=C $(GITVERSION)`\"" \
-DGITTAG="\"`LC_ALL=C $(GITTAG)`\"" \
-DGITBRANCH="\"`LC_ALL=C $(GITBRANCH)`\"" \
+ $(if $(BUILD_DATE),-DDATE='"$(BUILD_DATE)"') \
+ $(if $(BUILD_TIME),-DTIME='"$(BUILD_TIME)"') \
-o $@ $(srcdir)/Modules/getbuildinfo.c
Modules/getpath.o: $(srcdir)/Modules/getpath.c Makefile

View file

@ -0,0 +1,10 @@
--- a/Python/strdup.c 2021-06-28 09:26:18.000000000 +0100
+++ b/Python/strdup.c 2021-08-20 09:26:36.443055850 +0100
@@ -1,5 +1,7 @@
/* strdup() replacement (from stdwin, if you must know) */
+#include "Python.h"
+
char *
strdup(const char *str)
{

View file

@ -2,7 +2,7 @@ from pythonforandroid.recipe import PythonRecipe
class SetuptoolsRecipe(PythonRecipe):
version = '40.0.0'
version = '51.0.0'
url = 'https://pypi.python.org/packages/source/s/setuptools/setuptools-{version}.zip'
depends = [('python2', 'python3crystax')]

View file

@ -350,7 +350,11 @@ build_python_for_abi ()
echo " --with-threads \\"
echo " --enable-ipv6 \\"
echo " --with-computed-gotos \\"
echo " --without-ensurepip"
echo " ac_cv_file__dev_ptmx=yes \\"
echo " ac_cv_file__dev_ptc=no \\"
echo " --without-ensurepip \\"
echo " ac_cv_little_endian_double=yes \\"
echo " --exec-prefix=/usr/local"
fi
} >$CONFIGURE_WRAPPER
fail_panic "Can't create configure wrapper"
@ -391,6 +395,8 @@ build_python_for_abi ()
echo "LOCAL_MODULE := $PYTHON_CORE_MODULE_NAME"
echo "MY_PYTHON_SRC_ROOT := $PYTHON_SRCDIR"
echo 'LOCAL_C_INCLUDES := $(MY_PYTHON_SRC_ROOT)/Include'
echo 'LOCAL_C_INCLUDES += $(MY_PYTHON_SRC_ROOT)/Include/internal'
echo 'LOCAL_C_INCLUDES += $(MY_PYTHON_SRC_ROOT)/Include/cpython'
if [ "$PYTHON_MAJOR_VERSION" = "2" ]; then
echo "LOCAL_CFLAGS := -DPy_BUILD_CORE -DPy_ENABLE_SHARED -DPLATFORM=\\\"linux\\\""
else
@ -410,6 +416,8 @@ build_python_for_abi ()
run rm -Rf $PYTHON_DSTDIR/include
run mkdir -p $PYTHON_DSTDIR/include/python && \
run cp -p $PYTHON_BUILD_UTILS_DIR/pyconfig.h $PYTHON_SRCDIR/Include/*.h $PYTHON_DSTDIR/include/python
run cp -pR $PYTHON_SRCDIR/Include/internal $PYTHON_DSTDIR/include/python/internal
run cp -pR $PYTHON_SRCDIR/Include/cpython $PYTHON_DSTDIR/include/python/cpython
fail_panic "Can't install python$PYTHON_ABI headers"
PYTHON_HEADERS_INSTALLED=yes
export PYTHON_HEADERS_INSTALLED
@ -542,9 +550,11 @@ build_python_for_abi ()
{
echo 'LOCAL_PATH := $(call my-dir)'
echo 'include $(CLEAR_VARS)'
echo 'LOCAL_MODULE := _ctypes'
echo 'LOCAL_C_INCLUDES := $(LOCAL_PATH)/include'
echo "MY_PYTHON_SRC_ROOT := $PYTHON_SRCDIR"
echo 'LOCAL_MODULE := _ctypes'
echo 'LOCAL_CFLAGS := -DPy_BUILD_CORE'
echo 'LOCAL_C_INCLUDES := $(LOCAL_PATH)/include'
echo 'LOCAL_C_INCLUDES += $(MY_PYTHON_SRC_ROOT)/Include/internal'
echo 'LOCAL_SRC_FILES := \'
for ffi_src in $FFI_SRC_LIST; do
echo " \$(MY_PYTHON_SRC_ROOT)/Modules/_ctypes/libffi/$ffi_src \\"
@ -640,6 +650,7 @@ build_python_for_abi ()
echo "MY_PYTHON_SRC_ROOT := $PYTHON_SRCDIR"
echo 'LOCAL_SRC_FILES := \'
echo ' $(MY_PYTHON_SRC_ROOT)/Modules/_queuemodule.c'
echo 'LOCAL_C_INCLUDES := $(MY_PYTHON_SRC_ROOT)/Include/internal'
echo 'LOCAL_STATIC_LIBRARIES := python_shared'
echo 'include $(BUILD_SHARED_LIBRARY)'
echo "\$(call import-module,python/$PYTHON_ABI)"
@ -665,6 +676,8 @@ build_python_for_abi ()
echo 'include $(CLEAR_VARS)'
echo 'LOCAL_MODULE := _asyncio'
echo "MY_PYTHON_SRC_ROOT := $PYTHON_SRCDIR"
echo 'LOCAL_CFLAGS := -DPy_BUILD_CORE'
echo 'LOCAL_C_INCLUDES := $(MY_PYTHON_SRC_ROOT)/Include/internal'
echo 'LOCAL_SRC_FILES := \'
echo ' $(MY_PYTHON_SRC_ROOT)/Modules/_asynciomodule.c'
echo 'LOCAL_STATIC_LIBRARIES := python_shared'
@ -879,7 +892,7 @@ build_python_for_abi ()
echo 'LOCAL_MODULE := pyexpat'
echo 'LOCAL_CFLAGS := -DHAVE_EXPAT_CONFIG_H -DXML_STATIC'
echo "MY_PYTHON_SRC_ROOT := $PYTHON_SRCDIR"
echo "LOCAL_C_INCLUDES := \$(MY_PYTHON_SRC_ROOT)/Modules/expat"
echo 'LOCAL_C_INCLUDES := \$(MY_PYTHON_SRC_ROOT)/Modules/expat'
echo 'LOCAL_SRC_FILES := \'
echo ' $(MY_PYTHON_SRC_ROOT)/Modules/expat/xmlparse.c \'
echo ' $(MY_PYTHON_SRC_ROOT)/Modules/expat/xmlrole.c \'
@ -951,6 +964,64 @@ build_python_for_abi ()
log "Install python$PYTHON_ABI-$ABI module 'unicodedata' in $PYBIN_INSTALLDIR_MODULES"
run cp -p -T $OBJDIR_UNICODEDATA/libunicodedata.so $PYBIN_INSTALLDIR_MODULES/unicodedata.so
fail_panic "Can't install python$PYTHON_ABI-$ABI module 'unicodedata' in $PYBIN_INSTALLDIR_MODULES"
# _json speedups
local BUILDDIR_JSON="$BUILDDIR/json"
local OBJDIR_JSON="$BUILDDIR_JSON/obj/local/$ABI"
run mkdir -p "$BUILDDIR_JSON/jni"
fail_panic "Can't create directory: $BUILDDIR_JSON/jni"
{
echo 'LOCAL_PATH := $(call my-dir)'
echo 'include $(CLEAR_VARS)'
echo 'LOCAL_MODULE := _json'
echo "MY_PYTHON_SRC_ROOT := $PYTHON_SRCDIR"
echo 'LOCAL_C_INCLUDES := $(MY_PYTHON_SRC_ROOT)/Include/internal'
echo 'LOCAL_SRC_FILES := \'
echo ' $(MY_PYTHON_SRC_ROOT)/Modules/_json.c'
echo 'LOCAL_STATIC_LIBRARIES := python_shared'
echo 'LOCAL_CFLAGS := -DPy_BUILD_CORE_MODULE'
echo 'include $(BUILD_SHARED_LIBRARY)'
echo "\$(call import-module,python/$PYTHON_ABI)"
} >$BUILDDIR_JSON/jni/Android.mk
fail_panic "Can't generate $BUILDDIR_JSON/jni/Android.mk"
run $NDK_DIR/ndk-build -C $BUILDDIR_JSON -j$NUM_JOBS APP_ABI=$ABI V=1
fail_panic "Can't build python$PYTHON_ABI-$ABI module '_json'"
log "Install python$PYTHON_ABI-$ABI module '_json' in $PYBIN_INSTALLDIR_MODULES"
run cp -p -T $OBJDIR_JSON/lib_json.so $PYBIN_INSTALLDIR_MODULES/_json.so
fail_panic "Can't install python$PYTHON_ABI-$ABI module '_json' in $PYBIN_INSTALLDIR_MODULES"
# _pickle accelerator
local BUILDDIR_PICKLE="$BUILDDIR/pickle"
local OBJDIR_PICKLE="$BUILDDIR_PICKLE/obj/local/$ABI"
run mkdir -p "$BUILDDIR_PICKLE/jni"
fail_panic "Can't create directory: $BUILDDIR_PICKLE/jni"
{
echo 'LOCAL_PATH := $(call my-dir)'
echo 'include $(CLEAR_VARS)'
echo 'LOCAL_MODULE := _pickle'
echo "MY_PYTHON_SRC_ROOT := $PYTHON_SRCDIR"
echo 'LOCAL_C_INCLUDES := $(MY_PYTHON_SRC_ROOT)/Include/internal'
echo 'LOCAL_SRC_FILES := \'
echo ' $(MY_PYTHON_SRC_ROOT)/Modules/_pickle.c'
echo 'LOCAL_STATIC_LIBRARIES := python_shared'
echo 'LOCAL_CFLAGS := -DPy_BUILD_CORE_MODULE'
echo 'include $(BUILD_SHARED_LIBRARY)'
echo "\$(call import-module,python/$PYTHON_ABI)"
} >$BUILDDIR_PICKLE/jni/Android.mk
fail_panic "Can't generate $BUILDDIR_PICKLE/jni/Android.mk"
run $NDK_DIR/ndk-build -C $BUILDDIR_PICKLE -j$NUM_JOBS APP_ABI=$ABI V=1
fail_panic "Can't build python$PYTHON_ABI-$ABI module '_pickle'"
log "Install python$PYTHON_ABI-$ABI module '_pickle' in $PYBIN_INSTALLDIR_MODULES"
run cp -p -T $OBJDIR_PICKLE/lib_pickle.so $PYBIN_INSTALLDIR_MODULES/_pickle.so
fail_panic "Can't install python$PYTHON_ABI-$ABI module '_pickle' in $PYBIN_INSTALLDIR_MODULES"
}
if [ -n "$PACKAGE_DIR" ]; then