Skip to content

Commit 9554c23

Browse files
committed
Added numpy include dir to mpl recipe
1 parent 5910c2c commit 9554c23

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed
Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,35 @@
11

2-
from pythonforandroid.toolchain import CompiledComponentsPythonRecipe, warning
2+
from pythonforandroid.toolchain import CompiledComponentsPythonRecipe, warning, Recipe
33

4+
from os.path import join
45

56
class MatplotlibRecipe(CompiledComponentsPythonRecipe):
67

78
version = '1.5.0'
89
url = 'https://github.com/matplotlib/matplotlib/archive/v{version}.zip'
910

10-
depends = ['python2', 'numpy', 'freetype_ndk', 'png']
11+
depends = ['python2', 'numpy', 'freetype_ndk', 'png', 'setuptools']
1112

12-
patches = []
13+
patches = ['prevent_setuptools_download.patch',
14+
'disable_extensions.patch',
15+
'find_dependencies.patch',
16+
'show_install_requires.patch']
1317

18+
call_hostpython_via_targetpython = False
19+
20+
def get_recipe_env(self, arch):
21+
env = super(MatplotlibRecipe, self).get_recipe_env(arch)
22+
23+
numpy_recipe = Recipe.get_recipe('numpy', self.ctx)
24+
25+
env['NUMPY_INCLUDE_DIR'] = join(
26+
numpy_recipe.get_build_container_dir(arch.arch),
27+
'numpy', 'core', 'include')
28+
29+
env['CFLAGS'] = env['CFLAGS'] + ' -I{jni_path}/png -I{jni_path}/freetype/include'.format(
30+
jni_path=join(self.ctx.bootstrap.build_dir, 'jni'))
31+
32+
return env
1433

1534

1635
recipe = MatplotlibRecipe()

0 commit comments

Comments
 (0)