Skip to content

Commit 81d6f8a

Browse files
committed
Fixes (we should find a nicer way) numpy build on macOS [Failing during runtime]
1 parent 6228b23 commit 81d6f8a

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

pythonforandroid/recipes/numpy/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@ class NumpyRecipe(CompiledComponentsPythonRecipe):
1313
url = 'https://pypi.python.org/packages/source/n/numpy/numpy-{version}.zip'
1414
site_packages_name = 'numpy'
1515
depends = ['setuptools', 'cython']
16-
install_in_hostpython = True
16+
install_in_hostpython = False
1717
call_hostpython_via_targetpython = False
1818

1919
patches = [
2020
join("patches", "remove-default-paths.patch"),
2121
join("patches", "add_libm_explicitly_to_build.patch"),
22+
join("patches", "ranlib.patch"),
2223
]
2324

2425
def get_recipe_env(self, arch=None, with_flags_in_cc=True):
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
diff -Naur numpy.orig/numpy/distutils/unixccompiler.py numpy/numpy/distutils/unixccompiler.py
2+
--- numpy.orig/numpy/distutils/unixccompiler.py 2022-05-28 10:22:10.000000000 +0200
3+
+++ numpy/numpy/distutils/unixccompiler.py 2022-05-28 10:22:24.000000000 +0200
4+
@@ -124,6 +124,7 @@
5+
# platform intelligence here to skip ranlib if it's not
6+
# needed -- or maybe Python's configure script took care of
7+
# it for us, hence the check for leading colon.
8+
+ self.ranlib = [os.environ.get('RANLIB')]
9+
if self.ranlib:
10+
display = '%s:@ %s' % (os.path.basename(self.ranlib[0]),
11+
output_filename)

0 commit comments

Comments
 (0)