@@ -73,23 +73,28 @@ class Python3Recipe(TargetPythonRecipe):
7373 configure_args = [
7474 '--host={android_host}' ,
7575 '--build={android_build}' ,
76- '--enable-shared' ,
7776 '--enable-ipv6' ,
7877 '--enable-loadable-sqlite-extensions' ,
79- '--without-static-libpython' ,
80- '--without-readline' ,
78+ '--enable-shared' ,
79+
80+ # Attempt on making the builds lighter
81+ '--disable-test-modules' ,
82+ '--without-doc-strings' ,
8183 '--without-ensurepip' ,
84+ '--without-readline' ,
85+ '--without-static-libpython' ,
8286
8387 # Android prefix
8488 '--prefix={prefix}' ,
85- '--enable-loadable-sqlite-extensions' ,
8689
8790 # Special cross compile args
88- 'ac_cv_file__dev_ptmx=yes' ,
8991 'ac_cv_file__dev_ptc=no' ,
90- 'ac_cv_header_sys_eventfd_h=no' ,
91- 'ac_cv_little_endian_double=yes' ,
92+ 'ac_cv_file__dev_ptmx=yes' ,
9293 'ac_cv_header_bzlib_h=no' ,
94+ 'ac_cv_header_sys_eventfd_h=no' ,
95+ 'py_cv_module__curses=n/a' ,
96+ 'py_cv_module__curses_panel=n/a' ,
97+ 'py_cv_module__tkinter=n/a'
9398 ]
9499
95100 '''The configure arguments needed to build the python recipe. Those are
@@ -107,19 +112,24 @@ class Python3Recipe(TargetPythonRecipe):
107112
108113 stdlib_dir_blacklist = {
109114 '__pycache__' ,
110- 'test' ,
111- 'tests' ,
112- 'lib2to3' ,
115+ 'curses' ,
113116 'ensurepip' ,
114117 'idlelib' ,
118+ 'lib2to3' ,
119+ 'pydoc_data' ,
120+ 'test' ,
121+ 'tests' ,
115122 'tkinter' ,
123+ 'turtledemo' ,
124+ 'venv'
116125 }
117126 '''The directories that we want to omit for our python bundle'''
118127
119128 stdlib_filen_blacklist = [
120- '*.py' ,
121129 '*.exe' ,
130+ '*.py' ,
122131 '*.whl' ,
132+ 'turtle.pyc'
123133 ]
124134 '''The file extensions that we want to blacklist for our python bundle'''
125135
@@ -139,7 +149,8 @@ class Python3Recipe(TargetPythonRecipe):
139149 if the full path contains any of these exceptions.'''
140150
141151 site_packages_filen_blacklist = [
142- '*.py'
152+ '*.py' ,
153+ '*.pyx'
143154 ]
144155 '''The file extensions from site packages dir that we don't want to be
145156 included in our python bundle.'''
@@ -235,19 +246,18 @@ def prebuild_arch(self, arch):
235246 def get_recipe_env (self , arch = None , with_flags_in_cc = True ):
236247 env = super ().get_recipe_env (arch )
237248 env ['HOSTARCH' ] = arch .command_prefix
238-
239249 env ['CC' ] = arch .get_clang_exe (with_target = True )
240-
241- env ['PATH' ] = (
242- '{hostpython_dir}:{old_path}' ).format (
243- hostpython_dir = self .get_recipe (
244- 'host' + self .name , self .ctx ).get_path_to_python (),
245- old_path = env ['PATH' ])
246-
250+ env ['PATH' ] = '{hostpython_dir}:{old_path}' .format (
251+ hostpython_dir = self .get_recipe (
252+ 'host' + self .name , self .ctx
253+ ).get_path_to_python (),
254+ old_path = env ['PATH' ]
255+ )
247256 env ['CFLAGS' ] = ' ' .join (
248257 [
249- '-fPIC' ,
250- '-DANDROID'
258+ '-ffunction-sections' ,
259+ '-fdata-sections' ,
260+ '-fPIC'
251261 ]
252262 )
253263
@@ -402,7 +412,7 @@ def compile_python_files(self, dir):
402412 longer used...uses .pyc (https://www.python.org/dev/peps/pep-0488)
403413 '''
404414 args = [self .ctx .hostpython ]
405- args += ['-OO' , '-m' , 'compileall' , '-b' , '-f' , dir ]
415+ args += ['-OO' , '-m' , 'compileall' , '-b' , '-f' , '-q' , dir ]
406416 subprocess .call (args )
407417
408418 def create_python_bundle (self , dirn , arch ):
0 commit comments