1- from pythonforandroid .recipe import PythonRecipe , current_directory ,\
1+ from pythonforandroid .recipe import PythonRecipe , current_directory , \
22 shprint , info_main , warning
33from pythonforandroid .logger import error
44from os .path import join
55import sh
66
77
88class TFLiteRuntimeRecipe (PythonRecipe ):
9-
109 ###############################################################
1110 #
1211 # tflite-runtime README:
@@ -31,6 +30,15 @@ class TFLiteRuntimeRecipe(PythonRecipe):
3130 site_packages_name = 'tflite-runtime'
3231 call_hostpython_via_targetpython = False
3332
33+ def should_build (self , arch ):
34+ name = self .folder_name .replace ('-' , '_' )
35+
36+ if self .ctx .has_package (name , arch ):
37+ info_main ('Python package already exists in site-packages' )
38+ return False
39+ info_main ('{} apparently isn\' t already in site-packages' .format (name ))
40+ return True
41+
3442 def build_arch (self , arch ):
3543 if arch .arch == 'x86_64' :
3644 warning ("******** tflite-runtime x86_64 will not be built *******" )
@@ -54,9 +62,9 @@ def build_arch(self, arch):
5462 pybind11_include_dir = pybind11_recipe .get_include_dir (arch )
5563 numpy_include_dir = join (self .ctx .get_site_packages_dir (arch ),
5664 'numpy' , 'core' , 'include' )
57- includes = ' -I' + python_include_dir + \
58- ' -I' + numpy_include_dir + \
59- ' -I' + pybind11_include_dir
65+ includes = ' -I' + python_include_dir + \
66+ ' -I' + numpy_include_dir + \
67+ ' -I' + pybind11_include_dir
6068
6169 # Scripts
6270 build_script = join (script_dir , 'build_pip_package_with_cmake.sh' )
0 commit comments