Skip to content

Commit c1b94fd

Browse files
authored
Fix recipe kiwisolver (add cppy recipe) (#2075)
1 parent 9c6d8b8 commit c1b94fd

File tree

2 files changed

+39
-3
lines changed

2 files changed

+39
-3
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
from pythonforandroid.recipe import PythonRecipe
2+
3+
4+
class CppyRecipe(PythonRecipe):
5+
site_packages_name = 'cppy'
6+
7+
# Pin to commit: `Nucleic migration and project documentation`,
8+
# because the official releases are too old, at time of writing
9+
version = '4e0b956'
10+
url = 'https://github.com/nucleic/cppy/archive/{version}.zip'
11+
call_hostpython_via_targetpython = False
12+
# to be detected by the matplotlib install script
13+
install_in_hostpython = True
14+
depends = ['setuptools']
15+
16+
17+
recipe = CppyRecipe()

pythonforandroid/recipes/kiwisolver/__init__.py

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,28 @@
33

44
class KiwiSolverRecipe(CppCompiledComponentsPythonRecipe):
55
site_packages_name = 'kiwisolver'
6-
version = '0.1.3'
7-
url = 'https://github.com/nucleic/kiwi/archive/master.zip'
8-
depends = ['setuptools']
6+
# Pin to commit `docs: attempt to fix doc building`, the latest one
7+
# at the time of writing, just to be sure that we have te most up to date
8+
# version, but it should be pinned to an official release once the c++
9+
# changes that we want to include are merged to master branch
10+
# Note: the commit we want to include is
11+
# `Cppy use update and c++11 compatibility` (4858730)
12+
version = '0846189'
13+
url = 'https://github.com/nucleic/kiwi/archive/{version}.zip'
14+
depends = ['cppy']
15+
16+
def get_recipe_env(self, arch=None, with_flags_in_cc=True):
17+
env = super().get_recipe_env(arch, with_flags_in_cc)
18+
if self.need_stl_shared:
19+
# kiwisolver compile flags does not honor the standard flags:
20+
# `CPPFLAGS` and `LDLIBS`, so we put in `CFLAGS` and `LDFLAGS` to
21+
# correctly link with the `c++_shared` library
22+
env['CFLAGS'] += f' -I{self.stl_include_dir}'
23+
env['CFLAGS'] += ' -frtti -fexceptions'
24+
25+
env['LDFLAGS'] += f' -L{self.get_stl_lib_dir(arch)}'
26+
env['LDFLAGS'] += f' -l{self.stl_lib_name}'
27+
return env
928

1029

1130
recipe = KiwiSolverRecipe()

0 commit comments

Comments
 (0)