|
1 | 1 |
|
2 |
| -from pythonforandroid.toolchain import CompiledComponentsPythonRecipe, warning |
| 2 | +from pythonforandroid.toolchain import CompiledComponentsPythonRecipe, warning, Recipe |
3 | 3 |
|
| 4 | +from os.path import join |
4 | 5 |
|
5 | 6 | class MatplotlibRecipe(CompiledComponentsPythonRecipe):
|
6 | 7 |
|
7 | 8 | version = '1.5.0'
|
8 | 9 | url = 'https://github.com/matplotlib/matplotlib/archive/v{version}.zip'
|
9 | 10 |
|
10 |
| - depends = ['python2', 'numpy', 'freetype_ndk', 'png'] |
| 11 | + depends = ['python2', 'numpy', 'freetype_ndk', 'png', 'setuptools'] |
11 | 12 |
|
12 |
| - patches = [] |
| 13 | + patches = ['prevent_setuptools_download.patch', |
| 14 | + 'disable_extensions.patch', |
| 15 | + 'find_dependencies.patch', |
| 16 | + 'show_install_requires.patch'] |
13 | 17 |
|
| 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 |
14 | 33 |
|
15 | 34 |
|
16 | 35 | recipe = MatplotlibRecipe()
|
0 commit comments