diff --git a/pythonforandroid/recipes/tflite-runtime/__init__.py b/pythonforandroid/recipes/tflite-runtime/__init__.py index 0627b7ae69..1d208866c2 100644 --- a/pythonforandroid/recipes/tflite-runtime/__init__.py +++ b/pythonforandroid/recipes/tflite-runtime/__init__.py @@ -1,4 +1,4 @@ -from pythonforandroid.recipe import PythonRecipe, current_directory,\ +from pythonforandroid.recipe import PythonRecipe, current_directory, \ shprint, info_main, warning from pythonforandroid.logger import error from os.path import join @@ -6,7 +6,6 @@ class TFLiteRuntimeRecipe(PythonRecipe): - ############################################################### # # tflite-runtime README: @@ -31,6 +30,15 @@ class TFLiteRuntimeRecipe(PythonRecipe): site_packages_name = 'tflite-runtime' call_hostpython_via_targetpython = False + def should_build(self, arch): + name = self.folder_name.replace('-', '_') + + if self.ctx.has_package(name, arch): + info_main('Python package already exists in site-packages') + return False + info_main('{} apparently isn\'t already in site-packages'.format(name)) + return True + def build_arch(self, arch): if arch.arch == 'x86_64': warning("******** tflite-runtime x86_64 will not be built *******") @@ -54,9 +62,9 @@ def build_arch(self, arch): pybind11_include_dir = pybind11_recipe.get_include_dir(arch) numpy_include_dir = join(self.ctx.get_site_packages_dir(arch), 'numpy', 'core', 'include') - includes = ' -I' + python_include_dir +\ - ' -I' + numpy_include_dir +\ - ' -I' + pybind11_include_dir + includes = ' -I' + python_include_dir + \ + ' -I' + numpy_include_dir + \ + ' -I' + pybind11_include_dir # Scripts build_script = join(script_dir, 'build_pip_package_with_cmake.sh')