Skip to content

Commit b59bd68

Browse files
committed
Merge branch 'numpypatch' of https://github.com/dl1ksv/python-for-android into dl1ksv-numpypatch
2 parents 97c50d9 + 3c77b92 commit b59bd68

File tree

4 files changed

+71
-1
lines changed

4 files changed

+71
-1
lines changed

recipes/numpy/patches/ar.patch

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--- a/numpy/distutils/unixccompiler.py 2015-02-01 17:38:21.000000000 +0100
2+
+++ b/numpy/distutils/unixccompiler.py 2015-07-08 17:21:05.742468485 +0200
3+
@@ -82,6 +82,8 @@
4+
pass
5+
self.mkpath(os.path.dirname(output_filename))
6+
tmp_objects = objects + self.objects
7+
+ from os import environ
8+
+ self.archiver[0] = 'arm-linux-androideabi-ar'
9+
while tmp_objects:
10+
objects = tmp_objects[:50]
11+
tmp_objects = tmp_objects[50:]

recipes/numpy/patches/lib.patch

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
--- a/numpy/linalg/setup.py 2015-07-09 14:15:59.850853336 +0200
2+
+++ b/numpy/linalg/setup.py 2015-07-09 14:21:59.403889000 +0200
3+
@@ -37,7 +37,8 @@
4+
config.add_extension('lapack_lite',
5+
sources = [get_lapack_lite_sources],
6+
depends = ['lapack_litemodule.c'] + lapack_lite_src,
7+
- extra_info = lapack_info
8+
+ extra_info = lapack_info,
9+
+ libraries = ['m'],
10+
)
11+
12+
# umath_linalg module
13+
@@ -46,7 +47,7 @@
14+
sources = [get_lapack_lite_sources],
15+
depends = ['umath_linalg.c.src'] + lapack_lite_src,
16+
extra_info = lapack_info,
17+
- libraries = ['npymath'],
18+
+ libraries = ['npymath','m'],
19+
)
20+
21+
return config
22+
--- a/numpy/fft/setup.py 2015-07-09 14:35:22.299888028 +0200
23+
+++ b/numpy/fft/setup.py 2015-07-09 14:33:54.858392578 +0200
24+
@@ -9,7 +9,8 @@
25+
26+
# Configure fftpack_lite
27+
config.add_extension('fftpack_lite',
28+
- sources=['fftpack_litemodule.c', 'fftpack.c']
29+
+ sources=['fftpack_litemodule.c', 'fftpack.c'],
30+
+ libraries = ['m']
31+
)
32+
33+
34+
--- a/numpy/random/setup.orig.py 2015-07-09 14:44:41.105174826 +0200
35+
+++ b/numpy/random/setup.py 2015-07-09 14:46:08.592679877 +0200
36+
@@ -38,7 +38,7 @@
37+
if needs_mingw_ftime_workaround():
38+
defs.append(("NPY_NEEDS_MINGW_TIME_WORKAROUND", None))
39+
40+
- libs = []
41+
+ libs = ['m']
42+
# Configure mtrand
43+
config.add_extension('mtrand',
44+
sources=[join('mtrand', x) for x in
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff --git a/numpy/distutils/system_info.py b/numpy/distutils/system_info.py
2+
index a050430..471e958 100644
3+
--- a/numpy/distutils/system_info.py
4+
+++ b/numpy/distutils/system_info.py
5+
@@ -610,6 +610,7 @@ class system_info:
6+
return self.get_paths(self.section, key)
7+
8+
def get_libs(self, key, default):
9+
+ return []
10+
try:
11+
libs = self.cp.get(self.section, key)
12+
except NoOptionError:

recipes/numpy/recipe.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ function prebuild_numpy() {
1515
fi
1616

1717
try patch -p1 < $RECIPE_numpy/patches/fix-numpy.patch
18+
try patch -p1 < $RECIPE_numpy/patches/ar.patch
19+
try patch -p1 < $RECIPE_numpy/patches/lib.patch
20+
try patch -p1 < $RECIPE_numpy/patches/prevent_libs_check.patch
1821
touch .patched
1922
}
2023

@@ -29,9 +32,9 @@ function build_numpy() {
2932
cd $BUILD_numpy
3033

3134
push_arm
32-
3335
try $HOSTPYTHON setup.py build_ext -v
3436
try find build/lib.* -name "*.o" -exec $STRIP {} \;
37+
env
3538
try $HOSTPYTHON setup.py install -O2
3639

3740
pop_arm

0 commit comments

Comments
 (0)