Skip to content

Commit

Permalink
Fixes (we should find a nicer way) numpy build on macOS [Failing duri…
Browse files Browse the repository at this point in the history
…ng runtime]
  • Loading branch information
misl6 committed May 28, 2022
1 parent 6228b23 commit 81d6f8a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pythonforandroid/recipes/numpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ class NumpyRecipe(CompiledComponentsPythonRecipe):
url = 'https://pypi.python.org/packages/source/n/numpy/numpy-{version}.zip'
site_packages_name = 'numpy'
depends = ['setuptools', 'cython']
install_in_hostpython = True
install_in_hostpython = False
call_hostpython_via_targetpython = False

patches = [
join("patches", "remove-default-paths.patch"),
join("patches", "add_libm_explicitly_to_build.patch"),
join("patches", "ranlib.patch"),
]

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

0 comments on commit 81d6f8a

Please sign in to comment.