From 6473cbe978ba601599e90b36ee0ad5b3f8de0f05 Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Thu, 19 Aug 2021 19:06:44 +0100 Subject: [PATCH 01/13] preliminary changes for Python 3.9.6 --- recipes/python3crystax/__init__.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/recipes/python3crystax/__init__.py b/recipes/python3crystax/__init__.py index 77b9369..b8d06c6 100644 --- a/recipes/python3crystax/__init__.py +++ b/recipes/python3crystax/__init__.py @@ -33,7 +33,8 @@ OPENSSLCONF = """#if defined(__ARM_ARCH_5TE__) LATEST_FULL_VERSION = { '3.5': '3.5.1', '3.6': '3.6.6', - '3.7': '3.7.1' + '3.7': '3.7.1', + '3.9': '3.9.6' } def realpath(fname): @@ -61,7 +62,7 @@ def realpath(fname): return os.sep.join(abs_path) class Python3Recipe(TargetPythonRecipe): - version = '3.7' + version = '3.9' url = '' name = 'python3crystax' @@ -71,7 +72,7 @@ class Python3Recipe(TargetPythonRecipe): from_crystax = True def download_if_necessary(self): - if 'openssl' in self.ctx.recipe_build_order or self.version == '3.6' or self.version == '3.7': + if 'openssl' in self.ctx.recipe_build_order or self.version == '3.6' or self.version == '3.7' or self.version == '3.9': full_version = LATEST_FULL_VERSION[self.version] Python3Recipe.url = 'https://www.python.org/ftp/python/{0}.{1}.{2}/Python-{0}.{1}.{2}.tgz'.format(*full_version.split('.')) super(Python3Recipe, self).download_if_necessary() @@ -168,7 +169,7 @@ class Python3Recipe(TargetPythonRecipe): def prebuild_arch(self, arch): super(Python3Recipe, self).prebuild_arch(arch) - if self.version == '3.6' or self.version == '3.7': + 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'] build_dir = self.get_build_dir(arch.arch) @@ -183,14 +184,14 @@ class Python3Recipe(TargetPythonRecipe): python_build_files = ['android.mk', 'config.c', 'interpreter.c'] ndk_build_tools_python_dir = join(self.ctx.ndk_dir, 'build', 'tools', 'build-target-python') for python_build_file in python_build_files: - shprint(sh.cp, join(self.get_recipe_dir(), python_build_file+'.3.7'), - join(ndk_build_tools_python_dir, python_build_file+'.3.7')) + shprint(sh.cp, join(self.get_recipe_dir(), python_build_file+'.3.9'), + join(ndk_build_tools_python_dir, python_build_file+'.3.9')) ndk_sources_python_dir = join(self.ctx.ndk_dir, 'sources', 'python') - if not os.path.exists(join(ndk_sources_python_dir, '3.7')): - os.mkdir(join(ndk_sources_python_dir, '3.7')) - sh.sed('s#3.5#3.7#', + if not os.path.exists(join(ndk_sources_python_dir, '3.9')): + os.mkdir(join(ndk_sources_python_dir, '3.9')) + sh.sed('s#3.5#3.9#', join(ndk_sources_python_dir, '3.5/Android.mk'), - _out=join(ndk_sources_python_dir, '3.7/Android.mk')) + _out=join(ndk_sources_python_dir, '3.9/Android.mk')) def build_arch(self, arch): # If openssl is needed we may have to recompile cPython to get the -- 2.45.2 From ea58057ee0aa7b62f70a9e6a0fbf7b3c21fb3bcf Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Fri, 20 Aug 2021 13:37:50 +0100 Subject: [PATCH 02/13] build Python 3.9.6 --- output.diff | 853 ++++++++++++++++++ recipes/pyjnius/__init__.py | 4 +- recipes/python3crystax/__init__.py | 23 +- .../{android.mk.3.7 => android.mk.3.9} | 19 +- .../{config.c.3.7 => config.c.3.9} | 6 - .../{interpreter.c.3.7 => interpreter.c.3.9} | 2 +- .../{ => patch}/patch_python3.6.patch | 0 .../patch/patch_python3.9.patch | 93 ++ recipes/python3crystax/patch/platlibdir.patch | 11 + recipes/python3crystax/patch/py3.8.1.patch | 42 + .../patch/py3.8.1_fix_cortex_a8.patch | 15 + .../patch/pyconfig_detection.patch | 13 + .../remove_android_api_check.patch | 0 .../patch/reproducible-buildinfo.diff | 13 + .../{ => patch}/selectors.patch | 0 recipes/python3crystax/patch/strdup.patch | 10 + recipes/setuptools/__init__.py | 2 +- scripts/build-target-python.sh | 79 +- 18 files changed, 1161 insertions(+), 24 deletions(-) create mode 100644 output.diff rename recipes/python3crystax/{android.mk.3.7 => android.mk.3.9} (94%) rename recipes/python3crystax/{config.c.3.7 => config.c.3.9} (95%) rename recipes/python3crystax/{interpreter.c.3.7 => interpreter.c.3.9} (99%) rename recipes/python3crystax/{ => patch}/patch_python3.6.patch (100%) create mode 100644 recipes/python3crystax/patch/patch_python3.9.patch create mode 100644 recipes/python3crystax/patch/platlibdir.patch create mode 100644 recipes/python3crystax/patch/py3.8.1.patch create mode 100644 recipes/python3crystax/patch/py3.8.1_fix_cortex_a8.patch create mode 100644 recipes/python3crystax/patch/pyconfig_detection.patch rename recipes/python3crystax/{ => patch}/remove_android_api_check.patch (100%) create mode 100644 recipes/python3crystax/patch/reproducible-buildinfo.diff rename recipes/python3crystax/{ => patch}/selectors.patch (100%) create mode 100644 recipes/python3crystax/patch/strdup.patch diff --git a/output.diff b/output.diff new file mode 100644 index 0000000..e86c42b --- /dev/null +++ b/output.diff @@ -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 +- +-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 +-#include +-#include +-#include +-#include +-#include +-#include +-#include +- +-#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 diff --git a/recipes/pyjnius/__init__.py b/recipes/pyjnius/__init__.py index f128b37..3100519 100644 --- a/recipes/pyjnius/__init__.py +++ b/recipes/pyjnius/__init__.py @@ -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'] 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.9 similarity index 94% rename from recipes/python3crystax/android.mk.3.7 rename to recipes/python3crystax/android.mk.3.9 index 47d7b6b..c915ae9 100644 --- a/recipes/python3crystax/android.mk.3.7 +++ b/recipes/python3crystax/android.mk.3.9 @@ -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 \ diff --git a/recipes/python3crystax/config.c.3.7 b/recipes/python3crystax/config.c.3.9 similarity index 95% rename from recipes/python3crystax/config.c.3.7 rename to recipes/python3crystax/config.c.3.9 index c7cbbc3..382b5b0 100644 --- a/recipes/python3crystax/config.c.3.7 +++ b/recipes/python3crystax/config.c.3.9 @@ -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}, diff --git a/recipes/python3crystax/interpreter.c.3.7 b/recipes/python3crystax/interpreter.c.3.9 similarity index 99% rename from recipes/python3crystax/interpreter.c.3.7 rename to recipes/python3crystax/interpreter.c.3.9 index daf2c52..c914e97 100644 --- a/recipes/python3crystax/interpreter.c.3.7 +++ b/recipes/python3crystax/interpreter.c.3.9 @@ -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)) diff --git a/recipes/python3crystax/patch_python3.6.patch b/recipes/python3crystax/patch/patch_python3.6.patch similarity index 100% rename from recipes/python3crystax/patch_python3.6.patch rename to recipes/python3crystax/patch/patch_python3.6.patch diff --git a/recipes/python3crystax/patch/patch_python3.9.patch b/recipes/python3crystax/patch/patch_python3.9.patch new file mode 100644 index 0000000..34c51f8 --- /dev/null +++ b/recipes/python3crystax/patch/patch_python3.9.patch @@ -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\ diff --git a/recipes/python3crystax/patch/platlibdir.patch b/recipes/python3crystax/patch/platlibdir.patch new file mode 100644 index 0000000..c685885 --- /dev/null +++ b/recipes/python3crystax/patch/platlibdir.patch @@ -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 + + diff --git a/recipes/python3crystax/patch/py3.8.1.patch b/recipes/python3crystax/patch/py3.8.1.patch new file mode 100644 index 0000000..6018805 --- /dev/null +++ b/recipes/python3crystax/patch/py3.8.1.patch @@ -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: diff --git a/recipes/python3crystax/patch/py3.8.1_fix_cortex_a8.patch b/recipes/python3crystax/patch/py3.8.1_fix_cortex_a8.patch new file mode 100644 index 0000000..92a41b5 --- /dev/null +++ b/recipes/python3crystax/patch/py3.8.1_fix_cortex_a8.patch @@ -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 diff --git a/recipes/python3crystax/patch/pyconfig_detection.patch b/recipes/python3crystax/patch/pyconfig_detection.patch new file mode 100644 index 0000000..087ab58 --- /dev/null +++ b/recipes/python3crystax/patch/pyconfig_detection.patch @@ -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 + diff --git a/recipes/python3crystax/remove_android_api_check.patch b/recipes/python3crystax/patch/remove_android_api_check.patch similarity index 100% rename from recipes/python3crystax/remove_android_api_check.patch rename to recipes/python3crystax/patch/remove_android_api_check.patch diff --git a/recipes/python3crystax/patch/reproducible-buildinfo.diff b/recipes/python3crystax/patch/reproducible-buildinfo.diff new file mode 100644 index 0000000..807d180 --- /dev/null +++ b/recipes/python3crystax/patch/reproducible-buildinfo.diff @@ -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 diff --git a/recipes/python3crystax/selectors.patch b/recipes/python3crystax/patch/selectors.patch similarity index 100% rename from recipes/python3crystax/selectors.patch rename to recipes/python3crystax/patch/selectors.patch diff --git a/recipes/python3crystax/patch/strdup.patch b/recipes/python3crystax/patch/strdup.patch new file mode 100644 index 0000000..4398ba5 --- /dev/null +++ b/recipes/python3crystax/patch/strdup.patch @@ -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) + { diff --git a/recipes/setuptools/__init__.py b/recipes/setuptools/__init__.py index 21e89b1..aa3b82b 100644 --- a/recipes/setuptools/__init__.py +++ b/recipes/setuptools/__init__.py @@ -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')] diff --git a/scripts/build-target-python.sh b/scripts/build-target-python.sh index 0656a98..3f1928a 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" @@ -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 -- 2.45.2 From 540675c988b790810648eb4a853e38b072ecf55c Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Fri, 20 Aug 2021 14:08:19 +0100 Subject: [PATCH 03/13] use Python 3.9 docker image --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e26a755..4f82258 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,7 +6,7 @@ stages: build arm64 aar: stage: build - image: lbry/android-base:latest + image: lbry/android-base:python39 before_script: - export BUILD_VERSION=$(cat $CI_PROJECT_DIR/src/main/python/main.py | grep --color=never -oP '([0-9]+\.?)+') artifacts: @@ -31,7 +31,7 @@ build arm64 aar: build arm aar: stage: build2 - image: lbry/android-base:latest + image: lbry/android-base:python39 before_script: - export BUILD_VERSION=$(cat $CI_PROJECT_DIR/src/main/python/main.py | grep --color=never -oP '([0-9]+\.?)+') artifacts: -- 2.45.2 From 3781a250fde4192eb8df2a53daf83af6cf904a2d Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Fri, 20 Aug 2021 14:17:48 +0100 Subject: [PATCH 04/13] fix pyjnius recipe --- .../genericndkbuild_jnienv_getter.patch | 24 +++++++++---------- recipes/pyjnius/sdl2_jnienv_getter.patch | 23 +++++++++--------- 2 files changed, 24 insertions(+), 23 deletions(-) diff --git a/recipes/pyjnius/genericndkbuild_jnienv_getter.patch b/recipes/pyjnius/genericndkbuild_jnienv_getter.patch index ff26994..8ea7ab2 100644 --- a/recipes/pyjnius/genericndkbuild_jnienv_getter.patch +++ b/recipes/pyjnius/genericndkbuild_jnienv_getter.patch @@ -10,16 +10,16 @@ index ac89fec..71daa43 100644 cdef JNIEnv *get_platform_jnienv(): - return SDL_ANDROID_GetJNIEnv() + return WebView_AndroidGetJNIEnv() -diff --git a/setup.py b/setup.py -index 740510f..0c8e55f 100644 ---- a/setup.py -+++ b/setup.py -@@ -53,7 +53,7 @@ except ImportError: +diff --git a/jnius/env.py b/jnius/env.py +--- a/jnius/env.py ++++ b/jnius/env.py +@@ -185,10 +185,10 @@ except ImportError: - if PLATFORM == 'android': - # for android, we use SDL... -- LIBRARIES = ['sdl', 'log'] -+ LIBRARIES = ['main', 'log'] - LIBRARY_DIRS = ['libs/' + getenv('ARCH')] - elif PLATFORM == 'darwin': - import subprocess + def get_libraries(platform): + if platform == 'android': + # for android, we use SDL... +- return ['sdl', 'log'] ++ return ['main', 'log'] + + elif platform == 'win32': + return ['jvm'] diff --git a/recipes/pyjnius/sdl2_jnienv_getter.patch b/recipes/pyjnius/sdl2_jnienv_getter.patch index d208e5f..7ed847e 100644 --- a/recipes/pyjnius/sdl2_jnienv_getter.patch +++ b/recipes/pyjnius/sdl2_jnienv_getter.patch @@ -10,16 +10,17 @@ index ac89fec..71daa43 100644 cdef JNIEnv *get_platform_jnienv(): - return SDL_ANDROID_GetJNIEnv() + return SDL_AndroidGetJNIEnv() -diff --git a/setup.py b/setup.py +diff --git a/env.py b/env.py index 740510f..0c8e55f 100644 ---- a/setup.py -+++ b/setup.py -@@ -53,7 +53,7 @@ except ImportError: +--- a/jnius/env.py ++++ b/jnius/env.py +@@ -185,10 +185,10 @@ except ImportError: - if PLATFORM == 'android': - # for android, we use SDL... -- LIBRARIES = ['sdl', 'log'] -+ LIBRARIES = ['SDL2', 'log'] - LIBRARY_DIRS = ['libs/' + getenv('ARCH')] - elif PLATFORM == 'darwin': - import subprocess + def get_libraries(platform): + if platform == 'android': + # for android, we use SDL... +- return ['sdl', 'log'] ++ return ['SDL2', 'log'] + + elif platform == 'win32': + return ['jvm'] -- 2.45.2 From 92de9d11c349da205b265132882d8b84f54c63ad Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Fri, 20 Aug 2021 15:40:17 +0100 Subject: [PATCH 05/13] remove unused dependencies from cryptography recipe --- recipes/cryptography/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/cryptography/__init__.py b/recipes/cryptography/__init__.py index fd38799..1aa84f6 100644 --- a/recipes/cryptography/__init__.py +++ b/recipes/cryptography/__init__.py @@ -6,7 +6,7 @@ class CryptographyRecipe(CompiledComponentsPythonRecipe): name = 'cryptography' version = '3.1.1' url = 'https://github.com/pyca/cryptography/archive/{version}.tar.gz' - depends = [('python2', 'python3crystax'), 'openssl', 'idna', 'pyasn1', 'six', 'setuptools', 'ipaddress', 'cffi'] + depends = [('python2', 'python3crystax'), 'openssl', 'six', 'setuptools', 'cffi'] call_hostpython_via_targetpython = False patches = ['libpthread.patch'] -- 2.45.2 From 63e746dffc5c4c58e9133c63af652b5f05633d3b Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Fri, 20 Aug 2021 17:29:38 +0100 Subject: [PATCH 06/13] fix PYTHON3_DLL_REL_PATH value --- output.diff | 853 ----------------------- recipes/python3crystax/interpreter.c.3.9 | 2 +- 2 files changed, 1 insertion(+), 854 deletions(-) delete mode 100644 output.diff diff --git a/output.diff b/output.diff deleted file mode 100644 index e86c42b..0000000 --- a/output.diff +++ /dev/null @@ -1,853 +0,0 @@ -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 -- --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 --#include --#include --#include --#include --#include --#include --#include -- --#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 diff --git a/recipes/python3crystax/interpreter.c.3.9 b/recipes/python3crystax/interpreter.c.3.9 index c914e97..7b93557 100644 --- a/recipes/python3crystax/interpreter.c.3.9 +++ b/recipes/python3crystax/interpreter.c.3.9 @@ -9,7 +9,7 @@ #define PYTHON3_STDLIB_REL_PATH "stdlib.zip" #define PYTHON3_MODULES_REL_PATH "modules" -#define PYTHON3_DLL_REL_PATH "libpython3.9.so" +#define PYTHON3_DLL_REL_PATH "libpython3.9m.so" #define SYS_PATH_BUFFER_SIZE (2*(PATH_MAX + 1)) -- 2.45.2 From 739437e7c1986852703db10bcabbc4797065b7c8 Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Fri, 20 Aug 2021 17:51:42 +0100 Subject: [PATCH 07/13] check for python3.9m in loadLibraries --- .../build/src/main/java/org/kivy/android/PythonUtil.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/p4a/pythonforandroid/bootstraps/lbry/build/src/main/java/org/kivy/android/PythonUtil.java b/p4a/pythonforandroid/bootstraps/lbry/build/src/main/java/org/kivy/android/PythonUtil.java index 5ea3d63..18deb07 100644 --- a/p4a/pythonforandroid/bootstraps/lbry/build/src/main/java/org/kivy/android/PythonUtil.java +++ b/p4a/pythonforandroid/bootstraps/lbry/build/src/main/java/org/kivy/android/PythonUtil.java @@ -17,7 +17,8 @@ public class PythonUtil { "python2.7", "python3.5m", "python3.6m", - "python3.7m", + "python3.7m", + "python3.9m", "main" }; } @@ -37,7 +38,7 @@ public class PythonUtil { // If this is the last possible libpython // load, and it has failed, give a more // general error - if (lib.startsWith("python3.7") && !foundPython) { + if (lib.startsWith("python3.9") && !foundPython) { throw new java.lang.RuntimeException("Could not load any libpythonXXX.so"); } continue; -- 2.45.2 From bb9b96350cb686e6cbcf8bac69ea4f19b2fa546a Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Fri, 20 Aug 2021 18:11:52 +0100 Subject: [PATCH 08/13] add idna requirement --- buildozer.spec.arm.ci | 2 +- buildozer.spec.arm64.ci | 2 +- buildozer.spec.sample | 2 +- buildozer.spec.vagrant | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/buildozer.spec.arm.ci b/buildozer.spec.arm.ci index 63483e2..1d5852e 100644 --- a/buildozer.spec.arm.ci +++ b/buildozer.spec.arm.ci @@ -39,7 +39,7 @@ version.filename = %(source.dir)s/main.py # (list) Application requirements # comma seperated e.g. requirements = sqlite3,kivy -requirements = python3crystax, openssl, sqlite3, hostpython3crystax, android, distro==1.4.0, pyjnius, certifi==2021.5.30, appdirs==1.4.3, docopt==0.6.2, base58==1.0.0, colorama==0.3.7, ecdsa==0.13.3, jsonschema==2.6.0, pbkdf2==1.3, pyyaml, protobuf==3.6.1, keyring==10.4.0, defusedxml, aioupnp==0.0.17, asn1crypto, mock, netifaces, cryptography, aiohttp==3.5.4, multidict==4.5.2, yarl==1.3.0, chardet==3.0.4, async_timeout==3.0.1, coincurve, msgpack==0.6.1, six, attrs==18.2.0, pylru, hachoir, prometheus_client==0.8.0, "git+https://github.com/lbryio/lbry-sdk@v0.102.0#egg=lbry" +requirements = python3crystax, openssl, sqlite3, hostpython3crystax, android, distro==1.4.0, pyjnius, certifi==2021.5.30, appdirs==1.4.3, docopt==0.6.2, base58==1.0.0, colorama==0.3.7, ecdsa==0.13.3, jsonschema==2.6.0, pbkdf2==1.3, pyyaml, protobuf==3.6.1, keyring==10.4.0, defusedxml, aioupnp==0.0.17, asn1crypto, mock, netifaces, cryptography, aiohttp==3.5.4, multidict==4.5.2, idna, yarl==1.3.0, chardet==3.0.4, async_timeout==3.0.1, coincurve, msgpack==0.6.1, six, attrs==18.2.0, pylru, hachoir, prometheus_client==0.8.0, "git+https://github.com/lbryio/lbry-sdk@v0.102.0#egg=lbry" # (str) Custom source folders for requirements # Sets custom source for any requirements with recipes diff --git a/buildozer.spec.arm64.ci b/buildozer.spec.arm64.ci index e4f9754..8767cbc 100644 --- a/buildozer.spec.arm64.ci +++ b/buildozer.spec.arm64.ci @@ -39,7 +39,7 @@ version.filename = %(source.dir)s/main.py # (list) Application requirements # comma seperated e.g. requirements = sqlite3,kivy -requirements = python3crystax, openssl, sqlite3, hostpython3crystax, android, distro==1.4.0, pyjnius, certifi==2021.5.30, appdirs==1.4.3, docopt==0.6.2, base58==1.0.0, colorama==0.3.7, ecdsa==0.13.3, jsonschema==2.6.0, pbkdf2==1.3, pyyaml, protobuf==3.6.1, keyring==10.4.0, defusedxml, aioupnp==0.0.17, asn1crypto, mock, netifaces, cryptography, aiohttp==3.5.4, multidict==4.5.2, yarl==1.3.0, chardet==3.0.4, async_timeout==3.0.1, coincurve, msgpack==0.6.1, six, attrs==18.2.0, pylru, hachoir, prometheus_client==0.8.0, "git+https://github.com/lbryio/lbry-sdk@v0.102.0#egg=lbry" +requirements = python3crystax, openssl, sqlite3, hostpython3crystax, android, distro==1.4.0, pyjnius, certifi==2021.5.30, appdirs==1.4.3, docopt==0.6.2, base58==1.0.0, colorama==0.3.7, ecdsa==0.13.3, jsonschema==2.6.0, pbkdf2==1.3, pyyaml, protobuf==3.6.1, keyring==10.4.0, defusedxml, aioupnp==0.0.17, asn1crypto, mock, netifaces, cryptography, aiohttp==3.5.4, multidict==4.5.2, idna, yarl==1.3.0, chardet==3.0.4, async_timeout==3.0.1, coincurve, msgpack==0.6.1, six, attrs==18.2.0, pylru, hachoir, prometheus_client==0.8.0, "git+https://github.com/lbryio/lbry-sdk@v0.102.0#egg=lbry" # (str) Custom source folders for requirements # Sets custom source for any requirements with recipes diff --git a/buildozer.spec.sample b/buildozer.spec.sample index 75b7bb8..2c6fe69 100644 --- a/buildozer.spec.sample +++ b/buildozer.spec.sample @@ -39,7 +39,7 @@ version.filename = %(source.dir)s/main.py # (list) Application requirements # comma seperated e.g. requirements = sqlite3,kivy -requirements = python3crystax, openssl, sqlite3, hostpython3crystax, android, distro==1.4.0, pyjnius, certifi==2021.5.30, appdirs==1.4.3, docopt==0.6.2, base58==1.0.0, colorama==0.3.7, ecdsa==0.13.3, jsonschema==2.6.0, pbkdf2==1.3, pyyaml, protobuf==3.6.1, keyring==10.4.0, defusedxml, aioupnp==0.0.17, asn1crypto, mock, netifaces, cryptography, aiohttp==3.5.4, multidict==4.5.2, yarl==1.3.0, chardet==3.0.4, async_timeout==3.0.1, coincurve, msgpack==0.6.1, six, attrs==18.2.0, pylru, hachoir, prometheus_client==0.8.0, "git+https://github.com/lbryio/lbry-sdk@v0.102.0#egg=lbry" +requirements = python3crystax, openssl, sqlite3, hostpython3crystax, android, distro==1.4.0, pyjnius, certifi==2021.5.30, appdirs==1.4.3, docopt==0.6.2, base58==1.0.0, colorama==0.3.7, ecdsa==0.13.3, jsonschema==2.6.0, pbkdf2==1.3, pyyaml, protobuf==3.6.1, keyring==10.4.0, defusedxml, aioupnp==0.0.17, asn1crypto, mock, netifaces, cryptography, aiohttp==3.5.4, multidict==4.5.2, idna, yarl==1.3.0, chardet==3.0.4, async_timeout==3.0.1, coincurve, msgpack==0.6.1, six, attrs==18.2.0, pylru, hachoir, prometheus_client==0.8.0, "git+https://github.com/lbryio/lbry-sdk@v0.102.0#egg=lbry" # (str) Custom source folders for requirements # Sets custom source for any requirements with recipes diff --git a/buildozer.spec.vagrant b/buildozer.spec.vagrant index ab98485..6e5349c 100644 --- a/buildozer.spec.vagrant +++ b/buildozer.spec.vagrant @@ -39,7 +39,7 @@ version.filename = %(source.dir)s/main.py # (list) Application requirements # comma seperated e.g. requirements = sqlite3,kivy -requirements = python3crystax, openssl, sqlite3, hostpython3crystax, android, distro==1.4.0, pyjnius, certifi==2021.5.30, appdirs==1.4.3, docopt==0.6.2, base58==1.0.0, colorama==0.3.7, ecdsa==0.13.3, jsonschema==2.6.0, pbkdf2==1.3, pyyaml, protobuf==3.6.1, keyring==10.4.0, defusedxml, git+https://github.com/lbryio/aioupnp.git@ab7ef0048bbce6404e463d20e8a15046ea6941f0#egg=aioupnp, asn1crypto, mock, netifaces, cryptography, aiohttp==3.5.4, multidict==4.5.2, yarl==1.3.0, chardet==3.0.4, async_timeout==3.0.1, coincurve, msgpack==0.6.1, six, attrs==18.2.0, pylru, hachoir, prometheus_client==0.7.1, "git+https://github.com/lbryio/lbry-sdk@v0.102.0#egg=lbry" +requirements = python3crystax, openssl, sqlite3, hostpython3crystax, android, distro==1.4.0, pyjnius, certifi==2021.5.30, appdirs==1.4.3, docopt==0.6.2, base58==1.0.0, colorama==0.3.7, ecdsa==0.13.3, jsonschema==2.6.0, pbkdf2==1.3, pyyaml, protobuf==3.6.1, keyring==10.4.0, defusedxml, git+https://github.com/lbryio/aioupnp.git@ab7ef0048bbce6404e463d20e8a15046ea6941f0#egg=aioupnp, asn1crypto, mock, netifaces, cryptography, aiohttp==3.5.4, multidict==4.5.2, idna, yarl==1.3.0, chardet==3.0.4, async_timeout==3.0.1, coincurve, msgpack==0.6.1, six, attrs==18.2.0, pylru, hachoir, prometheus_client==0.7.1, "git+https://github.com/lbryio/lbry-sdk@v0.102.0#egg=lbry" # (str) Custom source folders for requirements # Sets custom source for any requirements with recipes -- 2.45.2 From 60d9bf07bdd28a2892eac0563fcf7ffb9a65a893 Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Fri, 20 Aug 2021 21:31:14 +0100 Subject: [PATCH 09/13] Update PythonUtil loadLibraries. Remove m abi flag from python3.9 lib. --- .../java/org/kivy/android/PythonActivity.java | 2 +- .../java/org/kivy/android/PythonService.java | 2 +- .../java/org/kivy/android/PythonUtil.java | 76 ++++++++++--------- 3 files changed, 42 insertions(+), 38 deletions(-) diff --git a/p4a/pythonforandroid/bootstraps/lbry/build/src/main/java/org/kivy/android/PythonActivity.java b/p4a/pythonforandroid/bootstraps/lbry/build/src/main/java/org/kivy/android/PythonActivity.java index 7fcae69..b2f4a45 100644 --- a/p4a/pythonforandroid/bootstraps/lbry/build/src/main/java/org/kivy/android/PythonActivity.java +++ b/p4a/pythonforandroid/bootstraps/lbry/build/src/main/java/org/kivy/android/PythonActivity.java @@ -76,7 +76,7 @@ public class PythonActivity extends SDLActivity { public void loadLibraries() { String app_root = new String(getAppRoot()); File app_root_file = new File(app_root); - PythonUtil.loadLibraries(app_root_file); + PythonUtil.loadLibraries(app_root_file, new File(getApplicationInfo().nativeLibraryDir)); } public void recursiveDelete(File f) { diff --git a/p4a/pythonforandroid/bootstraps/lbry/build/src/main/java/org/kivy/android/PythonService.java b/p4a/pythonforandroid/bootstraps/lbry/build/src/main/java/org/kivy/android/PythonService.java index 9f9a8fe..db4884c 100644 --- a/p4a/pythonforandroid/bootstraps/lbry/build/src/main/java/org/kivy/android/PythonService.java +++ b/p4a/pythonforandroid/bootstraps/lbry/build/src/main/java/org/kivy/android/PythonService.java @@ -119,7 +119,7 @@ public class PythonService extends Service implements Runnable { public void run(){ String app_root = getFilesDir().getAbsolutePath() + "/app"; File app_root_file = new File(app_root); - PythonUtil.loadLibraries(app_root_file); + PythonUtil.loadLibraries(app_root_file, new File(getApplicationInfo().nativeLibraryDir)); this.mService = this; nativeStart( androidPrivate, androidArgument, diff --git a/p4a/pythonforandroid/bootstraps/lbry/build/src/main/java/org/kivy/android/PythonUtil.java b/p4a/pythonforandroid/bootstraps/lbry/build/src/main/java/org/kivy/android/PythonUtil.java index 18deb07..2dc888d 100644 --- a/p4a/pythonforandroid/bootstraps/lbry/build/src/main/java/org/kivy/android/PythonUtil.java +++ b/p4a/pythonforandroid/bootstraps/lbry/build/src/main/java/org/kivy/android/PythonUtil.java @@ -1,35 +1,48 @@ package org.kivy.android; import java.io.File; +import java.util.ArrayList; +import java.util.regex.Pattern; import android.util.Log; - public class PythonUtil { - private static final String TAG = "PythonUtil"; + private static final String TAG = "pythonutil"; - protected static String[] getLibraries() { - return new String[] { - "SDL2", - "SDL2_image", - "SDL2_mixer", - "SDL2_ttf", - "python2.7", - "python3.5m", - "python3.6m", - "python3.7m", - "python3.9m", - "main" - }; + protected static void addLibraryIfExists(ArrayList libsList, String pattern, File libsDir) { + // pattern should be the name of the lib file, without the + // preceding "lib" or suffix ".so", for instance "ssl.*" will + // match files of the form "libssl.*.so". + File [] files = libsDir.listFiles(); + + pattern = "lib" + pattern + "\\.so"; + Pattern p = Pattern.compile(pattern); + for (int i = 0; i < files.length; ++i) { + File file = files[i]; + String name = file.getName(); + Log.v(TAG, "Checking pattern " + pattern + " against " + name); + if (p.matcher(name).matches()) { + Log.v(TAG, "Pattern " + pattern + " matched file " + name); + libsList.add(name.substring(3, name.length() - 3)); + } + } + } + + protected static ArrayList getLibraries(File libsDir) { + ArrayList libsList = new ArrayList(); + libsList.add("python3.7m"); + libsList.add("python3.8"); + libsList.add("python3.9"); + libsList.add("main"); + return libsList; } - public static void loadLibraries(File filesDir) { - - String filesDirPath = filesDir.getAbsolutePath(); + public static void loadLibraries(File filesDir, File libsDir) { boolean foundPython = false; - for (String lib : getLibraries()) { - try { + for (String lib : getLibraries(libsDir)) { + Log.v(TAG, "Loading library: " + lib); + try { System.loadLibrary(lib); if (lib.startsWith("python")) { foundPython = true; @@ -38,27 +51,18 @@ public class PythonUtil { // If this is the last possible libpython // load, and it has failed, give a more // general error + Log.v(TAG, "Library loading error: " + e.getMessage()); if (lib.startsWith("python3.9") && !foundPython) { - throw new java.lang.RuntimeException("Could not load any libpythonXXX.so"); + throw new RuntimeException("Could not load any libpythonXXX.so"); + } else if (lib.startsWith("python")) { + continue; + } else { + Log.v(TAG, "An UnsatisfiedLinkError occurred loading " + lib); + throw e; } - continue; } } - try { - System.load(filesDirPath + "/lib/python2.7/lib-dynload/_io.so"); - System.load(filesDirPath + "/lib/python2.7/lib-dynload/unicodedata.so"); - } catch(UnsatisfiedLinkError e) { - Log.v(TAG, "Failed to load _io.so or unicodedata.so...but that's okay."); - } - - try { - // System.loadLibrary("ctypes"); - System.load(filesDirPath + "/lib/python2.7/lib-dynload/_ctypes.so"); - } catch(UnsatisfiedLinkError e) { - Log.v(TAG, "Unsatisfied linker when loading ctypes"); - } - Log.v(TAG, "Loaded everything!"); } } -- 2.45.2 From 7759209dd01581a687ac430e6ae667db9e6345ee Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Fri, 20 Aug 2021 21:34:03 +0100 Subject: [PATCH 10/13] Remove m abi flag from python lib (https://docs.python.org/3/whatsnew/3.8.html#build-and-c-api-changes) --- p4a/pythonforandroid/recipe.py | 6 +++--- recipes/cffi/__init__.py | 2 +- recipes/coincurve/__init__.py | 2 +- recipes/cryptography/__init__.py | 2 +- recipes/netifaces/__init__.py | 2 +- recipes/python3crystax/__init__.py | 4 ++++ recipes/python3crystax/interpreter.c.3.9 | 2 +- scripts/build-target-python.sh | 4 ++-- 8 files changed, 14 insertions(+), 10 deletions(-) diff --git a/p4a/pythonforandroid/recipe.py b/p4a/pythonforandroid/recipe.py index b7556db..071aa22 100644 --- a/p4a/pythonforandroid/recipe.py +++ b/p4a/pythonforandroid/recipe.py @@ -658,8 +658,8 @@ class BootstrapNDKRecipe(Recipe): env['PYTHON_LINK_ROOT'] = self.ctx.python_recipe.link_root(arch.arch) env['EXTRA_LDLIBS'] = ' -lpython{}'.format( self.ctx.python_recipe.major_minor_version_string) - if 'python3' in self.ctx.python_recipe.name: - env['EXTRA_LDLIBS'] += 'm' + #if 'python3' in self.ctx.python_recipe.name: + # env['EXTRA_LDLIBS'] += 'm' return env @@ -803,7 +803,7 @@ class PythonRecipe(Recipe): 'python')) env['LDFLAGS'] += ' -L{}'.format( join(ndk_dir_python, 'libs', arch.arch)) - env['LDFLAGS'] += ' -lpython{}m'.format(python_short_version) + env['LDFLAGS'] += ' -lpython{}'.format(python_short_version) hppath = [] hppath.append(join(dirname(self.hostpython_location), 'Lib')) diff --git a/recipes/cffi/__init__.py b/recipes/cffi/__init__.py index 861a365..cc4dc05 100644 --- a/recipes/cffi/__init__.py +++ b/recipes/cffi/__init__.py @@ -48,7 +48,7 @@ class CffiRecipe(CompiledComponentsPythonRecipe): python_version = self.ctx.python_recipe.version[0:3] ndk_dir_python = os.path.join(self.ctx.ndk_dir, 'sources/python/', python_version) env['LDFLAGS'] += ' -L{}'.format(os.path.join(ndk_dir_python, 'libs', arch.arch)) - env['LDFLAGS'] += ' -lpython{}m'.format(python_version) + env['LDFLAGS'] += ' -lpython{}'.format(python_version) # until `pythonforandroid/archs.py` gets merged upstream: # https://github.com/kivy/python-for-android/pull/1250/files#diff-569e13021e33ced8b54385f55b49cbe6 env['CFLAGS'] += ' -I{}/include/python/'.format(ndk_dir_python) diff --git a/recipes/coincurve/__init__.py b/recipes/coincurve/__init__.py index 4d3f58f..5be9557 100644 --- a/recipes/coincurve/__init__.py +++ b/recipes/coincurve/__init__.py @@ -26,7 +26,7 @@ class CoincurveRecipe(CompiledComponentsPythonRecipe): if self.ctx.ndk == 'crystax': ndk_dir_python = os.path.join(self.ctx.ndk_dir, 'sources/python/', python_version) env['LDFLAGS'] += ' -L{}'.format(os.path.join(ndk_dir_python, 'libs', arch.arch)) - env['LDFLAGS'] += ' -lpython{}m'.format(python_version) + env['LDFLAGS'] += ' -lpython{}'.format(python_version) # until `pythonforandroid/archs.py` gets merged upstream: # https://github.com/kivy/python-for-android/pull/1250/files#diff-569e13021e33ced8b54385f55b49cbe6 env['CFLAGS'] += ' -I{}/include/python/'.format(ndk_dir_python) diff --git a/recipes/cryptography/__init__.py b/recipes/cryptography/__init__.py index 1aa84f6..148a121 100644 --- a/recipes/cryptography/__init__.py +++ b/recipes/cryptography/__init__.py @@ -26,7 +26,7 @@ class CryptographyRecipe(CompiledComponentsPythonRecipe): python_version = self.ctx.python_recipe.version[0:3] ndk_dir_python = os.path.join(self.ctx.ndk_dir, 'sources/python/', python_version) env['LDFLAGS'] += ' -L{}'.format(os.path.join(ndk_dir_python, 'libs', arch.arch)) - env['LDFLAGS'] += ' -lpython{}m'.format(python_version) + env['LDFLAGS'] += ' -lpython{}'.format(python_version) # until `pythonforandroid/archs.py` gets merged upstream: # https://github.com/kivy/python-for-android/pull/1250/files#diff-569e13021e33ced8b54385f55b49cbe6 env['CFLAGS'] += ' -I{}/include/python/'.format(ndk_dir_python) + ' -L{}'.format(os.path.join(ndk_dir_python, 'libs', arch.arch)) diff --git a/recipes/netifaces/__init__.py b/recipes/netifaces/__init__.py index 252499c..50634d8 100644 --- a/recipes/netifaces/__init__.py +++ b/recipes/netifaces/__init__.py @@ -23,7 +23,7 @@ class NetifacesRecipe(CompiledComponentsPythonRecipe): python_version = self.ctx.python_recipe.version[0:3] ndk_dir_python = os.path.join(self.ctx.ndk_dir, 'sources/python/', python_version) env['LDFLAGS'] += ' -L{}'.format(os.path.join(ndk_dir_python, 'libs', arch.arch)) - env['LDFLAGS'] += ' -lpython{}m'.format(python_version) + env['LDFLAGS'] += ' -lpython{}'.format(python_version) # until `pythonforandroid/archs.py` gets merged upstream: # https://github.com/kivy/python-for-android/pull/1250/files#diff-569e13021e33ced8b54385f55b49cbe6 env['CFLAGS'] += ' -I{}/include/python/'.format(ndk_dir_python) diff --git a/recipes/python3crystax/__init__.py b/recipes/python3crystax/__init__.py index 71e20aa..0844792 100644 --- a/recipes/python3crystax/__init__.py +++ b/recipes/python3crystax/__init__.py @@ -212,7 +212,11 @@ class Python3Recipe(TargetPythonRecipe): os.mkdir(join(ndk_sources_python_dir, '3.9')) sh.sed('s#3.5#3.9#', join(ndk_sources_python_dir, '3.5/Android.mk'), + _out=join(ndk_sources_python_dir, '3.9/Android.mk.tmp')) + sh.sed('s#3.9m#3.9#', + join(ndk_sources_python_dir, '3.9/Android.mk.tmp'), _out=join(ndk_sources_python_dir, '3.9/Android.mk')) + shprint(sh.rm, '-f', join(ndk_sources_python_dir, '3.9/Android.mk.tmp')) def build_arch(self, arch): # If openssl is needed we may have to recompile cPython to get the diff --git a/recipes/python3crystax/interpreter.c.3.9 b/recipes/python3crystax/interpreter.c.3.9 index 7b93557..c914e97 100644 --- a/recipes/python3crystax/interpreter.c.3.9 +++ b/recipes/python3crystax/interpreter.c.3.9 @@ -9,7 +9,7 @@ #define PYTHON3_STDLIB_REL_PATH "stdlib.zip" #define PYTHON3_MODULES_REL_PATH "modules" -#define PYTHON3_DLL_REL_PATH "libpython3.9m.so" +#define PYTHON3_DLL_REL_PATH "libpython3.9.so" #define SYS_PATH_BUFFER_SIZE (2*(PATH_MAX + 1)) diff --git a/scripts/build-target-python.sh b/scripts/build-target-python.sh index 3f1928a..409d34c 100755 --- a/scripts/build-target-python.sh +++ b/scripts/build-target-python.sh @@ -386,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)' -- 2.45.2 From 74dd3021961aed3aa6e20289b89dc625a59c7733 Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Fri, 20 Aug 2021 21:40:39 +0100 Subject: [PATCH 11/13] aiohttp==3.6.0 --- buildozer.spec.arm.ci | 2 +- buildozer.spec.arm64.ci | 2 +- buildozer.spec.sample | 2 +- buildozer.spec.vagrant | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/buildozer.spec.arm.ci b/buildozer.spec.arm.ci index 1d5852e..e349beb 100644 --- a/buildozer.spec.arm.ci +++ b/buildozer.spec.arm.ci @@ -39,7 +39,7 @@ version.filename = %(source.dir)s/main.py # (list) Application requirements # comma seperated e.g. requirements = sqlite3,kivy -requirements = python3crystax, openssl, sqlite3, hostpython3crystax, android, distro==1.4.0, pyjnius, certifi==2021.5.30, appdirs==1.4.3, docopt==0.6.2, base58==1.0.0, colorama==0.3.7, ecdsa==0.13.3, jsonschema==2.6.0, pbkdf2==1.3, pyyaml, protobuf==3.6.1, keyring==10.4.0, defusedxml, aioupnp==0.0.17, asn1crypto, mock, netifaces, cryptography, aiohttp==3.5.4, multidict==4.5.2, idna, yarl==1.3.0, chardet==3.0.4, async_timeout==3.0.1, coincurve, msgpack==0.6.1, six, attrs==18.2.0, pylru, hachoir, prometheus_client==0.8.0, "git+https://github.com/lbryio/lbry-sdk@v0.102.0#egg=lbry" +requirements = python3crystax, openssl, sqlite3, hostpython3crystax, android, distro==1.4.0, pyjnius, certifi==2021.5.30, appdirs==1.4.3, docopt==0.6.2, base58==1.0.0, colorama==0.3.7, ecdsa==0.13.3, jsonschema==2.6.0, pbkdf2==1.3, pyyaml, protobuf==3.6.1, keyring==10.4.0, defusedxml, aioupnp==0.0.17, asn1crypto, mock, netifaces, cryptography, aiohttp==3.6.0, multidict==4.5.2, idna, yarl==1.3.0, chardet==3.0.4, async_timeout==3.0.1, coincurve, msgpack==0.6.1, six, attrs==18.2.0, pylru, hachoir, prometheus_client==0.8.0, "git+https://github.com/lbryio/lbry-sdk@v0.102.0#egg=lbry" # (str) Custom source folders for requirements # Sets custom source for any requirements with recipes diff --git a/buildozer.spec.arm64.ci b/buildozer.spec.arm64.ci index 8767cbc..1d201fc 100644 --- a/buildozer.spec.arm64.ci +++ b/buildozer.spec.arm64.ci @@ -39,7 +39,7 @@ version.filename = %(source.dir)s/main.py # (list) Application requirements # comma seperated e.g. requirements = sqlite3,kivy -requirements = python3crystax, openssl, sqlite3, hostpython3crystax, android, distro==1.4.0, pyjnius, certifi==2021.5.30, appdirs==1.4.3, docopt==0.6.2, base58==1.0.0, colorama==0.3.7, ecdsa==0.13.3, jsonschema==2.6.0, pbkdf2==1.3, pyyaml, protobuf==3.6.1, keyring==10.4.0, defusedxml, aioupnp==0.0.17, asn1crypto, mock, netifaces, cryptography, aiohttp==3.5.4, multidict==4.5.2, idna, yarl==1.3.0, chardet==3.0.4, async_timeout==3.0.1, coincurve, msgpack==0.6.1, six, attrs==18.2.0, pylru, hachoir, prometheus_client==0.8.0, "git+https://github.com/lbryio/lbry-sdk@v0.102.0#egg=lbry" +requirements = python3crystax, openssl, sqlite3, hostpython3crystax, android, distro==1.4.0, pyjnius, certifi==2021.5.30, appdirs==1.4.3, docopt==0.6.2, base58==1.0.0, colorama==0.3.7, ecdsa==0.13.3, jsonschema==2.6.0, pbkdf2==1.3, pyyaml, protobuf==3.6.1, keyring==10.4.0, defusedxml, aioupnp==0.0.17, asn1crypto, mock, netifaces, cryptography, aiohttp==3.6.0, multidict==4.5.2, idna, yarl==1.3.0, chardet==3.0.4, async_timeout==3.0.1, coincurve, msgpack==0.6.1, six, attrs==18.2.0, pylru, hachoir, prometheus_client==0.8.0, "git+https://github.com/lbryio/lbry-sdk@v0.102.0#egg=lbry" # (str) Custom source folders for requirements # Sets custom source for any requirements with recipes diff --git a/buildozer.spec.sample b/buildozer.spec.sample index 2c6fe69..190abca 100644 --- a/buildozer.spec.sample +++ b/buildozer.spec.sample @@ -39,7 +39,7 @@ version.filename = %(source.dir)s/main.py # (list) Application requirements # comma seperated e.g. requirements = sqlite3,kivy -requirements = python3crystax, openssl, sqlite3, hostpython3crystax, android, distro==1.4.0, pyjnius, certifi==2021.5.30, appdirs==1.4.3, docopt==0.6.2, base58==1.0.0, colorama==0.3.7, ecdsa==0.13.3, jsonschema==2.6.0, pbkdf2==1.3, pyyaml, protobuf==3.6.1, keyring==10.4.0, defusedxml, aioupnp==0.0.17, asn1crypto, mock, netifaces, cryptography, aiohttp==3.5.4, multidict==4.5.2, idna, yarl==1.3.0, chardet==3.0.4, async_timeout==3.0.1, coincurve, msgpack==0.6.1, six, attrs==18.2.0, pylru, hachoir, prometheus_client==0.8.0, "git+https://github.com/lbryio/lbry-sdk@v0.102.0#egg=lbry" +requirements = python3crystax, openssl, sqlite3, hostpython3crystax, android, distro==1.4.0, pyjnius, certifi==2021.5.30, appdirs==1.4.3, docopt==0.6.2, base58==1.0.0, colorama==0.3.7, ecdsa==0.13.3, jsonschema==2.6.0, pbkdf2==1.3, pyyaml, protobuf==3.6.1, keyring==10.4.0, defusedxml, aioupnp==0.0.17, asn1crypto, mock, netifaces, cryptography, aiohttp==3.6.0, multidict==4.5.2, idna, yarl==1.3.0, chardet==3.0.4, async_timeout==3.0.1, coincurve, msgpack==0.6.1, six, attrs==18.2.0, pylru, hachoir, prometheus_client==0.8.0, "git+https://github.com/lbryio/lbry-sdk@v0.102.0#egg=lbry" # (str) Custom source folders for requirements # Sets custom source for any requirements with recipes diff --git a/buildozer.spec.vagrant b/buildozer.spec.vagrant index 6e5349c..b46a123 100644 --- a/buildozer.spec.vagrant +++ b/buildozer.spec.vagrant @@ -39,7 +39,7 @@ version.filename = %(source.dir)s/main.py # (list) Application requirements # comma seperated e.g. requirements = sqlite3,kivy -requirements = python3crystax, openssl, sqlite3, hostpython3crystax, android, distro==1.4.0, pyjnius, certifi==2021.5.30, appdirs==1.4.3, docopt==0.6.2, base58==1.0.0, colorama==0.3.7, ecdsa==0.13.3, jsonschema==2.6.0, pbkdf2==1.3, pyyaml, protobuf==3.6.1, keyring==10.4.0, defusedxml, git+https://github.com/lbryio/aioupnp.git@ab7ef0048bbce6404e463d20e8a15046ea6941f0#egg=aioupnp, asn1crypto, mock, netifaces, cryptography, aiohttp==3.5.4, multidict==4.5.2, idna, yarl==1.3.0, chardet==3.0.4, async_timeout==3.0.1, coincurve, msgpack==0.6.1, six, attrs==18.2.0, pylru, hachoir, prometheus_client==0.7.1, "git+https://github.com/lbryio/lbry-sdk@v0.102.0#egg=lbry" +requirements = python3crystax, openssl, sqlite3, hostpython3crystax, android, distro==1.4.0, pyjnius, certifi==2021.5.30, appdirs==1.4.3, docopt==0.6.2, base58==1.0.0, colorama==0.3.7, ecdsa==0.13.3, jsonschema==2.6.0, pbkdf2==1.3, pyyaml, protobuf==3.6.1, keyring==10.4.0, defusedxml, git+https://github.com/lbryio/aioupnp.git@ab7ef0048bbce6404e463d20e8a15046ea6941f0#egg=aioupnp, asn1crypto, mock, netifaces, cryptography, aiohttp==3.6.0, multidict==4.5.2, idna, yarl==1.3.0, chardet==3.0.4, async_timeout==3.0.1, coincurve, msgpack==0.6.1, six, attrs==18.2.0, pylru, hachoir, prometheus_client==0.7.1, "git+https://github.com/lbryio/lbry-sdk@v0.102.0#egg=lbry" # (str) Custom source folders for requirements # Sets custom source for any requirements with recipes -- 2.45.2 From 09599a2af347e38842ce516fc1dec8947be58943 Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Fri, 20 Aug 2021 22:42:54 +0100 Subject: [PATCH 12/13] typo --- recipes/python3crystax/patch/patch_python3.9.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/python3crystax/patch/patch_python3.9.patch b/recipes/python3crystax/patch/patch_python3.9.patch index 34c51f8..14ca0b0 100644 --- a/recipes/python3crystax/patch/patch_python3.9.patch +++ b/recipes/python3crystax/patch/patch_python3.9.patch @@ -18,7 +18,7 @@ diff --git a/Modules/getpath.c b/Modules/getpath.c +/* + These variables were set this way in older versions of Python, but -+ changed from 3.5.1 and 3.5.2. ++ changed from 3.5.1 to 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. -- 2.45.2 From 1e7eba7c714df08301e98f00a880a9428ed31fbf Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Fri, 20 Aug 2021 22:47:16 +0100 Subject: [PATCH 13/13] Add base Dockerfiles for builds --- docker/Dockerfile.python37.platform-28 | 36 ++++++++++++++++++++++ docker/Dockerfile.python39.platform-28 | 41 ++++++++++++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100644 docker/Dockerfile.python37.platform-28 create mode 100644 docker/Dockerfile.python39.platform-28 diff --git a/docker/Dockerfile.python37.platform-28 b/docker/Dockerfile.python37.platform-28 new file mode 100644 index 0000000..29d03be --- /dev/null +++ b/docker/Dockerfile.python37.platform-28 @@ -0,0 +1,36 @@ +FROM ubuntu:18.04 + +RUN export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 +RUN dpkg --add-architecture i386 +RUN apt-get -y update && apt-get -y install curl ca-certificates software-properties-common gpg-agent wget +RUN add-apt-repository ppa:deadsnakes/ppa -y +RUN apt-get -y update && apt-get -y install autoconf autogen automake libtool libffi-dev \ + build-essential python3.7 python3.7-dev python3.7-venv python3-pip ccache git libncurses5:i386 libstdc++6:i386 \ + libgtk2.0-0:i386 libpangox-1.0-0:i386 libpangoxft-1.0-0:i386 libidn11:i386 python2.7 python2.7-dev \ + python-pip openjdk-8-jdk unzip zlib1g-dev zlib1g:i386 m4 libc6-dev-i386 gawk + +RUN pip install --upgrade cython==0.28.1 setuptools zipp==1.2.0 importlib-resources==1.0.2 importlib-metadata==0.20 virtualenv==20.4.7 + +RUN git clone https://github.com/lbryio/buildozer.git +RUN cd buildozer && python2 setup.py install && cd .. + +RUN mkdir -p cd ~/.buildozer/android/platform/ + +RUN wget 'https://dl.google.com/android/android-sdk_r23-linux.tgz' -P ~/.buildozer/android/platform/ && \ + wget 'https://dl.google.com/android/repository/platform-28_r06.zip' -P ~/.buildozer/android/platform/ && \ + wget 'https://dl.google.com/android/repository/build-tools_r28.0.3-linux.zip' -P ~/.buildozer/android/platform/ && \ + tar -xvf ~/.buildozer/android/platform/android-sdk_r23-linux.tgz -C ~/.buildozer/android/platform/ && \ + mv ~/.buildozer/android/platform/android-sdk-linux ~/.buildozer/android/platform/android-sdk-23 && \ + unzip ~/.buildozer/android/platform/platform-28_r06.zip -d ~/.buildozer/android/platform/android-sdk-23/platforms && \ + mv ~/.buildozer/android/platform/android-sdk-23/platforms/android-9 ~/.buildozer/android/platform/android-sdk-23/platforms/android-28 && \ + mkdir -p ~/.buildozer/android/platform/android-sdk-23/build-tools && \ + unzip ~/.buildozer/android/platform/build-tools_r28.0.3-linux.zip -d ~/.buildozer/android/platform/android-sdk-23/build-tools && \ + mv ~/.buildozer/android/platform/android-sdk-23/build-tools/android-9 ~/.buildozer/android/platform/android-sdk-23/build-tools/28.0.3 && \ + rm ~/.buildozer/android/platform/android-sdk_r23-linux.tgz && \ + rm ~/.buildozer/android/platform/platform-28_r06.zip && \ + rm ~/.buildozer/android/platform/build-tools_r28.0.3-linux.zip + +RUN mkdir -p ~/.buildozer/android/platform/android-sdk-23/licenses && \ + echo $'\n8933bad161af4178b1185d1a37fbf41ea5269c55\nd56f5187479451eabf01fb78af6dfcb131a6481e\n24333f8a63b6825ea9c5514f83c2829b004d1fee' > ~/.buildozer/android/platform/android-sdk-23/licenses/android-sdk-license + +CMD ["/bin/bash"] diff --git a/docker/Dockerfile.python39.platform-28 b/docker/Dockerfile.python39.platform-28 new file mode 100644 index 0000000..ffe1651 --- /dev/null +++ b/docker/Dockerfile.python39.platform-28 @@ -0,0 +1,41 @@ +FROM ubuntu:18.04 + +RUN export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 +RUN dpkg --add-architecture i386 +RUN apt-get -y update && apt-get -y install curl ca-certificates software-properties-common gpg-agent wget +RUN add-apt-repository ppa:deadsnakes/ppa -y +RUN apt-get -y update && DEBIAN_FRONTEND=noninteractive apt-get -y install autoconf autogen automake libtool libffi-dev \ + build-essential python3.9 python3.9-dev python3.9-venv python3-pip ccache git libncurses5:i386 libstdc++6:i386 \ + libgtk2.0-0:i386 libpangox-1.0-0:i386 libpangoxft-1.0-0:i386 libidn11:i386 python2.7 python2.7-dev \ + python-pip openjdk-8-jdk unzip zlib1g-dev zlib1g:i386 m4 libc6-dev-i386 gawk + +RUN rm /usr/bin/python3 && ln -s /usr/bin/python3.9 /usr/bin/python3 +RUN rm /usr/bin/python && ln -s /usr/bin/python2.7 /usr/bin/python + +RUN pip install --upgrade cython==0.29.15 setuptools zipp==1.2.0 importlib-resources==1.0.2 importlib-metadata==0.20 virtualenv==20.4.7 appdirs sh colorama==0.3.3 jinja2 six pep517\<0.7.0 toml + +RUN git clone https://github.com/lbryio/buildozer.git +RUN cd buildozer && python2 setup.py install && cd .. + +RUN mkdir -p cd ~/.buildozer/android/platform/ + +RUN wget 'https://dl.google.com/android/android-sdk_r23-linux.tgz' -P ~/.buildozer/android/platform/ && \ + wget 'https://dl.google.com/android/repository/platform-28_r06.zip' -P ~/.buildozer/android/platform/ && \ + wget 'https://dl.google.com/android/repository/build-tools_r28.0.3-linux.zip' -P ~/.buildozer/android/platform/ && \ + tar -xvf ~/.buildozer/android/platform/android-sdk_r23-linux.tgz -C ~/.buildozer/android/platform/ && \ + mv ~/.buildozer/android/platform/android-sdk-linux ~/.buildozer/android/platform/android-sdk-23 && \ + unzip ~/.buildozer/android/platform/platform-28_r06.zip -d ~/.buildozer/android/platform/android-sdk-23/platforms && \ + mv ~/.buildozer/android/platform/android-sdk-23/platforms/android-9 ~/.buildozer/android/platform/android-sdk-23/platforms/android-28 && \ + mkdir -p ~/.buildozer/android/platform/android-sdk-23/build-tools && \ + unzip ~/.buildozer/android/platform/build-tools_r28.0.3-linux.zip -d ~/.buildozer/android/platform/android-sdk-23/build-tools && \ + mv ~/.buildozer/android/platform/android-sdk-23/build-tools/android-9 ~/.buildozer/android/platform/android-sdk-23/build-tools/28.0.3 && \ + rm ~/.buildozer/android/platform/android-sdk_r23-linux.tgz && \ + rm ~/.buildozer/android/platform/platform-28_r06.zip && \ + rm ~/.buildozer/android/platform/build-tools_r28.0.3-linux.zip + +RUN mkdir -p ~/.buildozer/android/platform/android-sdk-23/licenses && \ + echo $'\n8933bad161af4178b1185d1a37fbf41ea5269c55\nd56f5187479451eabf01fb78af6dfcb131a6481e\n24333f8a63b6825ea9c5514f83c2829b004d1fee' > ~/.buildozer/android/platform/android-sdk-23/licenses/android-sdk-license + +RUN pip3 install --upgrade setuptools==51.0.0 + +CMD ["/bin/bash"] -- 2.45.2