1
- from pythonforandroid .recipe import PythonRecipe , current_directory ,\
1
+ from pythonforandroid .recipe import PythonRecipe , current_directory , \
2
2
shprint , info_main , warning
3
3
from pythonforandroid .logger import error
4
4
from os .path import join
5
5
import sh
6
6
7
7
8
8
class TFLiteRuntimeRecipe (PythonRecipe ):
9
-
10
9
###############################################################
11
10
#
12
11
# tflite-runtime README:
@@ -31,6 +30,15 @@ class TFLiteRuntimeRecipe(PythonRecipe):
31
30
site_packages_name = 'tflite-runtime'
32
31
call_hostpython_via_targetpython = False
33
32
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
+
34
42
def build_arch (self , arch ):
35
43
if arch .arch == 'x86_64' :
36
44
warning ("******** tflite-runtime x86_64 will not be built *******" )
@@ -54,9 +62,9 @@ def build_arch(self, arch):
54
62
pybind11_include_dir = pybind11_recipe .get_include_dir (arch )
55
63
numpy_include_dir = join (self .ctx .get_site_packages_dir (arch ),
56
64
'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
60
68
61
69
# Scripts
62
70
build_script = join (script_dir , 'build_pip_package_with_cmake.sh' )
0 commit comments