Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix recipe kiwisolver (add cppy recipe) #2075

Merged
merged 1 commit into from
Mar 2, 2020
Merged
Show file tree
Hide file tree
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
17 changes: 17 additions & 0 deletions pythonforandroid/recipes/cppy/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from pythonforandroid.recipe import PythonRecipe


class CppyRecipe(PythonRecipe):
site_packages_name = 'cppy'

# Pin to commit: `Nucleic migration and project documentation`,
# because the official releases are too old, at time of writing
version = '4e0b956'
url = 'https://github.com/nucleic/cppy/archive/{version}.zip'
call_hostpython_via_targetpython = False
# to be detected by the matplotlib install script
install_in_hostpython = True
depends = ['setuptools']


recipe = CppyRecipe()
25 changes: 22 additions & 3 deletions pythonforandroid/recipes/kiwisolver/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,28 @@

class KiwiSolverRecipe(CppCompiledComponentsPythonRecipe):
site_packages_name = 'kiwisolver'
version = '0.1.3'
url = 'https://github.com/nucleic/kiwi/archive/master.zip'
depends = ['setuptools']
# Pin to commit `docs: attempt to fix doc building`, the latest one
# at the time of writing, just to be sure that we have te most up to date
# version, but it should be pinned to an official release once the c++
# changes that we want to include are merged to master branch
# Note: the commit we want to include is
# `Cppy use update and c++11 compatibility` (4858730)
version = '0846189'
url = 'https://github.com/nucleic/kiwi/archive/{version}.zip'
depends = ['cppy']

def get_recipe_env(self, arch=None, with_flags_in_cc=True):
env = super().get_recipe_env(arch, with_flags_in_cc)
if self.need_stl_shared:
# kiwisolver compile flags does not honor the standard flags:
# `CPPFLAGS` and `LDLIBS`, so we put in `CFLAGS` and `LDFLAGS` to
# correctly link with the `c++_shared` library
env['CFLAGS'] += f' -I{self.stl_include_dir}'
env['CFLAGS'] += ' -frtti -fexceptions'

env['LDFLAGS'] += f' -L{self.get_stl_lib_dir(arch)}'
env['LDFLAGS'] += f' -l{self.stl_lib_name}'
return env


recipe = KiwiSolverRecipe()