Skip to content

Commit 2ca492a

Browse files
authored
Bumps numpy version to 1.22.3, cython version to 0.29.28 and fixes numpy build on macOS (kivy#2575)
1 parent f7f8cea commit 2ca492a

File tree

4 files changed

+18
-40
lines changed

4 files changed

+18
-40
lines changed

pythonforandroid/recipes/cython/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
class CythonRecipe(CompiledComponentsPythonRecipe):
55

6-
version = '0.29.15'
6+
version = '0.29.28'
77
url = 'https://github.com/cython/cython/archive/{version}.tar.gz'
88
site_packages_name = 'cython'
99
depends = ['setuptools']

pythonforandroid/recipes/numpy/__init__.py

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,30 @@
99

1010
class NumpyRecipe(CompiledComponentsPythonRecipe):
1111

12-
version = '1.18.1'
12+
version = '1.22.3'
1313
url = 'https://pypi.python.org/packages/source/n/numpy/numpy-{version}.zip'
1414
site_packages_name = 'numpy'
1515
depends = ['setuptools', 'cython']
1616
install_in_hostpython = True
1717
call_hostpython_via_targetpython = False
1818

1919
patches = [
20-
join('patches', 'hostnumpy-xlocale.patch'),
21-
join('patches', 'remove-default-paths.patch'),
22-
join('patches', 'add_libm_explicitly_to_build.patch'),
23-
join('patches', 'compiler_cxx_fix.patch'),
24-
]
20+
join("patches", "remove-default-paths.patch"),
21+
join("patches", "add_libm_explicitly_to_build.patch"),
22+
]
23+
24+
def get_recipe_env(self, arch=None, with_flags_in_cc=True):
25+
env = super().get_recipe_env(arch, with_flags_in_cc)
26+
27+
# _PYTHON_HOST_PLATFORM declares that we're cross-compiling
28+
# and avoids issues when building on macOS for Android targets.
29+
env["_PYTHON_HOST_PLATFORM"] = arch.command_prefix
30+
31+
# NPY_DISABLE_SVML=1 allows numpy to build for non-AVX512 CPUs
32+
# See: https://github.com/numpy/numpy/issues/21196
33+
env["NPY_DISABLE_SVML"] = "1"
34+
35+
return env
2536

2637
def _build_compiled_components(self, arch):
2738
info('Building compiled components in {}'.format(self.name))

pythonforandroid/recipes/numpy/patches/compiler_cxx_fix.patch

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

pythonforandroid/recipes/numpy/patches/hostnumpy-xlocale.patch

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

0 commit comments

Comments
 (0)