Skip to content

Commit 1b0066c

Browse files
author
lanmao
committed
Avoid rebuilding pybind11 for tflite-runtime
1 parent f93e955 commit 1b0066c

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

pythonforandroid/recipes/tflite-runtime/__init__.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ class TFLiteRuntimeRecipe(PythonRecipe):
2525

2626
version = '2.8.0'
2727
url = 'https://github.com/tensorflow/tensorflow/archive/refs/tags/v{version}.zip'
28-
depends = ['pybind11', 'numpy']
28+
depends = ['numpy']
29+
hostpython_prerequisites = ['pybind11==2.11.1']
2930
patches = ['CMakeLists.patch', 'build_with_cmake.patch']
3031
site_packages_name = 'tflite-runtime'
3132
call_hostpython_via_targetpython = False
@@ -49,6 +50,7 @@ def build_arch(self, arch):
4950
return
5051

5152
env = self.get_recipe_env(arch)
53+
self.install_hostpython_prerequisites()
5254

5355
# Directories
5456
root_dir = self.get_build_dir(arch.arch)
@@ -58,8 +60,9 @@ def build_arch(self, arch):
5860

5961
# Includes
6062
python_include_dir = self.ctx.python_recipe.include_root(arch.arch)
61-
pybind11_recipe = self.get_recipe('pybind11', self.ctx)
62-
pybind11_include_dir = pybind11_recipe.get_include_dir(arch)
63+
pybind11_include_dir = sh.Command(self.real_hostpython_location)(
64+
'-c', 'import pybind11; print(pybind11.get_include())'
65+
).strip()
6366
numpy_include_dir = join(self.ctx.get_site_packages_dir(arch),
6467
'numpy', '_core', 'include')
6568
if not exists(numpy_include_dir):

0 commit comments

Comments
 (0)