Skip to content

Commit f0c7499

Browse files
Oliver Marksolymk2
authored andcommitted
adjusted the patch file to try a new build
1 parent 82e8921 commit f0c7499

File tree

3 files changed

+79
-4
lines changed

3 files changed

+79
-4
lines changed

recipes/python/patches/Python-2.7.2-ctypes-disable-wchar.patch

Lines changed: 56 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
diff -uNr Python-2.7.2.orig/Lib/ctypes/__init__.py Python-2.7.2/Lib/ctypes/__init__.py
2-
--- Python-2.7.2.orig/Lib/ctypes/__init__.py 2011-06-11 17:46:24.000000000 +0200
3-
+++ Python-2.7.2/Lib/ctypes/__init__.py 2012-08-30 13:40:38.837698797 +0200
1+
diff -ur '--exclude=*~' Python-2.7.2.orig/Lib/ctypes/__init__.py Python-2.7.2/Lib/ctypes/__init__.py
2+
--- Python-2.7.2.orig/Lib/ctypes/__init__.py 2011-06-11 16:46:24.000000000 +0100
3+
+++ Python-2.7.2/Lib/ctypes/__init__.py 2015-03-19 12:32:45.747723687 +0000
44
@@ -272,31 +272,34 @@
55
else:
66
set_conversion_mode("ascii", "strict")
@@ -61,3 +61,56 @@ diff -uNr Python-2.7.2.orig/Lib/ctypes/__init__.py Python-2.7.2/Lib/ctypes/__ini
6161

6262
POINTER(c_char).from_param = c_char_p.from_param #_SimpleCData.c_char_p_from_param
6363

64+
diff -ur '--exclude=*~' Python-2.7.2.orig/Modules/_ctypes/callproc.c Python-2.7.2/Modules/_ctypes/callproc.c
65+
--- Python-2.7.2.orig/Modules/_ctypes/callproc.c 2015-03-19 11:56:40.668159317 +0000
66+
+++ Python-2.7.2/Modules/_ctypes/callproc.c 2015-03-19 11:45:45.898288000 +0000
67+
@@ -1423,7 +1423,7 @@
68+
mode |= RTLD_NOW;
69+
handle = ctypes_dlopen(name, mode);
70+
if (!handle) {
71+
- char *errmsg = ctypes_dlerror();
72+
+ const char *errmsg = ctypes_dlerror();
73+
if (!errmsg)
74+
errmsg = "dlopen() error";
75+
PyErr_SetString(PyExc_OSError,
76+
diff -ur '--exclude=*~' Python-2.7.2.orig/Modules/_ctypes/libffi/src/dlmalloc.c Python-2.7.2/Modules/_ctypes/libffi/src/dlmalloc.c
77+
--- Python-2.7.2.orig/Modules/_ctypes/libffi/src/dlmalloc.c 2015-03-19 13:26:58.928438829 +0000
78+
+++ Python-2.7.2/Modules/_ctypes/libffi/src/dlmalloc.c 2015-03-19 15:32:19.042396376 +0000
79+
@@ -614,18 +614,6 @@
80+
#include "/usr/include/malloc.h"
81+
#else /* HAVE_USR_INCLUDE_MALLOC_H */
82+
83+
-struct mallinfo {
84+
- MALLINFO_FIELD_TYPE arena; /* non-mmapped space allocated from system */
85+
- MALLINFO_FIELD_TYPE ordblks; /* number of free chunks */
86+
- MALLINFO_FIELD_TYPE smblks; /* always 0 */
87+
- MALLINFO_FIELD_TYPE hblks; /* always 0 */
88+
- MALLINFO_FIELD_TYPE hblkhd; /* space in mmapped regions */
89+
- MALLINFO_FIELD_TYPE usmblks; /* maximum total allocated space */
90+
- MALLINFO_FIELD_TYPE fsmblks; /* always 0 */
91+
- MALLINFO_FIELD_TYPE uordblks; /* total allocated space */
92+
- MALLINFO_FIELD_TYPE fordblks; /* total free space */
93+
- MALLINFO_FIELD_TYPE keepcost; /* releasable (via malloc_trim) space */
94+
-};
95+
96+
#endif /* HAVE_USR_INCLUDE_MALLOC_H */
97+
#endif /* NO_MALLINFO */
98+
@@ -966,7 +954,7 @@
99+
p = malloc(n);
100+
assert(malloc_usable_size(p) >= 256);
101+
*/
102+
-size_t dlmalloc_usable_size(void*);
103+
+size_t dlmalloc_usable_size(const void*);
104+
105+
/*
106+
malloc_stats();
107+
@@ -4384,7 +4372,7 @@
108+
internal_malloc_stats(gm);
109+
}
110+
111+
-size_t dlmalloc_usable_size(void* mem) {
112+
+size_t dlmalloc_usable_size(const void* mem) {
113+
if (mem != 0) {
114+
mchunkptr p = mem2chunk(mem);
115+
if (cinuse(p))
116+
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
--- Python-2.7.2.orig/Lib/ctypes/util.py 2011-06-11 16:46:24.000000000 +0100
2+
+++ Python-2.7.2/Lib/ctypes/util.py 2015-03-26 13:45:33.322172603 +0000
3+
@@ -83,7 +83,17 @@
4+
except ValueError:
5+
continue
6+
return None
7+
-
8+
+elif os.name == "posix" and sys.platform == "linux3":
9+
+ def find_library(name):
10+
+ """ hack to find librarys for kivy and android
11+
+ split the path and get the first parts which will give us
12+
+ the app path something like /data/data/org.app.foo/"""
13+
+ app_root = os.path.abspath('./').split(os.path.sep)[0:4]
14+
+ lib_search = os.path.sep.join(app_root) + os.path.sep + 'lib'
15+
+ for filename in os.listdir(lib_search):
16+
+ if filename.endswith('.so') and name in filename:
17+
+ return lib_search + os.path.sep + filename
18+
+ return None
19+
elif os.name == "posix":
20+
# Andreas Degert's find functions, using gcc, /sbin/ldconfig, objdump
21+
import re, tempfile, errno

recipes/python/recipe.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ function prebuild_python() {
3232
try patch -p1 < $RECIPE_python/patches/fix-remove-corefoundation.patch
3333
try patch -p1 < $RECIPE_python/patches/fix-dynamic-lookup.patch
3434
try patch -p1 < $RECIPE_python/patches/fix-dlfcn.patch
35+
try patch -p1 < $RECIPE_python/patches/ctypes-find-library.patch
3536

3637
system=$(uname -s)
3738
if [ "X$system" == "XDarwin" ]; then
@@ -94,7 +95,7 @@ function build_python() {
9495
fi
9596

9697
# CFLAGS for python ctypes library
97-
export CFLAGS="$CFLAGS -DNO_MALLINFO"
98+
#export CFLAGS="$CFLAGS -DNO_MALLINFO"
9899
export BUILDARCH=x86_64-linux-gnu
99100
export HOSTARCH=arm-eabi
100101

0 commit comments

Comments
 (0)