22from os .path import join
33import shutil
44
5- NUMPY_NDK_MESSAGE = "In order to build numpy, you must set minimum ndk api (minapi) to `24`.\n "
5+ NUMPY_NDK_MESSAGE = (
6+ "In order to build numpy, you must set minimum ndk api (minapi) to `24`.\n "
7+ )
68
79
810class NumpyRecipe (MesonRecipe ):
9- version = 'v2.3.0'
10- url = 'git+https://github.com/numpy/numpy'
11- hostpython_prerequisites = ["Cython>=3.0.6" , "numpy" ] # meson does not detects venv's cython
12- extra_build_args = ['-Csetup-args=-Dblas=none' , '-Csetup-args=-Dlapack=none' ]
11+ version = "v2.3.0"
12+ url = "git+https://github.com/numpy/numpy"
13+ extra_build_args = ["-Csetup-args=-Dblas=none" , "-Csetup-args=-Dlapack=none" ]
1314 need_stl_shared = True
1415 min_ndk_api_support = 24
1516
1617 def get_recipe_meson_options (self , arch ):
1718 options = super ().get_recipe_meson_options (arch )
18- # Custom python is required, so that meson
19- # gets libs and config files properly
20- options ["binaries" ]["python" ] = self .ctx .python_recipe .python_exe
21- options ["binaries" ]["python3" ] = self .ctx .python_recipe .python_exe
22- options ["properties" ]["longdouble_format" ] = "IEEE_DOUBLE_LE" if arch .arch in ["armeabi-v7a" , "x86" ] else "IEEE_QUAD_LE"
19+ options ["properties" ]["longdouble_format" ] = (
20+ "IEEE_DOUBLE_LE" if arch .arch in ["armeabi-v7a" , "x86" ] else "IEEE_QUAD_LE"
21+ )
2322 return options
2423
2524 def get_recipe_env (self , arch , ** kwargs ):
@@ -32,17 +31,16 @@ def get_recipe_env(self, arch, **kwargs):
3231 # NPY_DISABLE_SVML=1 allows numpy to build for non-AVX512 CPUs
3332 # See: https://github.com/numpy/numpy/issues/21196
3433 env ["NPY_DISABLE_SVML" ] = "1"
35- env ["TARGET_PYTHON_EXE" ] = join (Recipe .get_recipe (
36- "python3" , self .ctx ).get_build_dir (arch .arch ), "android-build" , "python" )
34+ env ["TARGET_PYTHON_EXE" ] = join (
35+ Recipe .get_recipe ("python3" , self .ctx ).get_build_dir (arch .arch ),
36+ "android-build" ,
37+ "python" ,
38+ )
3739 return env
3840
39- def build_arch (self , arch ):
40- super ().build_arch (arch )
41- self .restore_hostpython_prerequisites (["cython" ])
42-
4341 def get_hostrecipe_env (self , arch = None ):
4442 env = super ().get_hostrecipe_env (arch = arch )
45- env [' RANLIB' ] = shutil .which (' ranlib' )
43+ env [" RANLIB" ] = shutil .which (" ranlib" )
4644 return env
4745
4846
0 commit comments