Skip to content

Commit 80160d3

Browse files
committed
numpy: merge patch, add fix testing
1 parent f5798ad commit 80160d3

File tree

4 files changed

+64
-25
lines changed

4 files changed

+64
-25
lines changed

distribute.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ function push_arm() {
135135
#export OFLAG="-Os"
136136
#export OFLAG="-O2"
137137

138-
export CFLAGS="-mandroid $OFLAG -fomit-frame-pointer --sysroot $NDKPLATFORM"
138+
export CFLAGS="-DANDROID -mandroid $OFLAG -fomit-frame-pointer --sysroot $NDKPLATFORM"
139139
if [ "X$ARCH" == "Xarmeabi-v7a" ]; then
140140
CFLAGS+=" -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb"
141141
fi

recipes/numpy/patches/fix-locale.patch

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

recipes/numpy/patches/fix-numpy.patch

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
diff -x build -x '*.pyc' -x '*.swp' -Naur numpy-1.7.1.orig/numpy/core/src/multiarray/numpyos.c numpy-1.7.1/numpy/core/src/multiarray/numpyos.c
2+
--- numpy-1.7.1.orig/numpy/core/src/multiarray/numpyos.c 2013-04-07 07:04:05.000000000 +0200
3+
+++ numpy-1.7.1/numpy/core/src/multiarray/numpyos.c 2013-05-03 10:57:35.812501674 +0200
4+
@@ -170,8 +170,7 @@
5+
static void
6+
_change_decimal_from_locale_to_dot(char* buffer)
7+
{
8+
- struct lconv *locale_data = localeconv();
9+
- const char *decimal_point = locale_data->decimal_point;
10+
+ const char *decimal_point = ".";
11+
12+
if (decimal_point[0] != '.' || decimal_point[1] != 0) {
13+
size_t decimal_point_len = strlen(decimal_point);
14+
@@ -455,8 +454,7 @@
15+
NPY_NO_EXPORT double
16+
NumPyOS_ascii_strtod(const char *s, char** endptr)
17+
{
18+
- struct lconv *locale_data = localeconv();
19+
- const char *decimal_point = locale_data->decimal_point;
20+
+ const char *decimal_point = ".";
21+
size_t decimal_point_len = strlen(decimal_point);
22+
23+
char buffer[FLOAT_FORMATBUFLEN+1];
24+
diff -x build -x '*.pyc' -x '*.swp' -Naur numpy-1.7.1.orig/numpy/core/src/private/npy_config.h numpy-1.7.1/numpy/core/src/private/npy_config.h
25+
--- numpy-1.7.1.orig/numpy/core/src/private/npy_config.h 2013-04-07 07:04:05.000000000 +0200
26+
+++ numpy-1.7.1/numpy/core/src/private/npy_config.h 2013-05-03 10:57:35.812501674 +0200
27+
@@ -41,4 +41,12 @@
28+
#define SIZEOF_PY_INTPTR_T 4
29+
#endif
30+
#endif
31+
+
32+
+/* Android only
33+
+ */
34+
+#ifdef ANDROID
35+
+#undef HAVE_LDEXPL
36+
+#undef HAVE_FREXPL
37+
+#endif
38+
+
39+
#endif
40+
diff -x build -x '*.pyc' -x '*.swp' -Naur numpy-1.7.1.orig/numpy/testing/__init__.py numpy-1.7.1/numpy/testing/__init__.py
41+
--- numpy-1.7.1.orig/numpy/testing/__init__.py 2013-04-07 07:04:05.000000000 +0200
42+
+++ numpy-1.7.1/numpy/testing/__init__.py 2013-05-03 11:05:57.620492127 +0200
43+
@@ -1,15 +1,5 @@
44+
-"""Common test support for all numpy test scripts.
45+
-
46+
-This single module should provide all the common functionality for numpy tests
47+
-in a single location, so that test scripts can just import it and work right
48+
-away.
49+
-"""
50+
-
51+
-from unittest import TestCase
52+
-
53+
-import decorators as dec
54+
-from utils import *
55+
-from numpytest import *
56+
-from nosetester import NoseTester as Tester
57+
-from nosetester import run_module_suite
58+
+# fake tester, android don't have unittest
59+
+class Tester(object):
60+
+ def test(self):
61+
+ pass
62+
test = Tester().test

recipes/numpy/recipe.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function prebuild_numpy() {
1414
return
1515
fi
1616

17-
try patch -p1 < $RECIPE_numpy/patches/fix-locale.patch
17+
try patch -p1 < $RECIPE_numpy/patches/fix-numpy.patch
1818
touch .patched
1919
}
2020

0 commit comments

Comments
 (0)