Skip to content

Commit 0a12bad

Browse files
committed
Cleanup
1 parent f96f6de commit 0a12bad

File tree

6 files changed

+8
-112
lines changed

6 files changed

+8
-112
lines changed

pythonforandroid/recipe.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ class Recipe(with_metaclass(RecipeMeta)):
123123
"""
124124

125125
need_stl_shared = False
126-
'''Some libraries or python packages may need to be linked with android's
127-
stl. We can automatically do this for any recipe if we set this property to
126+
'''Some libraries or python packages may need the c++_shared in APK.
127+
We can automatically do this for any recipe if we set this property to
128128
`True`'''
129129

130130
stl_lib_name = 'c++_shared'

pythonforandroid/recipes/cppy/__init__.py

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

44
class CppyRecipe(PythonRecipe):
55
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
96
version = '1.1.0'
107
url = 'https://github.com/nucleic/cppy/archive/{version}.zip'
118
call_hostpython_via_targetpython = False

pythonforandroid/recipes/kiwisolver/__init__.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@
33

44
class KiwiSolverRecipe(CppCompiledComponentsPythonRecipe):
55
site_packages_name = 'kiwisolver'
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)
126
version = '1.3.2'
137
url = 'https://github.com/nucleic/kiwi/archive/{version}.zip'
148
depends = ['cppy']

pythonforandroid/recipes/matplotlib/__init__.py

Lines changed: 6 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from pythonforandroid.util import ensure_dir
33

44
from os.path import join
5+
import shutil
56

67

78
class MatplotlibRecipe(CppCompiledComponentsPythonRecipe):
@@ -13,14 +14,6 @@ class MatplotlibRecipe(CppCompiledComponentsPythonRecipe):
1314

1415
python_depends = ['cycler', 'fonttools', 'packaging', 'pyparsing', 'python-dateutil']
1516

16-
# We need to patch to:
17-
# - make mpl install work without importing numpy
18-
# - make mpl use shared libraries for freetype and png
19-
# - make mpl link to png16, to match p4a library name for png
20-
# - prevent mpl trying to build TkAgg, which wouldn't work
21-
# on Android anyway but has build issues
22-
# patches = ['mpl_android_fixes.patch']
23-
2417
def generate_libraries_pc_files(self, arch):
2518
"""
2619
Create *.pc files for libraries that `matplotib` depends on.
@@ -63,39 +56,21 @@ def generate_libraries_pc_files(self, arch):
6356
pc_file.write(text_buffer)
6457

6558
def prebuild_arch(self, arch):
66-
with open(join(self.get_recipe_dir(), 'setup.cfg.template')) as fileh:
67-
setup_cfg = fileh.read()
68-
69-
with open(join(self.get_build_dir(arch), 'mplsetup.cfg'), 'w') as fileh:
70-
fileh.write(setup_cfg.format(
71-
ndk_sysroot_usr=join(self.ctx.ndk.sysroot, 'usr')))
72-
59+
shutil.copyfile(
60+
join(self.get_recipe_dir(), "setup.cfg.template"),
61+
join(self.get_build_dir(arch), "mplsetup.cfg"),
62+
)
7363
self.generate_libraries_pc_files(arch)
7464

7565
def get_recipe_env(self, arch=None, with_flags_in_cc=True):
7666
env = super().get_recipe_env(arch, with_flags_in_cc)
7767

78-
# we modify `XDG_CACHE_HOME` to download `jquery-ui` into that folder,
79-
# or mpl install will fail when trying to download/install it, but if
80-
# we have the proper package already downloaded, it will use the cached
81-
# package to successfully finish the installation.
82-
# Note: this may not be necessary for some local systems, but it is
83-
# for our CI provider: `gh-actions`, which will
84-
# fail trying to download the `jquery-ui` package
85-
env['XDG_CACHE_HOME'] = join(self.get_build_dir(arch), 'p4a_files')
8668
# we make use of the same directory than `XDG_CACHE_HOME`, for our
8769
# custom library pc files, so we have all the install files that we
8870
# generate at the same place
71+
env['XDG_CACHE_HOME'] = join(self.get_build_dir(arch), 'p4a_files')
8972
env['PKG_CONFIG_PATH'] = env['XDG_CACHE_HOME']
9073

91-
# We set a new environ variable `NUMPY_INCLUDES` to be able to tell
92-
# the matplotlib script where to find our numpy without importing it
93-
# (which will fail, because numpy isn't installed in our hostpython)
94-
env['NUMPY_INCLUDES'] = join(
95-
self.ctx.get_site_packages_dir(arch),
96-
'numpy', 'core', 'include',
97-
)
98-
9974
# creating proper *.pc files for our libraries does not seem enough to
10075
# success with our build (without depending on system development
10176
# libraries), but if we tell the compiler where to find our libraries

pythonforandroid/recipes/matplotlib/libpng.pc.template

Lines changed: 0 additions & 10 deletions
This file was deleted.

pythonforandroid/recipes/matplotlib/mpl_android_fixes.patch

Lines changed: 0 additions & 60 deletions
This file was deleted.

0 commit comments

Comments
 (0)