Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions pythonforandroid/recipes/pybind11/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,31 @@


class Pybind11Recipe(PythonRecipe):
"""
Recipe to build pybind11 for Android using cmake.
"""

version = '2.11.1'
url = 'https://github.com/pybind/pybind11/archive/refs/tags/v{version}.zip'
depends = ['setuptools']
version = "2.11.1"
url = "https://github.com/pybind/pybind11/archive/refs/tags/v{version}.zip"

# Make sure we depend on setuptools and cmake
depends = ["setuptools", "cmake"]
# Don’t let p4a try to run setup.py through targetpython
call_hostpython_via_targetpython = False
# Install into hostpython, because pybind11 is a header-only lib
install_in_hostpython = True

def get_recipe_env(self, arch):
env = super().get_recipe_env(arch)
# Ensure cmake is found inside hostpython
env["PATH"] = "/usr/bin:" + env.get("PATH", "")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is weird, why would you need to add /usr/bin to the PATH, that should come as the default

return env

def get_include_dir(self, arch):
return join(self.get_build_dir(arch.arch), 'include')
"""
Return the directory where pybind11 headers will be located.
"""
return join(self.get_build_dir(arch.arch), "include")


recipe = Pybind11Recipe()