This commit is contained in:
Akinwale Ariwodola 2021-08-20 21:34:03 +01:00
parent 60d9bf07bd
commit 7759209dd0
8 changed files with 14 additions and 10 deletions

View file

@ -658,8 +658,8 @@ class BootstrapNDKRecipe(Recipe):
env['PYTHON_LINK_ROOT'] = self.ctx.python_recipe.link_root(arch.arch) env['PYTHON_LINK_ROOT'] = self.ctx.python_recipe.link_root(arch.arch)
env['EXTRA_LDLIBS'] = ' -lpython{}'.format( env['EXTRA_LDLIBS'] = ' -lpython{}'.format(
self.ctx.python_recipe.major_minor_version_string) self.ctx.python_recipe.major_minor_version_string)
if 'python3' in self.ctx.python_recipe.name: #if 'python3' in self.ctx.python_recipe.name:
env['EXTRA_LDLIBS'] += 'm' # env['EXTRA_LDLIBS'] += 'm'
return env return env
@ -803,7 +803,7 @@ class PythonRecipe(Recipe):
'python')) 'python'))
env['LDFLAGS'] += ' -L{}'.format( env['LDFLAGS'] += ' -L{}'.format(
join(ndk_dir_python, 'libs', arch.arch)) join(ndk_dir_python, 'libs', arch.arch))
env['LDFLAGS'] += ' -lpython{}m'.format(python_short_version) env['LDFLAGS'] += ' -lpython{}'.format(python_short_version)
hppath = [] hppath = []
hppath.append(join(dirname(self.hostpython_location), 'Lib')) hppath.append(join(dirname(self.hostpython_location), 'Lib'))

View file

@ -48,7 +48,7 @@ class CffiRecipe(CompiledComponentsPythonRecipe):
python_version = self.ctx.python_recipe.version[0:3] python_version = self.ctx.python_recipe.version[0:3]
ndk_dir_python = os.path.join(self.ctx.ndk_dir, 'sources/python/', python_version) 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'] += ' -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: # until `pythonforandroid/archs.py` gets merged upstream:
# https://github.com/kivy/python-for-android/pull/1250/files#diff-569e13021e33ced8b54385f55b49cbe6 # https://github.com/kivy/python-for-android/pull/1250/files#diff-569e13021e33ced8b54385f55b49cbe6
env['CFLAGS'] += ' -I{}/include/python/'.format(ndk_dir_python) env['CFLAGS'] += ' -I{}/include/python/'.format(ndk_dir_python)

View file

@ -26,7 +26,7 @@ class CoincurveRecipe(CompiledComponentsPythonRecipe):
if self.ctx.ndk == 'crystax': if self.ctx.ndk == 'crystax':
ndk_dir_python = os.path.join(self.ctx.ndk_dir, 'sources/python/', python_version) 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'] += ' -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: # until `pythonforandroid/archs.py` gets merged upstream:
# https://github.com/kivy/python-for-android/pull/1250/files#diff-569e13021e33ced8b54385f55b49cbe6 # https://github.com/kivy/python-for-android/pull/1250/files#diff-569e13021e33ced8b54385f55b49cbe6
env['CFLAGS'] += ' -I{}/include/python/'.format(ndk_dir_python) env['CFLAGS'] += ' -I{}/include/python/'.format(ndk_dir_python)

View file

@ -26,7 +26,7 @@ class CryptographyRecipe(CompiledComponentsPythonRecipe):
python_version = self.ctx.python_recipe.version[0:3] python_version = self.ctx.python_recipe.version[0:3]
ndk_dir_python = os.path.join(self.ctx.ndk_dir, 'sources/python/', python_version) 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'] += ' -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: # until `pythonforandroid/archs.py` gets merged upstream:
# https://github.com/kivy/python-for-android/pull/1250/files#diff-569e13021e33ced8b54385f55b49cbe6 # 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)) env['CFLAGS'] += ' -I{}/include/python/'.format(ndk_dir_python) + ' -L{}'.format(os.path.join(ndk_dir_python, 'libs', arch.arch))

View file

@ -23,7 +23,7 @@ class NetifacesRecipe(CompiledComponentsPythonRecipe):
python_version = self.ctx.python_recipe.version[0:3] python_version = self.ctx.python_recipe.version[0:3]
ndk_dir_python = os.path.join(self.ctx.ndk_dir, 'sources/python/', python_version) 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'] += ' -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: # until `pythonforandroid/archs.py` gets merged upstream:
# https://github.com/kivy/python-for-android/pull/1250/files#diff-569e13021e33ced8b54385f55b49cbe6 # https://github.com/kivy/python-for-android/pull/1250/files#diff-569e13021e33ced8b54385f55b49cbe6
env['CFLAGS'] += ' -I{}/include/python/'.format(ndk_dir_python) env['CFLAGS'] += ' -I{}/include/python/'.format(ndk_dir_python)

View file

@ -212,7 +212,11 @@ class Python3Recipe(TargetPythonRecipe):
os.mkdir(join(ndk_sources_python_dir, '3.9')) os.mkdir(join(ndk_sources_python_dir, '3.9'))
sh.sed('s#3.5#3.9#', sh.sed('s#3.5#3.9#',
join(ndk_sources_python_dir, '3.5/Android.mk'), 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')) _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): def build_arch(self, arch):
# If openssl is needed we may have to recompile cPython to get the # If openssl is needed we may have to recompile cPython to get the

View file

@ -9,7 +9,7 @@
#define PYTHON3_STDLIB_REL_PATH "stdlib.zip" #define PYTHON3_STDLIB_REL_PATH "stdlib.zip"
#define PYTHON3_MODULES_REL_PATH "modules" #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)) #define SYS_PATH_BUFFER_SIZE (2*(PATH_MAX + 1))

View file

@ -386,8 +386,8 @@ build_python_for_abi ()
if [ "$PYTHON_MAJOR_VERSION" = "2" ]; then if [ "$PYTHON_MAJOR_VERSION" = "2" ]; then
local PYTHON_CORE_MODULE_NAME='python'"$PYTHON_ABI" local PYTHON_CORE_MODULE_NAME='python'"$PYTHON_ABI"
else else
local PYTHON_CORE_MODULE_NAME='python'"$PYTHON_ABI"'m' local PYTHON_CORE_MODULE_NAME='python'"$PYTHON_ABI"
local PYTHON_SOABI='cpython-'"$PYTHON_ABI"'m' local PYTHON_SOABI='cpython-'"$PYTHON_ABI"
fi fi
{ {
echo 'LOCAL_PATH := $(call my-dir)' echo 'LOCAL_PATH := $(call my-dir)'