summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/python/python-native/multilib.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/python/python-native/multilib.patch')
-rw-r--r--meta/recipes-devtools/python/python-native/multilib.patch240
1 files changed, 240 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python-native/multilib.patch b/meta/recipes-devtools/python/python-native/multilib.patch
new file mode 100644
index 0000000000..f8d7aee84b
--- /dev/null
+++ b/meta/recipes-devtools/python/python-native/multilib.patch
@@ -0,0 +1,240 @@
1commit 248279e54467a8cd5cde98fc124d1d1384703513
2Author: Yu Ke <ke.yu@intel.com>
3Date: Tue Jun 28 21:21:29 2011 +0800
4
5 SUSE patch for the lib64 issue
6
7 see detail in http://bugs.python.org/issue1294959
8
9 also rebased a bit for Yocto python 2.6.6
10
11 Picked-by: Yu Ke <ke.yu@intel.com>
12
13
142011/09/29
15The python recipe building was failing because python-native
16could not handle sys.lib var. sys.lib var is defined in the
17multilib patch hence added this multilib.patch for python-native
18recipe.
19Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
20
21Index: Python-2.7.2/Include/pythonrun.h
22===================================================================
23--- Python-2.7.2.orig/Include/pythonrun.h
24+++ Python-2.7.2/Include/pythonrun.h
25@@ -108,6 +108,7 @@ PyAPI_FUNC(char *) Py_GetPath(void);
26 /* In their own files */
27 PyAPI_FUNC(const char *) Py_GetVersion(void);
28 PyAPI_FUNC(const char *) Py_GetPlatform(void);
29+PyAPI_FUNC(const char *) Py_GetLib(void);
30 PyAPI_FUNC(const char *) Py_GetCopyright(void);
31 PyAPI_FUNC(const char *) Py_GetCompiler(void);
32 PyAPI_FUNC(const char *) Py_GetBuildInfo(void);
33Index: Python-2.7.2/Lib/distutils/command/install.py
34===================================================================
35--- Python-2.7.2.orig/Lib/distutils/command/install.py
36+++ Python-2.7.2/Lib/distutils/command/install.py
37@@ -22,6 +22,8 @@ from site import USER_BASE
38 from site import USER_SITE
39
40
41+libname = sys.lib
42+
43 if sys.version < "2.2":
44 WINDOWS_SCHEME = {
45 'purelib': '$base',
46@@ -42,7 +44,7 @@ else:
47 INSTALL_SCHEMES = {
48 'unix_prefix': {
49 'purelib': '$base/lib/python$py_version_short/site-packages',
50- 'platlib': '$platbase/lib/python$py_version_short/site-packages',
51+ 'platlib': '$platbase/'+libname+'/python$py_version_short/site-packages',
52 'headers': '$base/include/python$py_version_short/$dist_name',
53 'scripts': '$base/bin',
54 'data' : '$base',
55Index: Python-2.7.2/Lib/pydoc.py
56===================================================================
57--- Python-2.7.2.orig/Lib/pydoc.py
58+++ Python-2.7.2/Lib/pydoc.py
59@@ -352,7 +352,7 @@ class Doc:
60
61 docloc = os.environ.get("PYTHONDOCS",
62 "http://docs.python.org/library")
63- basedir = os.path.join(sys.exec_prefix, "lib",
64+ basedir = os.path.join(sys.exec_prefix, sys.lib,
65 "python"+sys.version[0:3])
66 if (isinstance(object, type(os)) and
67 (object.__name__ in ('errno', 'exceptions', 'gc', 'imp',
68Index: Python-2.7.2/Lib/site.py
69===================================================================
70--- Python-2.7.2.orig/Lib/site.py
71+++ Python-2.7.2/Lib/site.py
72@@ -300,13 +300,19 @@ def getsitepackages():
73 if sys.platform in ('os2emx', 'riscos'):
74 sitepackages.append(os.path.join(prefix, "Lib", "site-packages"))
75 elif os.sep == '/':
76- sitepackages.append(os.path.join(prefix, "lib",
77+ sitepackages.append(os.path.join(prefix, sys.lib,
78 "python" + sys.version[:3],
79 "site-packages"))
80- sitepackages.append(os.path.join(prefix, "lib", "site-python"))
81+ if sys.lib != "lib":
82+ sitepackages.append(os.path.join(prefix, "lib",
83+ "python" + sys.version[:3],
84+ "site-packages"))
85+ sitepackages.append(os.path.join(prefix, sys.lib, "site-python"))
86+ if sys.lib != "lib":
87+ sitepackages.append(os.path.join(prefix, "lib", "site-python"))
88 else:
89 sitepackages.append(prefix)
90- sitepackages.append(os.path.join(prefix, "lib", "site-packages"))
91+ sitepackages.append(os.path.join(prefix, sys.lib, "site-packages"))
92 if sys.platform == "darwin":
93 # for framework builds *only* we add the standard Apple
94 # locations.
95Index: Python-2.7.2/Lib/test/test_dl.py
96===================================================================
97--- Python-2.7.2.orig/Lib/test/test_dl.py
98+++ Python-2.7.2/Lib/test/test_dl.py
99@@ -5,10 +5,11 @@
100 import unittest
101 from test.test_support import verbose, import_module
102 dl = import_module('dl', deprecated=True)
103+import sys
104
105 sharedlibs = [
106- ('/usr/lib/libc.so', 'getpid'),
107- ('/lib/libc.so.6', 'getpid'),
108+ ('/usr/'+sys.lib+'/libc.so', 'getpid'),
109+ ('/'+sys.lib+'/libc.so.6', 'getpid'),
110 ('/usr/bin/cygwin1.dll', 'getpid'),
111 ('/usr/lib/libc.dylib', 'getpid'),
112 ]
113Index: Python-2.7.2/Lib/trace.py
114===================================================================
115--- Python-2.7.2.orig/Lib/trace.py
116+++ Python-2.7.2/Lib/trace.py
117@@ -762,10 +762,10 @@ def main(argv=None):
118 # should I also call expanduser? (after all, could use $HOME)
119
120 s = s.replace("$prefix",
121- os.path.join(sys.prefix, "lib",
122+ os.path.join(sys.prefix, sys.lib,
123 "python" + sys.version[:3]))
124 s = s.replace("$exec_prefix",
125- os.path.join(sys.exec_prefix, "lib",
126+ os.path.join(sys.exec_prefix, sys.lib,
127 "python" + sys.version[:3]))
128 s = os.path.normpath(s)
129 ignore_dirs.append(s)
130Index: Python-2.7.2/Makefile.pre.in
131===================================================================
132--- Python-2.7.2.orig/Makefile.pre.in
133+++ Python-2.7.2/Makefile.pre.in
134@@ -81,6 +81,7 @@ PY_CFLAGS= $(CFLAGS) $(CPPFLAGS) $(CFLAG
135
136 # Machine-dependent subdirectories
137 MACHDEP= @MACHDEP@
138+LIB= @LIB@
139
140 # Install prefix for architecture-independent files
141 prefix= @prefix@
142@@ -97,7 +98,7 @@ LIBDIR= @libdir@
143 MANDIR= @mandir@
144 INCLUDEDIR= @includedir@
145 CONFINCLUDEDIR= $(exec_prefix)/include
146-SCRIPTDIR= $(prefix)/lib
147+SCRIPTDIR= $(prefix)/@LIB@
148
149 # Detailed destination directories
150 BINLIBDEST= $(LIBDIR)/python$(VERSION)
151@@ -532,6 +533,7 @@ Modules/getpath.o: $(srcdir)/Modules/get
152 -DEXEC_PREFIX='"$(exec_prefix)"' \
153 -DVERSION='"$(VERSION)"' \
154 -DVPATH='"$(VPATH)"' \
155+ -DLIB='"$(LIB)"' \
156 -o $@ $(srcdir)/Modules/getpath.c
157
158 Modules/python.o: $(srcdir)/Modules/python.c
159@@ -566,7 +568,7 @@ $(AST_C): $(AST_ASDL) $(ASDLGEN_FILES)
160 Python/compile.o Python/symtable.o Python/ast.o: $(GRAMMAR_H) $(AST_H)
161
162 Python/getplatform.o: $(srcdir)/Python/getplatform.c
163- $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c
164+ $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -DLIB='"$(LIB)"' -o $@ $(srcdir)/Python/getplatform.c
165
166 Python/importdl.o: $(srcdir)/Python/importdl.c
167 $(CC) -c $(PY_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
168Index: Python-2.7.2/Modules/getpath.c
169===================================================================
170--- Python-2.7.2.orig/Modules/getpath.c
171+++ Python-2.7.2/Modules/getpath.c
172@@ -116,9 +116,11 @@
173 #define EXEC_PREFIX PREFIX
174 #endif
175
176+#define LIB_PYTHON LIB "/python" VERSION
177+
178 #ifndef PYTHONPATH
179-#define PYTHONPATH PREFIX "/lib/python" VERSION ":" \
180- EXEC_PREFIX "/lib/python" VERSION "/lib-dynload"
181+#define PYTHONPATH PREFIX "/" LIB_PYTHON ":" \
182+ EXEC_PREFIX "/" LIB_PYTHON "/lib-dynload"
183 #endif
184
185 #ifndef LANDMARK
186@@ -129,7 +131,7 @@ static char prefix[MAXPATHLEN+1];
187 static char exec_prefix[MAXPATHLEN+1];
188 static char progpath[MAXPATHLEN+1];
189 static char *module_search_path = NULL;
190-static char lib_python[] = "lib/python" VERSION;
191+static char lib_python[] = LIB_PYTHON;
192
193 static void
194 reduce(char *dir)
195Index: Python-2.7.2/Python/getplatform.c
196===================================================================
197--- Python-2.7.2.orig/Python/getplatform.c
198+++ Python-2.7.2/Python/getplatform.c
199@@ -10,3 +10,13 @@ Py_GetPlatform(void)
200 {
201 return PLATFORM;
202 }
203+
204+#ifndef LIB
205+#define LIB "lib"
206+#endif
207+
208+const char *
209+Py_GetLib(void)
210+{
211+ return LIB;
212+}
213Index: Python-2.7.2/Python/sysmodule.c
214===================================================================
215--- Python-2.7.2.orig/Python/sysmodule.c
216+++ Python-2.7.2/Python/sysmodule.c
217@@ -1416,6 +1416,8 @@ _PySys_Init(void)
218 PyString_FromString(Py_GetCopyright()));
219 SET_SYS_FROM_STRING("platform",
220 PyString_FromString(Py_GetPlatform()));
221+ SET_SYS_FROM_STRING("lib",
222+ PyString_FromString(Py_GetLib()));
223 SET_SYS_FROM_STRING("executable",
224 PyString_FromString(Py_GetProgramFullPath()));
225 SET_SYS_FROM_STRING("prefix",
226Index: Python-2.7.2/configure.in
227===================================================================
228--- Python-2.7.2.orig/configure.in
229+++ Python-2.7.2/configure.in
230@@ -629,6 +629,10 @@ SunOS*)
231 ;;
232 esac
233
234+AC_SUBST(LIB)
235+AC_MSG_CHECKING(LIB)
236+LIB=`basename ${libdir}`
237+AC_MSG_RESULT($LIB)
238
239 AC_SUBST(LIBRARY)
240 AC_MSG_CHECKING(LIBRARY)